directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r891372 - /directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Date Wed, 16 Dec 2009 18:41:10 GMT
Author: elecharny
Date: Wed Dec 16 18:41:09 2009
New Revision: 891372

URL: http://svn.apache.org/viewvc?rev=891372&view=rev
Log:
When the schema is disabled, the Registries.SchemaObjects foes not contain a reference to
thi schema. Fixed that to avoid a NPE

Modified:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=891372&r1=891371&r2=891372&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Wed Dec 16 18:41:09 2009
@@ -1821,28 +1821,31 @@
         // And unregister the schemaObject within its schema
         Set<SchemaObjectWrapper> content = schemaObjects.get( StringTools.toLowerCase(
schemaObject.getSchemaName() ) );
 
-        SchemaObjectWrapper schemaObjectWrapper = new SchemaObjectWrapper( schemaObject );
-
-        if ( content.contains( schemaObjectWrapper ) )
+        if ( content != null )
         {
-            // remove the schemaObject
-            content.remove( schemaObjectWrapper );
-
-            // Update the global OidRegistry if the SchemaObject is not
-            // an instance of LoadableSchemaObject
-            if ( !( schemaObject instanceof LoadableSchemaObject ) )
+            SchemaObjectWrapper schemaObjectWrapper = new SchemaObjectWrapper( schemaObject
);
+    
+            if ( content.contains( schemaObjectWrapper ) )
+            {
+                // remove the schemaObject
+                content.remove( schemaObjectWrapper );
+    
+                // Update the global OidRegistry if the SchemaObject is not
+                // an instance of LoadableSchemaObject
+                if ( !( schemaObject instanceof LoadableSchemaObject ) )
+                {
+                    globalOidRegistry.unregister( schemaObject.getOid() );
+                }
+    
+                LOG.debug( "Unregistered {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
+            }
+            else
             {
-                globalOidRegistry.unregister( schemaObject.getOid() );
+                // Not present !!
+                // What should we do ?
+                LOG.debug( "Unregistering of {}:{} failed, not found in Registries", schemaObject.getObjectType(),
+                    schemaObject.getOid() );
             }
-
-            LOG.debug( "Unregistered {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
-        }
-        else
-        {
-            // Not present !!
-            // What should we do ?
-            LOG.debug( "Unregistering of {}:{} failed, not found in Registries", schemaObject.getObjectType(),
-                schemaObject.getOid() );
         }
     }
 



Mime
View raw message