db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r797147 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
Date Thu, 23 Jul 2009 17:04:11 GMT
Author: mamta
Date: Thu Jul 23 17:04:11 2009
New Revision: 797147

URL: http://svn.apache.org/viewvc?rev=797147&view=rev
Log:
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/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java?rev=797147&r1=797146&r2=797147&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
Thu Jul 23 17:04:11 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