You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2005/09/11 21:03:49 UTC

svn commit: r280166 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/BTreeContextPartition.java

Author: akarasulu
Date: Sun Sep 11 12:03:45 2005
New Revision: 280166

URL: http://svn.apache.org/viewcvs?rev=280166&view=rev
Log:
Reviewed and applyed Stefan Zoerner's patch for DIREVE-240 here:

    http://issues.apache.org/jira/browse/DIREVE-240


Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/BTreeContextPartition.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/BTreeContextPartition.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/BTreeContextPartition.java?rev=280166&r1=280165&r2=280166&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/BTreeContextPartition.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/BTreeContextPartition.java Sun Sep 11 12:03:45 2005
@@ -133,7 +133,7 @@
             String name = ( String ) i.next();
             String oid = oidRegistry.getOid( name );
             AttributeType type = attributeTypeRegistry.lookup( oid );
-            
+
             // check if attribute is a system attribute
             if ( sysOidSet.contains( oid ) )
             {
@@ -176,10 +176,15 @@
                 addIndexOn( type );
             }
         }
-        
-        add( cfg.getSuffix(),
-                cfg.getNormalizedSuffix( factoryCfg.getGlobalRegistries().getMatchingRuleRegistry() ),
-                cfg.getContextEntry() );
+
+        // add entry for context, if it does not exist
+        Attributes suffixOnDisk = getSuffixEntry();
+        if ( suffixOnDisk == null )
+        {
+            add( cfg.getSuffix(),
+                 cfg.getNormalizedSuffix( factoryCfg.getGlobalRegistries().getMatchingRuleRegistry() ),
+                 cfg.getContextEntry() );
+        }
     }