directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r980925 [2/2] - in /directory/apacheds/branches/apacheds-dnfactory-experiment: core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core-api/src/main/java/org/...
Date Fri, 30 Jul 2010 19:05:05 GMT
Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java Fri Jul 30 19:05:03 2010
@@ -86,7 +86,7 @@ public class MetaSyntaxCheckerHandlerIT 
             "m-description: A test syntaxChecker" );
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
 
         assertTrue( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
@@ -106,7 +106,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         // nis is by default inactive
         DN dn = getSyntaxCheckerContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
 
         assertFalse( "adding new syntaxChecker to disabled schema should not register it into the registries",
@@ -124,7 +124,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         // nis is by default inactive
         DN dn = getSyntaxCheckerContainer( "notloaded" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         try
         {
@@ -159,7 +159,7 @@ public class MetaSyntaxCheckerHandlerIT 
                 .toByteArray(), "m-oid", OID, "m-description: A test syntaxChecker" );
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
 
         assertTrue( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
@@ -187,7 +187,7 @@ public class MetaSyntaxCheckerHandlerIT 
                 .toByteArray(), "m-oid", OID, "m-description: A test syntaxChecker" );
 
         DN dn = getSyntaxCheckerContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
 
         assertFalse( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
@@ -199,7 +199,7 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testDeleteSyntaxCheckerFromEnabledSchema() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
 
         assertTrue( "syntaxChecker should be removed from the registry after being deleted", schemaManager
@@ -228,7 +228,7 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testDeleteSyntaxCheckerFromDisabledSchema() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
 
         assertTrue( "syntaxChecker should be removed from the registry after being deleted", schemaManager
@@ -258,11 +258,11 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testRenameSyntaxChecker() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
 
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
         assertFalse( "old syntaxChecker OID should be removed from the registry after being renamed", schemaManager
@@ -291,10 +291,10 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -316,10 +316,10 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
 
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -344,7 +344,7 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         ModificationItem[] mods = new ModificationItem[1];
         Attribute attr = new BasicAttribute( "m-fqcn", BogusSyntaxChecker.class.getName() );
@@ -369,7 +369,7 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         Attributes mods = new BasicAttributes( true );
         mods.put( "m-fqcn", BogusSyntaxChecker.class.getName() );
@@ -393,7 +393,7 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testDeleteSyntaxCheckerWhenInUse() throws Exception
     {
         DN scDn = getSyntaxCheckerContainer( "apachemeta" );
-        scDn.add( "m-oid" + "=" + OID );
+        scDn = scDn.add( "m-oid" + "=" + OID );
 
         // Create a new SyntaxChecker
         testAddSyntaxCheckerToEnabledSchema();
@@ -405,7 +405,7 @@ public class MetaSyntaxCheckerHandlerIT 
             "objectClass: metaSyntax", "m-oid", OID, "m-description: test" );
 
         DN sDn = getSyntaxContainer( "apachemeta" );
-        sDn.add( "m-oid" + "=" + OID );
+        sDn = sDn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
         assertFalse( isOnDisk( sDn ) );
@@ -440,10 +440,10 @@ public class MetaSyntaxCheckerHandlerIT 
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         try
         {
@@ -469,10 +469,10 @@ public class MetaSyntaxCheckerHandlerIT 
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
 
         try
         {
@@ -495,12 +495,12 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testRenameSyntaxCheckerWhenInUse() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
 
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
 
         try
         {
@@ -529,7 +529,7 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN top = new DN();
         top.add( "m-oid" + "=" + OID );
@@ -555,10 +555,10 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = new DN( "ou=comparators,cn=apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         try
         {
@@ -581,11 +581,11 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         // nis is inactive by default
         DN newdn = getSyntaxCheckerContainer( "nis" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -602,13 +602,13 @@ public class MetaSyntaxCheckerHandlerIT 
 
         // nis is inactive by default
         DN dn = getSyntaxCheckerContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         assertFalse( "syntaxChecker OID should NOT be present when added to disabled nis schema", schemaManager
             .getSyntaxCheckerRegistry().contains( OID ) );
 
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java Fri Jul 30 19:05:03 2010
@@ -102,7 +102,7 @@ public class MetaSyntaxHandlerIT extends
             "m-description", DESCRIPTION0 );
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         createDummySyntaxChecker( OID, "apachemeta" );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
@@ -125,7 +125,7 @@ public class MetaSyntaxHandlerIT extends
         
         // nis is by default inactive
         DN dn = getSyntaxContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         createDummySyntaxChecker( OID, "nis" );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
@@ -147,7 +147,7 @@ public class MetaSyntaxHandlerIT extends
         
         // nis is by default inactive
         DN dn = getSyntaxContainer( "notloaded" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         createDummySyntaxChecker( OID, "nis" );
         
         try
@@ -170,7 +170,7 @@ public class MetaSyntaxHandlerIT extends
     public void testDeleteSyntaxFromEnabledSchema() throws Exception
     {
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
         
         assertTrue( isOnDisk( dn ) );
@@ -199,7 +199,7 @@ public class MetaSyntaxHandlerIT extends
     public void testDeleteSyntaxFromDisabledSchema() throws Exception
     {
         DN dn = getSyntaxContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToDisabledSchema();
 
         assertTrue( isOnDisk( dn ) );
@@ -229,11 +229,11 @@ public class MetaSyntaxHandlerIT extends
     public void testRenameSyntax() throws Exception
     {
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
         
         DN newdn = getSyntaxContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
         assertFalse( "old syntax OID should be removed from the registry after being renamed", 
@@ -260,10 +260,10 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -282,10 +282,10 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -310,7 +310,7 @@ public class MetaSyntaxHandlerIT extends
         assertEquals( syntax.getDescription(), DESCRIPTION0 );
 
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         ModificationItem[] mods = new ModificationItem[1];
         Attribute attr = new BasicAttribute( "m-description", DESCRIPTION1 );
@@ -338,7 +338,7 @@ public class MetaSyntaxHandlerIT extends
         assertEquals( syntax.getDescription(), DESCRIPTION0 );
 
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         Attributes mods = new BasicAttributes( true );
         mods.put( "m-description", DESCRIPTION1 );
@@ -364,7 +364,7 @@ public class MetaSyntaxHandlerIT extends
     public void testDeleteSyntaxWhenInUse() throws Exception
     {
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
         addDependeeMatchingRule( OID );
         
@@ -390,10 +390,10 @@ public class MetaSyntaxHandlerIT extends
         addDependeeMatchingRule( OID );
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -418,10 +418,10 @@ public class MetaSyntaxHandlerIT extends
         addDependeeMatchingRule( OID );
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         try
         {
@@ -449,7 +449,7 @@ public class MetaSyntaxHandlerIT extends
             "m-description", MR_DESCRIPTION );
         
         DN dn = getMatchingRuleContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + MR_OID );
+        dn = dn.add( "m-oid" + "=" + MR_OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         assertTrue( schemaManager.getMatchingRuleRegistry().contains( MR_OID ) );
@@ -462,12 +462,12 @@ public class MetaSyntaxHandlerIT extends
     public void testRenameNormalizerWhenInUse() throws Exception
     {
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
         addDependeeMatchingRule( OID );
         
         DN newdn = getSyntaxContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         try
         {
@@ -496,7 +496,7 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN top = new DN();
         top.add( "m-oid" + "=" + OID );
@@ -523,10 +523,10 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = new DN( "ou=comparators,cn=apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -550,11 +550,11 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         // nis is inactive by default
         DN newdn = getSyntaxContainer( "nis" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -571,13 +571,13 @@ public class MetaSyntaxHandlerIT extends
         
         // nis is inactive by default
         DN dn = getSyntaxContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         assertFalse( "syntax OID should NOT be present when added to disabled nis schema", 
             schemaManager.getLdapSyntaxRegistry().contains( OID ) );
 
         DN newdn = getSyntaxContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java Fri Jul 30 19:05:03 2010
@@ -103,7 +103,7 @@ public class ObjectClassCreateIT extends
         
         // Inject the AT
         DN dn = new DN( "ou=attributeTypes,cn=apachemeta" );
-        dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22.249" );
+        dn = dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22.249" );
         
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attributes );
         
@@ -141,7 +141,7 @@ public class ObjectClassCreateIT extends
         
         // Inject the OC
         dn = new DN( "ou=objectClasses,cn=apachemeta" );
-        dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22" );
+        dn = dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22" );
         
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attributes );
     }
@@ -180,7 +180,7 @@ public class ObjectClassCreateIT extends
         attributes.put( "m-name", "http://example.com/users/accounts/L0" );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
+        dn = dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
         
         try
         {
@@ -215,7 +215,7 @@ public class ObjectClassCreateIT extends
         attributes.put( "m-name", "no-objectClasses" );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
+        dn = dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
         
         try
         {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java Fri Jul 30 19:05:03 2010
@@ -53,7 +53,7 @@ public class BackupUtilitiesSP
         DN backupDn = new DN ( "ou=backupContext,ou=system" );
         String deletedEntryRdn = deletedEntry.getDn().get( deletedEntry.getDn().size() - 1 );
         Entry entry = ( Entry ) deletedEntry.getOriginalEntry().clone();
-        backupDn.add( deletedEntryRdn );
+        backupDn = backupDn.add( deletedEntryRdn );
         entry.setDn( backupDn );
         session.add( deletedEntry );
         LOG.info( "Backed up deleted entry to \"" + backupDn + "\"" );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Fri Jul 30 19:05:03 2010
@@ -202,7 +202,7 @@ public abstract class ServerContext impl
     public ServerContext( DirectoryService service, LdapPrincipal principal, Name name ) throws Exception
     {
         this.service = service;
-        this.dn = (DN)(DN.fromName( name ).clone());
+        this.dn = DN.fromName( name );
 
         this.env = new Hashtable<String, Object>();
         this.env.put( PROVIDER_URL, dn.toString() );
@@ -225,7 +225,7 @@ public abstract class ServerContext impl
     public ServerContext( DirectoryService service, CoreSession session, Name name ) throws Exception
     {
         this.service = service;
-        this.dn = (DN)(DN.fromName( name ).clone());
+        this.dn = DN.fromName( name );
         this.env = new Hashtable<String, Object>();
         this.env.put( PROVIDER_URL, dn.toString() );
         this.env.put( DirectoryService.JNDI_KEY, service );
@@ -1042,22 +1042,22 @@ public abstract class ServerContext impl
         }
 
         // calculate parents
-        DN oldParent = (DN)oldDn.clone();
+        DN oldParent = oldDn;
         
         try
         {
-            oldParent.remove( oldDn.size() - 1 );
+            oldParent = oldParent.remove( oldDn.size() - 1 );
         }
         catch ( LdapInvalidDnException lide )
         {
             throw new NamingException( I18n.err( I18n.ERR_313, lide.getMessage() ) );
         }
         
-        DN newParent = ( DN ) newDn.clone();
+        DN newParent = newDn;
         
         try
         {
-            newParent.remove( newDn.size() - 1 );
+            newParent = newParent.remove( newDn.size() - 1 );
         }
         catch ( LdapInvalidDnException lide )
         {
@@ -1459,7 +1459,7 @@ public abstract class ServerContext impl
             {
                 try
                 {
-                    fqn.remove( 0 );
+                    fqn = fqn.remove( 0 );
                 }
                 catch ( LdapInvalidDnException lide )
                 {
@@ -1556,12 +1556,12 @@ public abstract class ServerContext impl
      */
     DN buildTarget( DN relativeName ) throws NamingException
     {
-        DN target = ( DN ) dn.clone();
+        DN target = dn;
 
         // Add to left hand side of cloned DN the relative name arg
         try
         {
-            target.addAllNormalized( target.size(), relativeName );
+            target = target.addAllNormalized( target.size(), relativeName );
         }
         catch (LdapInvalidDnException lide )
         {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DNFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DNFactory.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DNFactory.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DNFactory.java Fri Jul 30 19:05:03 2010
@@ -64,10 +64,15 @@ public class DNFactory
      */
     public static DN create( String dn, SchemaManager schemaManager ) throws LdapInvalidDnException
     {
-        if ( dn == null || dn.trim().length() == 0 )
+        if ( dn == null )
         {
             return null;
         }
+        
+        if( dn.trim().length() == 0 )
+        {
+            return DN.EMPTY_DN;
+        }
 
         DN cachedDN = DN_CACHE.get( dn );
 
@@ -91,8 +96,8 @@ public class DNFactory
         }
 
         LOG.debug( "DN {} found in the cache", dn );
-        System.out.println( "DN cache hit - " + hitCount + ", miss - " + missCount + " and is normalized = "
-            + cachedDN.isNormalized() );
+//        System.out.println( "DN cache hit - " + hitCount + ", miss - " + missCount + " and is normalized = "
+//            + cachedDN.isNormalized() );
         return cachedDN;
     }
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Fri Jul 30 19:05:03 2010
@@ -733,10 +733,10 @@ public class DefaultDirectoryService imp
         }
 
         // calculate parents
-        DN oldBase = ( DN ) oldDn.clone();
-        oldBase.remove( oldDn.size() - 1 );
-        DN newBase = ( DN ) newDn.clone();
-        newBase.remove( newDn.size() - 1 );
+        DN oldBase = oldDn;
+        oldBase = oldBase.remove( oldDn.size() - 1 );
+        DN newBase = newDn;
+        newBase = newBase.remove( newDn.size() - 1 );
 
         // Compute the RDN for each of the DN
         RDN newRdn = newDn.getRdn( newDn.size() - 1 );
@@ -756,8 +756,8 @@ public class DefaultDirectoryService imp
         }
         else
         {
-            DN target = ( DN ) newDn.clone();
-            target.remove( newDn.size() - 1 );
+            DN target = newDn;
+            target = target.remove( newDn.size() - 1 );
 
             if ( newRdn.equals( oldRdn ) )
             {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java Fri Jul 30 19:05:03 2010
@@ -106,7 +106,7 @@ public class DefaultOperationManager imp
                 // So we have to take the RDN one by one, and create a 
                 // new DN with the type and value UP form
     
-                DN urlDn = ( DN ) ldapUrl.getDn().addAll( childDn );
+                DN urlDn = ldapUrl.getDn().addAll( childDn );
     
                 ldapUrl.setDn( urlDn );
                 urls.add( ldapUrl.toString() );
@@ -160,7 +160,7 @@ public class DefaultOperationManager imp
                     // So we have to take the RDN one by one, and create a 
                     // new DN with the type and value UP form
 
-                    DN urlDn = ( DN ) ldapUrl.getDn().addAll( childDn );
+                    DN urlDn = ldapUrl.getDn().addAll( childDn );
 
                     ldapUrl.setDn( urlDn );
                 }
@@ -871,9 +871,9 @@ public class DefaultOperationManager imp
             // Inject the new DN into the context
             if ( !dn.isEmpty() )
             {
-                DN newDn = ( DN ) dn.clone();
-                newDn.remove( dn.size() - 1 );
-                newDn.add( renameContext.getNewRdn() );
+                DN newDn = dn;
+                newDn = newDn.remove( dn.size() - 1 );
+                newDn = newDn.add( renameContext.getNewRdn() );
                 renameContext.setNewDn( newDn );
             }
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Fri Jul 30 19:05:03 2010
@@ -279,8 +279,8 @@ public class AciAuthorizationInterceptor
          */
         if ( oc.contains( SchemaConstants.SUBENTRY_OC ) )
         {
-            DN parentDn = ( DN ) dn.clone();
-            parentDn.remove( dn.size() - 1 );
+            DN parentDn = dn;
+            parentDn = parentDn.remove( dn.size() - 1 );
             originalEntry = opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS );
         }
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Fri Jul 30 19:05:03 2010
@@ -163,8 +163,8 @@ public class ExceptionInterceptor extend
             return;
         }
 
-        DN parentDn = ( DN ) name.clone();
-        parentDn.remove( name.size() - 1 );
+        DN parentDn = name;
+        parentDn = parentDn.remove( name.size() - 1 );
 
         // check if we're trying to add to a parent that is an alias
         boolean notAnAlias;

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Fri Jul 30 19:05:03 2010
@@ -530,14 +530,14 @@ public class OperationalAttributeInterce
             RDN rdn = dn.getRdn( ii );
             if ( rdn.size() == 0 )
             {
-                newDn.add( new RDN() );
+                newDn = newDn.add( new RDN() );
                 continue;
             }
             else if ( rdn.size() == 1 )
             {
                 String name = schemaManager.lookupAttributeTypeRegistry( rdn.getNormType() ).getName();
                 String value = rdn.getAtav().getNormValue().getString();
-                newDn.add( new RDN( name, name, value, value ) );
+                newDn = newDn.add( new RDN( name, name, value, value ) );
                 continue;
             }
 
@@ -556,7 +556,7 @@ public class OperationalAttributeInterce
                 }
             }
 
-            newDn.add( new RDN( buf.toString() ) );
+            newDn = newDn.add( new RDN( buf.toString() ) );
         }
 
         return newDn;

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Fri Jul 30 19:05:03 2010
@@ -322,7 +322,7 @@ public class DefaultPartitionNexus exten
             system.add( addOperationContext );
         }
 
-        String key = system.getSuffix().getName();
+        String key = system.getSuffix().getNormName();
 
         if ( partitions.containsKey( key ) )
         {
@@ -367,8 +367,6 @@ public class DefaultPartitionNexus exten
         {
             try
             {
-                DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
-
                 removeContextPartition(  DNFactory.create( suffix ) );
             }
             catch ( Exception e )

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java Fri Jul 30 19:05:03 2010
@@ -51,7 +51,7 @@ class PreferencesUtils
         {
             if ( comps[ii] != null && !comps[ii].trim().equals( "" ) )
             {
-                dn.add( "prefNodeName=" + comps[ii] );
+                dn = dn.add( "prefNodeName=" + comps[ii] );
             }
         }
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Fri Jul 30 19:05:03 2010
@@ -907,8 +907,8 @@ public class SubentryInterceptor extends
              * operational attributes calculated above.
              * ----------------------------------------------------------------
              */
-            DN baseDn = ( DN ) apDn.clone();
-            baseDn.addAll( subentry.getSubtreeSpecification().getBase() );
+            DN baseDn = apDn;
+            baseDn = baseDn.addAll( subentry.getSubtreeSpecification().getBase() );
             
             updateEntries( OperationEnum.ADD, addContext.getSession(), dn, apDn, subentry.getSubtreeSpecification(), baseDn, operationalAttributes );
 
@@ -995,8 +995,8 @@ public class SubentryInterceptor extends
              * ----------------------------------------------------------------
              */
             DN apDn = dn.getParent();
-            DN baseDn = ( DN ) apDn.clone();
-            baseDn.addAll( removedSubentry.getSubtreeSpecification().getBase() );
+            DN baseDn = apDn;
+            baseDn = baseDn.addAll( removedSubentry.getSubtreeSpecification().getBase() );
 
             // Remove all the references to this removed subentry from all the selected entries
             updateEntries( OperationEnum.REMOVE, deleteContext.getSession(), dn, apDn, removedSubentry.getSubtreeSpecification(), baseDn, null );
@@ -1091,8 +1091,8 @@ public class SubentryInterceptor extends
 
             // search for all entries selected by the old SS and remove references to subentry
             DN apName = dn.getParent();
-            DN oldBaseDn = ( DN ) apName.clone();
-            oldBaseDn.addAll( ssOld.getBase() );
+            DN oldBaseDn = apName;
+            oldBaseDn = oldBaseDn.addAll( ssOld.getBase() );
             
             ExprNode filter = new PresenceNode( OBJECT_CLASS_AT );
             SearchControls controls = new SearchControls();
@@ -1128,8 +1128,8 @@ public class SubentryInterceptor extends
             // search for all selected entries by the new SS and add references to subentry
             subentry = subentryCache.getSubentry( dn );
             List<EntryAttribute> operationalAttributes = getSubentryOperationalAttributes( dn, subentry );
-            DN newBaseDn = ( DN ) apName.clone();
-            newBaseDn.addAll( ssNew.getBase() );
+            DN newBaseDn = apName;
+            newBaseDn = newBaseDn.addAll( ssNew.getBase() );
 
             searchOperationContext = new SearchOperationContext( modifyContext.getSession(), newBaseDn, filter, controls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
@@ -1223,10 +1223,10 @@ public class SubentryInterceptor extends
             Subentry subentry = subentryCache.removeSubentry( oldDn );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
             DN apName = oldDn.getParent();
-            DN baseDn = ( DN ) apName.clone();
-            baseDn.addAll( ss.getBase() );
-            DN newName = (DN)newSuperiorDn.clone();
-            newName.add( oldDn.getRdn() );
+            DN baseDn = apName;
+            baseDn = baseDn.addAll( ss.getBase() );
+            DN newName = newSuperiorDn;
+            newName = newName.add( oldDn.getRdn() );
             newName.normalize( schemaManager.getNormalizerMapping() );
 
             subentryCache.addSubentry( newName, subentry );
@@ -1314,11 +1314,11 @@ public class SubentryInterceptor extends
             Subentry subentry = subentryCache.removeSubentry( oldDn );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
             DN apName = oldDn.getParent();
-            DN baseDn = ( DN ) apName.clone();
-            baseDn.addAll( ss.getBase() );
+            DN baseDn = apName;
+            baseDn = baseDn.addAll( ss.getBase() );
             DN newName = newSuperiorDn.getParent();
 
-            newName.add( moveAndRenameContext.getNewRdn() );
+            newName = newName.add( moveAndRenameContext.getNewRdn() );
             newName.normalize( schemaManager.getNormalizerMapping() );
 
             subentryCache.addSubentry( newName, subentry );
@@ -1397,11 +1397,11 @@ public class SubentryInterceptor extends
             Subentry subentry = subentryCache.removeSubentry( oldDn );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
             DN apName = oldDn.getParent();
-            DN baseDn = ( DN ) apName.clone();
-            baseDn.addAll( ss.getBase() );
+            DN baseDn = apName;
+            baseDn = baseDn.addAll( ss.getBase() );
             DN newName = oldDn.getParent();
 
-            newName.add( renameContext.getNewRdn() );
+            newName = newName.add( renameContext.getNewRdn() );
             newName.normalize( schemaManager.getNormalizerMapping() );
 
             subentryCache.addSubentry( newName, subentry );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java Fri Jul 30 19:05:03 2010
@@ -78,8 +78,8 @@ public class SubtreeEvaluator
          */
         // First construct the subtree base, which is the concatenation of the
         // AP DN and the subentry base
-        DN subentryBaseDn = (DN)apDn.clone();
-        subentryBaseDn.addAll( subtree.getBase() );
+        DN subentryBaseDn = apDn;
+        subentryBaseDn = subentryBaseDn.addAll( subtree.getBase() );
         
         if ( !entryDn.isChildOf( subentryBaseDn ) )
         {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java Fri Jul 30 19:05:03 2010
@@ -48,10 +48,10 @@ public class ModifyDNStoredProcedurePara
         this.deleteOldRn = deleteOldRn;
         this.oldRDN = (RDN)oldRDN.clone();
         this.newRDN = (RDN)newRDN.clone();
-        this.oldSuperiorDN = (DN)oldSuperiorDN.clone();
-        this.newSuperiorDN = (DN)newSuperiorDN.clone();
-        this.oldDN = (DN)oldDN.clone();
-        this.newDN = (DN)newDN.clone();
+        this.oldSuperiorDN = oldSuperiorDN;
+        this.newSuperiorDN = newSuperiorDN;
+        this.oldDN = oldDN;
+        this.newDN = newDN;
         
         Map<Class<?>, MicroInjector> injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.ModifyDN_ENTRY.class, $entryInjector );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Fri Jul 30 19:05:03 2010
@@ -135,8 +135,8 @@ public class TriggerInterceptor extends 
          */
         if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
         {
-            DN parentDn = ( DN ) dn.clone();
-            parentDn.remove( dn.size() - 1 );
+            DN parentDn = dn;
+            parentDn = parentDn.remove( dn.size() - 1 );
 
             entry = opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS );
         }
@@ -387,12 +387,12 @@ public class TriggerInterceptor extends 
 
         // @TODO : To be completely reviewed !!!
         RDN oldRDN = name.getRdn();
-        DN oldSuperiorDN = ( DN ) name.clone();
-        oldSuperiorDN.remove( oldSuperiorDN.size() - 1 );
+        DN oldSuperiorDN = ( DN ) name;
+        oldSuperiorDN = oldSuperiorDN.remove( oldSuperiorDN.size() - 1 );
         DN newSuperiorDN = oldSuperiorDN;
         DN oldDN = name;
-        DN newDN = ( DN ) name.clone();
-        newDN.add( newRdn );
+        DN newDN = name;
+        newDN = newDN.add( newRdn );
 
         StoredProcedureParameterInjector injector = new ModifyDNStoredProcedureParameterInjector( renameContext,
             deleteOldRn, oldRDN, newRdn, oldSuperiorDN, newSuperiorDN, oldDN, newDN );
@@ -432,8 +432,8 @@ public class TriggerInterceptor extends 
         Entry movedEntry = moveAndRenameContext.getOriginalEntry();
 
         RDN oldRDN = oldDn.getRdn();
-        DN oldSuperiorDN = ( DN ) oldDn.clone();
-        oldSuperiorDN.remove( oldSuperiorDN.size() - 1 );
+        DN oldSuperiorDN = oldDn;
+        oldSuperiorDN = oldSuperiorDN.remove( oldSuperiorDN.size() - 1 );
         DN oldDN = oldDn;
         DN newDN = moveAndRenameContext.getNewDn();
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Fri Jul 30 19:05:03 2010
@@ -575,7 +575,7 @@ public class JdbmStoreTest
 
         DN newParentDn = new DN( "ou=Board of Directors,o=Good Times Co.", schemaManager );
         
-        DN newDn = ((DN)newParentDn.clone()).add( martinDn.getRdn() );
+        DN newDn = newParentDn.add( martinDn.getRdn() );
 
         store.move( martinDn, newParentDn, newDn, entry );
         cursor = idx.forwardCursor( 3L );
@@ -602,7 +602,7 @@ public class JdbmStoreTest
         entry.add( "entryUUID", UUID.randomUUID().toString() );
         store.add( entry );
 
-        newDn = ((DN)newParentDn.clone()).add( marketingDn.getRdn() );
+        newDn = newParentDn.add( marketingDn.getRdn() );
 
         store.move( marketingDn, newParentDn, newDn, entry );
 
@@ -763,7 +763,7 @@ public class JdbmStoreTest
 
         assertEquals( 3, store.getSubAliasIndex().count() );
 
-        DN newDn = ((DN)parentDn.clone()).add( childDn.getRdn() );
+        DN newDn = parentDn.add( childDn.getRdn() );
         
         store.move( childDn, parentDn, newDn, childEntry );
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java Fri Jul 30 19:05:03 2010
@@ -156,8 +156,7 @@ public class ServerEntrySerializerTest
 
         Entry result = ( Entry ) ses.deserialize( data );
 
-        DN newDn = new DN();
-        newDn.add( dn.getRdn() );
+        DN newDn = new DN( dn.getRdn() );
         entry.setDn( newDn );
 
         assertEquals( entry, result );
@@ -180,7 +179,7 @@ public class ServerEntrySerializerTest
         Entry result = ( Entry ) ses.deserialize( data );
 
         DN newDn = new DN();
-        newDn.add( dn.getRdn() );
+        newDn = newDn.add( dn.getRdn() );
         entry.setDn( newDn );
 
         assertEquals( entry, result );
@@ -206,7 +205,7 @@ public class ServerEntrySerializerTest
         Entry result = ( Entry ) ses.deserialize( data );
 
         DN newDn = new DN();
-        newDn.add( dn.getRdn() );
+        newDn = newDn.add( dn.getRdn() );
         entry.setDn( newDn );
 
         assertEquals( entry, result );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java Fri Jul 30 19:05:03 2010
@@ -1416,10 +1416,11 @@ public class SearchHandler extends LdapR
             DN reqUnnormalizedDn = new DN( req.getBase().getName() );
             for ( int jj = 0; jj < diff; jj++ )
             {
-                extra.add( reqUnnormalizedDn.get( referralAncestor.getDn().size() + jj ) );
+                extra = extra.add( reqUnnormalizedDn.get( referralAncestor.getDn().size() + jj ) );
             }
 
-            ldapUrl.getDn().addAll( extra );
+            urlDn = urlDn.addAll( extra );
+            ldapUrl.setDn( urlDn );
             ldapUrl.setForceScopeRendering( true );
             ldapUrl.setAttributes( req.getAttributes() );
             ldapUrl.setScope( req.getScope().getScope() );
@@ -1503,10 +1504,10 @@ public class SearchHandler extends LdapR
             DN reqUnnormalizedDn = new DN( reqTargetDn.getName() );
             for ( int jj = 0; jj < diff; jj++ )
             {
-                extra.add( reqUnnormalizedDn.get( referralAncestor.getDn().size() + jj ) );
+                extra = extra.add( reqUnnormalizedDn.get( referralAncestor.getDn().size() + jj ) );
             }
 
-            urlDn.addAll( extra );
+            urlDn = urlDn.addAll( extra );
 
             StringBuilder buf = new StringBuilder();
             buf.append( ldapUrl.getScheme() );
@@ -1604,11 +1605,11 @@ public class SearchHandler extends LdapR
     {
         Entry entry;
         Entry farthestReferralAncestor = null;
-        DN dn = ( DN ) target.clone();
+        DN dn = target;
         
         try
         {
-            dn.remove( dn.size() - 1 );
+            dn = dn.remove( dn.size() - 1 );
         }
         catch ( LdapInvalidDnException e2 )
         {
@@ -1630,7 +1631,7 @@ public class SearchHandler extends LdapR
                     farthestReferralAncestor = entry;
                 }
 
-                dn.remove( dn.size() - 1 );
+                dn = dn.remove( dn.size() - 1 );
             }
             catch ( LdapException e )
             {
@@ -1639,7 +1640,7 @@ public class SearchHandler extends LdapR
                 // update the DN as we strip last component 
                 try
                 {
-                    dn.remove( dn.size() - 1 );
+                    dn = dn.remove( dn.size() - 1 );
                 }
                 catch ( LdapInvalidDnException e1 )
                 {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/server-integ/src/test/java/org/apache/directory/server/operations/extended/DITUtilitiesSP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/server-integ/src/test/java/org/apache/directory/server/operations/extended/DITUtilitiesSP.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/server-integ/src/test/java/org/apache/directory/server/operations/extended/DITUtilitiesSP.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/server-integ/src/test/java/org/apache/directory/server/operations/extended/DITUtilitiesSP.java Fri Jul 30 19:05:03 2010
@@ -56,7 +56,7 @@ public class DITUtilitiesSP
         {
             ClonedServerEntry result = results.get();
             DN childRdn = result.getDn();
-            childRdn.remove( 0 );
+            childRdn = childRdn.remove( 0 );
             deleteSubtree( session, childRdn );
         }
         

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java Fri Jul 30 19:05:03 2010
@@ -53,6 +53,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -1290,7 +1291,7 @@ public abstract class AbstractStore<E, I
             throw nse;
         }
         
-        DN newDn = ((DN)newSuperiorDn.clone()).add( newRdn );
+        DN newDn = newSuperiorDn.add( newRdn );
         
         // Now check that the new entry does not exist
         ID newId = getEntryId( newDn );
@@ -1427,10 +1428,12 @@ public abstract class AbstractStore<E, I
      */
     protected DN buildEntryDn( ID id ) throws Exception
     {
-        DN dn = new DN();
-
         ID parentId = id;
 
+        List<RDN> rdnList = new ArrayList<RDN>();
+        String upName = "";
+        String normName = "";
+        
         do
         {
             ParentIdAndRdn<ID> cur = rdnIdx.reverseLookup( parentId );
@@ -1438,13 +1441,26 @@ public abstract class AbstractStore<E, I
 
             for ( RDN rdn : rdns )
             {
-                dn.addNormalizedInOrder( rdn );
+                if ( rdnList.isEmpty() )
+                {
+                    normName = rdn.getNormName();
+                    upName = rdn.getName();
+                }
+                else
+                {
+                    normName = normName + "," + rdn.getNormName();
+                    upName = upName + "," + rdn.getName();
+                }
+                
+                rdnList.add( rdn );
             }
 
             parentId = cur.getParentId();
         }
         while ( !parentId.equals( getRootId() ) );
 
+        DN dn = new DN( upName, normName, StringTools.getBytesUtf8( normName ), rdnList );
+        
         return dn;
     }
 
@@ -1819,13 +1835,13 @@ public abstract class AbstractStore<E, I
          * index.  If the target is not a sibling of the alias then we add the
          * index entry maping the parent's id to the aliased target id.
          */
-        ancestorDn = ( DN ) aliasDn.clone();
-        ancestorDn.remove( aliasDn.size() - 1 );
+        ancestorDn = aliasDn;
+        ancestorDn = ancestorDn.remove( aliasDn.size() - 1 );
         ancestorId = getEntryId( ancestorDn );
 
         // check if alias parent and aliased entry are the same
-        DN normalizedAliasTargetParentDn = ( DN ) normalizedAliasTargetDn.clone();
-        normalizedAliasTargetParentDn.remove( normalizedAliasTargetDn.size() - 1 );
+        DN normalizedAliasTargetParentDn = normalizedAliasTargetDn;
+        normalizedAliasTargetParentDn = normalizedAliasTargetParentDn.remove( normalizedAliasTargetDn.size() - 1 );
 
         if ( !aliasDn.isChildOf( normalizedAliasTargetParentDn ) )
         {
@@ -1849,7 +1865,7 @@ public abstract class AbstractStore<E, I
                 subAliasIdx.add( ancestorId, targetId );
             }
 
-            ancestorDn.remove( ancestorDn.size() - 1 );
+            ancestorDn = ancestorDn.remove( ancestorDn.size() - 1 );
             ancestorId = getEntryId( ancestorDn );
         }
     }
@@ -1878,8 +1894,8 @@ public abstract class AbstractStore<E, I
 
         DN aliasDN = getEntryDn( aliasId );
 
-        DN ancestorDn = ( DN ) aliasDN.clone();
-        ancestorDn.remove( aliasDN.size() - 1 );
+        DN ancestorDn = aliasDN;
+        ancestorDn = ancestorDn.remove( aliasDN.size() - 1 );
         ID ancestorId = getEntryId( ancestorDn );
 
         /*

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java?rev=980925&r1=980924&r2=980925&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java Fri Jul 30 19:05:03 2010
@@ -503,7 +503,7 @@ public class AvlStoreTest
 
         DN newParentDn = new DN( "ou=Board of Directors,o=Good Times Co.", schemaManager );
 
-        DN newDn = ((DN)newParentDn.clone()).add( martinDn.getRdn() );
+        DN newDn = newParentDn.add( martinDn.getRdn() );
         store.move( martinDn, newParentDn, newDn, new ClonedServerEntry( entry ) );
 
         cursor = idx.forwardCursor( 3L );
@@ -530,7 +530,7 @@ public class AvlStoreTest
         entry.add( "entryUUID", UUID.randomUUID().toString() );
         store.add( entry );
 
-        newDn = ((DN)newParentDn.clone()).add( marketingDn.getRdn() );
+        newDn = newParentDn.add( marketingDn.getRdn() );
         store.move( marketingDn, newParentDn, newDn, new ClonedServerEntry( entry ) );
 
         cursor = idx.forwardCursor( 3L );
@@ -685,7 +685,7 @@ public class AvlStoreTest
 
         assertEquals( 3, store.getSubAliasIndex().count() );
 
-        DN newDn = ((DN)parentDn.clone()).add( childDn.getRdn() );
+        DN newDn = parentDn.add( childDn.getRdn() );
         store.move( childDn, parentDn, newDn, childEntry );
 
         assertEquals( 4, store.getSubAliasIndex().count() );



Mime
View raw message