directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r566853 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Date Thu, 16 Aug 2007 21:14:15 GMT
Author: elecharny
Date: Thu Aug 16 14:14:14 2007
New Revision: 566853

URL: http://svn.apache.org/viewvc?view=rev&rev=566853
Log:
fix DIRSERVER-763 by adding some defensive programming checks

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

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?view=diff&rev=566853&r1=566852&r2=566853
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Thu Aug 16 14:14:14 2007
@@ -592,11 +592,31 @@
         
         synchronized ( partitionLookupTree )
         {
-            partitions.put( partition.getSuffix().toString(), partition );
+        	LdapDN partitionSuffix = partition.getSuffix();
+        	
+        	if ( partitionSuffix == null )
+        	{
+        		throw new ConfigurationException( "The current partition does not have any suffix:
" + partition.getId() );
+        	}
+        	
+            partitions.put( partitionSuffix.toString(), partition );
             partitionLookupTree.recursivelyAddPartition( partitionLookupTree, partition.getSuffix(),
0, partition );
 
             Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
-            namingContexts.add( partition.getUpSuffix().getUpName() );
+            
+        	if ( partitionSuffix == null )
+        	{
+        		throw new ConfigurationException( "The current partition does not have any suffix:
" + partition.getId() );
+        	}
+        	
+        	LdapDN partitionUpSuffix = partition.getUpSuffix();
+
+        	if ( partitionUpSuffix == null )
+        	{
+        		throw new ConfigurationException( "The current partition does not have any user
provided suffix: " + partition.getId() );
+        	}
+        	
+            namingContexts.add( partitionUpSuffix.getUpName() );
         }
     }
 



Mime
View raw message