directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r329684 - /directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersDecoder.java
Date Mon, 31 Oct 2005 00:51:42 GMT
Author: elecharny
Date: Sun Oct 30 16:51:39 2005
New Revision: 329684

URL: http://svn.apache.org/viewcvs?rev=329684&view=rev
Log:
Deleted the initialization of binaries HashSet, and call the method in SchemaUtils instead

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersDecoder.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersDecoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersDecoder.java?rev=329684&r1=329683&r2=329684&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersDecoder.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersDecoder.java
Sun Oct 30 16:51:39 2005
@@ -22,17 +22,17 @@
 import org.apache.asn1.codec.stateful.DecoderCallback;
 import org.apache.asn1.codec.stateful.DecoderMonitor;
 import org.apache.asn1.codec.stateful.StatefulDecoder;
-import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.decoder.LdapDigesterFactory;
 import org.apache.ldap.common.message.Message;
 import org.apache.ldap.common.message.spi.Provider;
 import org.apache.ldap.common.message.spi.ProviderDecoder;
 import org.apache.ldap.common.message.spi.ProviderException;
+import org.apache.ldap.common.schema.SchemaUtils;
 
 import java.io.InputStream;
 import java.nio.ByteBuffer;
-import java.util.HashSet;
 import java.util.Hashtable;
+import java.util.Set;
 
 
 /**
@@ -44,27 +44,9 @@
 {
     private final Provider provider;
     private final BERDigester digester;
-    private HashSet binaries;
+    private Set binaries;
     private static final String BINARY_KEY = "java.naming.ldap.attributes.binary";
 
-    private void initBinaries( Hashtable env ) 
-    {
-        // construct the set for fast lookups while filtering
-        String binaryIds = (String)env.get( BINARY_KEY );
-
-        binaries = new HashSet();
-
-        if ( StringUtils.isEmpty( binaryIds ) == false )
-        {
-            String[] binaryArray = binaryIds.split( "/" );
-            
-            for ( int i = 0; i < binaryArray.length; i++ )
-            {
-                binaries.add( StringUtils.lowerCase( StringUtils.trim( binaryArray[i] ) )
);
-            }
-        }
-    }
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -79,7 +61,7 @@
     {
         this.provider = provider;
         LdapDigesterFactory factory = LdapDigesterFactory.getSingleton();
-        initBinaries( env );
+        binaries = SchemaUtils.initBinaries( env, BINARY_KEY );
         digester = factory.create( binaries );
     }
 



Mime
View raw message