db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r797434 - in /db/derby/code/branches/10.5: ./ java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
Date Fri, 24 Jul 2009 12:55:31 GMT
Author: mamta
Date: Fri Jul 24 12:55:31 2009
New Revision: 797434

URL: http://svn.apache.org/viewvc?rev=797434&view=rev
Log:
Merging 797147 from trunk into 10.5 codeline. We make a check for nullability before accessing
registeredMbeans. The commit comments for revision 797147 are as follows

******************** 
DERBY-4306 

registeredMbeans is null but we do not check for nullability before executing following 
if (registeredMbeans.remove(mbeanName) == null) 
which resulted in NPE. 

I have fixed the problem by checking for nullability first. registeredMbeans will be null
if someone shuts down the engine first and then later on issues a command to shutdown the
server. During the shutdown, registeredMbeans will be null and we should check for that nullability
before accessing it. 
******************** 

Modified:
    db/derby/code/branches/10.5/   (props changed)
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java

Propchange: db/derby/code/branches/10.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 24 12:55:31 2009
@@ -1 +1 @@
-/db/derby/code/trunk:769596,772090,772449,772534,774281,779681,782991,785163,785570,785662,788369,788670,788674,788968,789264,790218,792434,793588,794955,795166,796020,796027
+/db/derby/code/trunk:769596,772090,772449,772534,774281,779681,782991,785163,785570,785662,788369,788670,788674,788968,789264,790218,792434,793588,794955,795166,796020,796027,797147

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java?rev=797434&r1=797433&r2=797434&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
Fri Jul 24 12:55:31 2009
@@ -283,6 +283,10 @@
      */
     private synchronized void unregisterMBean(final ObjectName mbeanName)
     {
+        //Has this service been shut down?
+        if (registeredMbeans == null)
+            return;
+
         if (registeredMbeans.remove(mbeanName) == null)
             return;
         



Mime
View raw message