tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1447329 - /tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java
Date Mon, 18 Feb 2013 15:33:44 GMT
Author: rmannibucau
Date: Mon Feb 18 15:33:43 2013
New Revision: 1447329

URL: http://svn.apache.org/r1447329
Log:
avoiding loops

Modified:
    tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java?rev=1447329&r1=1447328&r2=1447329&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java
(original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/ContextualJndiReference.java
Mon Feb 18 15:33:43 2013
@@ -57,7 +57,7 @@ public class ContextualJndiReference ext
         final String prefix = findPrefix();
         final String jndiName = getJndiName();
 
-        if (prefix != null) {
+        if (prefix != null && !prefix.isEmpty()) {
             try {
                 return lookup(prefix + '/' + jndiName);
             } catch (final NamingException e) {
@@ -67,10 +67,12 @@ public class ContextualJndiReference ext
 
         final Collection<Object> values = new ArrayList<Object>();
         for (final String p : allPrefixes()) {
-            try {
-                values.add(lookup(p + '/' + jndiName));
-            } catch (final NamingException e) {
-                // no-op
+            if (prefix != null && !prefix.isEmpty()) {
+                try {
+                    values.add(lookup(p + '/' + jndiName));
+                } catch (final NamingException e) {
+                    // no-op
+                }
             }
         }
 



Mime
View raw message