tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1460316 - in /tomcat/tc7.0.x/trunk: ./ modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java webapps/docs/changelog.xml
Date Sun, 24 Mar 2013 11:32:11 GMT
Author: kkolinko
Date: Sun Mar 24 11:32:10 2013
New Revision: 1460316

URL: http://svn.apache.org/r1460316
Log:
Merged revision 1460313 from tomcat/trunk:
Fix NPE in SlowQueryReportJmx.getObjectName() when running TestSlowQueryReport test

When SlowQueryReportJmx.getObjectName(..) was converted from being a static method into an
instance one in r1354173,
TestSlowQueryReport was changed to call "new SlowQueryReportJmx().getObjectName(..)".
The call fails with NPE, because the SlowQueryReportJmx.getProperties() returns null.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1460313

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java?rev=1460316&r1=1460315&r2=1460316&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
(original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
Sun Mar 24 11:32:10 2013
@@ -270,9 +270,10 @@ public class SlowQueryReportJmx extends 
 
 
     public ObjectName getObjectName(Class<?> clazz, String poolName) throws MalformedObjectNameException
{
-        ObjectName oname = null;
-        if (getProperties().containsKey(objectNameAttribute)) {
-            oname = new ObjectName(getProperties().get(objectNameAttribute).getValue());
+        ObjectName oname;
+        Map<String,InterceptorProperty> properties = getProperties();
+        if (properties != null && properties.containsKey(objectNameAttribute)) {
+            oname = new ObjectName(properties.get(objectNameAttribute).getValue());
         } else {
             oname = new ObjectName(ConnectionPool.POOL_JMX_TYPE_PREFIX+clazz.getName()+",name="
+ poolName);
         }

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1460316&r1=1460315&r2=1460316&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sun Mar 24 11:32:10 2013
@@ -69,6 +69,10 @@
         <bug>54732</bug>: Fix leak of statements in <code>StatementCache</code>
         interceptor. (kkolinko)
       </fix>
+      <fix>
+        Fix NPE in <code>SlowQueryReportJmx</code> when running
+        <code>TestSlowQueryReport</code> test. (kkolinko)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">



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


Mime
View raw message