directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1186880 - /directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
Date Thu, 20 Oct 2011 16:12:34 GMT
Author: elecharny
Date: Thu Oct 20 16:12:33 2011
New Revision: 1186880

URL: http://svn.apache.org/viewvc?rev=1186880&view=rev
Log:
Another fix for userCertificate;bianry

Modified:
    directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java

Modified: directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java?rev=1186880&r1=1186879&r2=1186880&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
Thu Oct 20 16:12:33 2011
@@ -1593,13 +1593,34 @@ public class DefaultSchemaManager implem
         return new ImmutableSyntaxCheckerRegistry( registries.getSyntaxCheckerRegistry()
);
     }
 
+    
+    /**
+     * Get rid of AT's options (everything after the ';'
+     * @param oid
+     * @return
+     */
+    private String stripOptions( String oid )
+    {
+        int semiColonPos = oid.indexOf( ';' );
+        
+        if ( semiColonPos != -1 )
+        {
+            return oid.substring( 0, semiColonPos );
+        }
+        else
+        {
+            return oid;
+        }
+    }
 
     /**
      * {@inheritDoc}
      */
     public AttributeType lookupAttributeTypeRegistry( String oid ) throws LdapException
     {
-        return registries.getAttributeTypeRegistry().lookup( Strings.toLowerCase( oid ).trim()
);
+        String oidTrimmed = Strings.toLowerCase( oid ).trim();
+        String oidNoOption = stripOptions( oidTrimmed );
+        return registries.getAttributeTypeRegistry().lookup( oidNoOption );
     }
 
 



Mime
View raw message