activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [02/37] activemq-6 git commit: ACTIVEMQ6-14 NPE during init
Date Wed, 10 Dec 2014 16:11:28 GMT
ACTIVEMQ6-14 NPE during init


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/4f925c5a
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/4f925c5a
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/4f925c5a

Branch: refs/heads/master
Commit: 4f925c5a44c592bda02d5e23335f35a0291a5590
Parents: 77bdb9d
Author: jbertram <jbertram@redhat.com>
Authored: Fri Dec 5 14:00:49 2014 -0600
Committer: jbertram <jbertram@redhat.com>
Committed: Wed Dec 10 09:49:12 2014 -0600

----------------------------------------------------------------------
 .../jms/server/impl/JMSServerManagerImpl.java   | 33 +++++++++++++-------
 1 file changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/4f925c5a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
index 3261033..85e7032 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
@@ -620,18 +620,23 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                   throw new IllegalArgumentException("Queue does not exist");
                }
 
-               ArrayList<String> bindings = new ArrayList<String>();
+               String[] usedJNDI = null;
 
-               for (String jndiItem : jndi)
+               if (jndi != null)
                {
-                  if (bindToJndi(jndiItem, destination))
+                  ArrayList<String> bindings = new ArrayList<String>();
+
+                  for (String jndiItem : jndi)
                   {
-                     bindings.add(jndiItem);
+                     if (bindToJndi(jndiItem, destination))
+                     {
+                        bindings.add(jndiItem);
+                     }
                   }
-               }
 
-               String[] usedJNDI = bindings.toArray(new String[bindings.size()]);
-               addToBindings(queueJNDI, queueName, usedJNDI);
+                  usedJNDI = bindings.toArray(new String[bindings.size()]);
+                  addToBindings(queueJNDI, queueName, usedJNDI);
+               }
 
                if (storeConfig && durable)
                {
@@ -639,7 +644,10 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                                     queueName,
                                                                     selectorString,
                                                                     durable));
-                  storage.addJNDI(PersistedType.Queue, queueName, usedJNDI);
+                  if (usedJNDI != null)
+                  {
+                     storage.addJNDI(PersistedType.Queue, queueName, usedJNDI);
+                  }
                }
             }
          }
@@ -1734,11 +1742,14 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    private void checkJNDI(final String... jndiNames) throws NamingException
    {
-      for (String jndiName : jndiNames)
+      if (jndiNames != null)
       {
-         if (registry != null && registry.lookup(jndiName) != null)
+         for (String jndiName : jndiNames)
          {
-            throw new NamingException(jndiName + " already has an object bound");
+            if (registry != null && registry.lookup(jndiName) != null)
+            {
+               throw new NamingException(jndiName + " already has an object bound");
+            }
          }
       }
    }


Mime
View raw message