directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1136118 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Date Wed, 15 Jun 2011 16:50:26 GMT
Author: kayyagari
Date: Wed Jun 15 16:50:25 2011
New Revision: 1136118

URL: http://svn.apache.org/viewvc?rev=1136118&view=rev
Log:
o fixed an NPE and removed some unwanted code

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

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1136118&r1=1136117&r2=1136118&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Wed Jun 15 16:50:25 2011
@@ -644,7 +644,11 @@ public class DefaultDirectoryService imp
 
         try
         {
-            partitionNexus.addContextPartition( partition );
+            // can be null when called before starting up
+            if ( partitionNexus != null )
+            {
+                partitionNexus.addContextPartition( partition );
+            }
         }
         catch ( LdapException le )
         {
@@ -654,11 +658,6 @@ public class DefaultDirectoryService imp
         
         // Now, add the partition to the set of managed partitions
         partitions.add( partition );
-
-        if ( ! started )
-        {
-            return;
-        }
     }
 
 
@@ -667,7 +666,11 @@ public class DefaultDirectoryService imp
         // Do the backend cleanup first
         try
         {
-            partitionNexus.removeContextPartition( partition.getSuffix() );
+            // can be null when called before starting up
+            if ( partitionNexus != null )
+            {
+                partitionNexus.removeContextPartition( partition.getSuffix() );
+            }
         }
         catch ( LdapException le )
         {
@@ -677,11 +680,6 @@ public class DefaultDirectoryService imp
         
         // And update the set of managed partitions
         partitions.remove( partition );
-
-        if ( ! started )
-        {
-            return;
-        }
     }
 
 



Mime
View raw message