directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r523661 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Date Thu, 29 Mar 2007 10:20:21 GMT
Author: elecharny
Date: Thu Mar 29 03:20:06 2007
New Revision: 523661

URL: http://svn.apache.org/viewvc?view=rev&rev=523661
Log:
Fixed a potential NPE in the code (defensive code added)

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=523661&r1=523660&r2=523661
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Thu Mar 29 03:20:06 2007
@@ -128,7 +128,7 @@
      */
     private Registries registries;
 
-    private Set binaries;
+    private Set<String> binaries;
 
     /**
      * subschemaSubentry attribute's value from Root DSE
@@ -179,7 +179,14 @@
         topFilter = new TopFilter();
         filters.add( binaryAttributeFilter );
         filters.add( topFilter );
-        binaries = ( Set ) factoryCfg.getEnvironment().get( BINARY_KEY );
+        binaries = ( Set<String> ) factoryCfg.getEnvironment().get( BINARY_KEY );
+        
+        if ( binaries == null )
+        {
+            binaries = new HashSet<String>();
+        }
+            
+            
 
         schemaBaseDN = new LdapDN( "ou=schema" );
         schemaBaseDN.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping()
);
@@ -1722,6 +1729,7 @@
             }
 
             asBinary = !type.getSyntax().isHumanReadible();
+            asBinary = asBinary || ( ( binaries != null ) && ( binaries.contains(
type ) ) );
             asBinary = asBinary || binaries.contains( type );
 
             if ( asBinary )



Mime
View raw message