geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akulshresh...@apache.org
Subject svn commit: r526204 - /geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/binding/GBeanBinding.java
Date Fri, 06 Apr 2007 15:52:15 GMT
Author: akulshreshtha
Date: Fri Apr  6 08:52:14 2007
New Revision: 526204

URL: http://svn.apache.org/viewvc?view=rev&rev=526204
Log:
GERONIMO-2612 Porting the Fix for NPE during shutdown from trunk
              http://svn.apache.org/viewvc?view=rev&rev=488106

Modified:
    geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/binding/GBeanBinding.java

Modified: geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/binding/GBeanBinding.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/binding/GBeanBinding.java?view=diff&rev=526204&r1=526203&r2=526204
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/binding/GBeanBinding.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/binding/GBeanBinding.java
Fri Apr  6 08:52:14 2007
@@ -156,12 +156,13 @@
      * @param abstractName the abstract name of the gbean to unbind
      */
     protected synchronized void removeBinding(AbstractName abstractName) {
-        if (first(bindings).getKey().equals(abstractName)) {
+        Map.Entry entry = first(bindings);
+        if (entry != null && entry.getKey().equals(abstractName)) {
             Object oldValue = bindings.remove(abstractName);
-            Map.Entry newEntry = first(bindings);
-            if (newEntry != null) {
-                Object newAbstractName = newEntry.getValue();
-                Object newValue = newEntry.getValue();
+            entry = first(bindings);
+            if (entry != null) {
+                Object newAbstractName = entry.getValue();
+                Object newValue = entry.getValue();
                 try {
                     context.rebind(name, newValue);
                 } catch (NamingException e) {



Mime
View raw message