tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1137387 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
Date Sun, 19 Jun 2011 16:35:58 GMT
Author: genspring
Date: Sun Jun 19 16:35:58 2011
New Revision: 1137387

URL: http://svn.apache.org/viewvc?rev=1137387&view=rev
Log:
fix a regression in geronimo caused by http://svn.apache.org/viewvc?rev=1137242&view=rev.

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java?rev=1137387&r1=1137386&r2=1137387&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
Sun Jun 19 16:35:58 2011
@@ -253,7 +253,7 @@ public class JndiBuilder {
             EnterpriseBeanInfo beanInfo = beanInfos.get(bean.getDeploymentID());
 
             templates = new HashMap<String, Map<String, StringTemplate>>();
-            templates.put("", addTemplate(null, "default", template));
+            templates.put("", addTemplate(null, DEFAULT_NAME_KEY, template));
 
             for (JndiNameInfo nameInfo : beanInfo.jndiNamess) {
                 String intrface = nameInfo.intrface;
@@ -304,10 +304,20 @@ public class JndiBuilder {
             contextData.put("interfaceClass.simpleName", interfce.getSimpleName());
             contextData.put("interfaceClass.packageName", packageName(interfce));
 
+            StringTemplate stringTemplate = null;
+            
             if (template.containsKey(key)) {
-                return template.get(key).apply(contextData);
-            }
-            return template.get(DEFAULT_NAME_KEY).apply(contextData);
+                stringTemplate = template.get(key);
+            } else {
+                stringTemplate = template.get(DEFAULT_NAME_KEY);
+            }
+            
+            if (stringTemplate == null){
+                stringTemplate = template.values().iterator().next();
+            } 
+            
+            return  stringTemplate.apply(contextData);
+          
         }
 
         @Override public Map<String, String> getNames(Class interfce, Interface type)
{



Mime
View raw message