tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r730893 - /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java
Date Sat, 03 Jan 2009 02:34:10 GMT
Author: fhanik
Date: Fri Jan  2 18:34:10 2009
New Revision: 730893

URL: http://svn.apache.org/viewvc?rev=730893&view=rev
Log:
correct array math

Modified:
    tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java?rev=730893&r1=730892&r2=730893&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java
Fri Jan  2 18:34:10 2009
@@ -61,14 +61,11 @@
     
     @Override 
     public MBeanNotificationInfo[] getNotificationInfo() { 
-	MBeanNotificationInfo[] pres = super.getNotificationInfo();
-	MBeanNotificationInfo[] loc = getDefaultNotificationInfo();
-	MBeanNotificationInfo[] aug = new MBeanNotificationInfo[
-						pres.length + loc.length
-							];
- 	System.arraycopy(pres, 0, aug, 0, pres.length);
-	System.arraycopy(loc, 0, aug, pres.length+1, loc.length);	
-	
+        MBeanNotificationInfo[] pres = super.getNotificationInfo();
+        MBeanNotificationInfo[] loc = getDefaultNotificationInfo();
+        MBeanNotificationInfo[] aug = new MBeanNotificationInfo[pres.length + loc.length];
+        if (pres.length>0) System.arraycopy(pres, 0, aug, 0, pres.length);
+        if (loc.length >0) System.arraycopy(loc, 0, aug, pres.length>0?pres.length+1:0,
loc.length);    
         return aug; 
     } 
     



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message