You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/07/08 17:47:17 UTC

svn commit: r420141 - /directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java

Author: elecharny
Date: Sat Jul  8 08:47:17 2006
New Revision: 420141

URL: http://svn.apache.org/viewvc?rev=420141&view=rev
Log:
Added a check on the name, and improved a little bit the getOid() method speed

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java?rev=420141&r1=420140&r2=420141&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java Sat Jul  8 08:47:17 2006
@@ -27,6 +27,7 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.server.core.schema.bootstrap.BootstrapOidRegistry;
+import org.apache.directory.shared.ldap.util.StringTools;
 
 
 /**
@@ -100,18 +101,18 @@
      */
     public String getOid( String name ) throws NamingException
     {
-        if ( name == null )
+        if ( StringTools.isEmpty( name ) )
         {
-            throw new NamingException( "name should not be null" );
+            throw new NamingException( "name should not be empty" );
         }
 
         /* If name is an OID than we return it back since inherently the
          * OID is another name for the object referred to by OID and the
          * caller does not know that the argument is an OID String.
          */
-        if ( Character.isDigit( name.charAt( 0 ) ) )
+        if ( StringTools.isDigit( name.charAt( 0 ) ) )
         {
-            monitor.getOidWithOid( name );
+            //monitor.getOidWithOid( name );
             return name;
         }