geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r544190 - /geronimo/xbean/trunk/xbean-naming/src/main/java/org/apache/xbean/naming/context/AbstractContext.java
Date Mon, 04 Jun 2007 17:22:42 GMT
Author: dain
Date: Mon Jun  4 10:22:41 2007
New Revision: 544190

URL: http://svn.apache.org/viewvc?view=rev&rev=544190
Log:
When looking up a name strip off the absolute name in namespace, which avoids many extra lookups

Modified:
    geronimo/xbean/trunk/xbean-naming/src/main/java/org/apache/xbean/naming/context/AbstractContext.java

Modified: geronimo/xbean/trunk/xbean-naming/src/main/java/org/apache/xbean/naming/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-naming/src/main/java/org/apache/xbean/naming/context/AbstractContext.java?view=diff&rev=544190&r1=544189&r2=544190
==============================================================================
--- geronimo/xbean/trunk/xbean-naming/src/main/java/org/apache/xbean/naming/context/AbstractContext.java
(original)
+++ geronimo/xbean/trunk/xbean-naming/src/main/java/org/apache/xbean/naming/context/AbstractContext.java
Mon Jun  4 10:22:41 2007
@@ -106,6 +106,12 @@
         }
         if (stringName == null) stringName = parsedName.toString();
 
+        // If the name starts with our name in namespace strip it off
+        // This works because the name in namespace is assumed to be absolute
+        if (stringName.startsWith(nameInNamespace)) {
+            stringName = stringName.substring(nameInNamespace.length());
+        }
+
         // try to look up the name directly (this is the fastest path)
         Object directLookup = getDeepBinding(stringName);
         if (directLookup != null) {



Mime
View raw message