Caught up the changes in trunk.
git-svn-id: https://svn.apache.org/repos/asf/directory/apacheds/branches/db_refactor@201546 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java b/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java
index edde490..219ed6d 100644
--- a/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java
+++ b/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java
@@ -22,9 +22,9 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
-import java.util.HashSet;
+import java.util.ArrayList;
import java.util.Hashtable;
-import java.util.Set;
+import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -84,7 +84,7 @@
protected MutableStartupConfiguration configuration = new MutableStartupConfiguration();
/** A testEntries of entries as Attributes to add to the DIT for testing */
- protected Set testEntries = new HashSet();
+ protected List testEntries = new ArrayList();
/** An optional LDIF file path if set and present is read to add more test entries */
private String ldifPath;
diff --git a/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java b/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java
index 93710c0..cd88147 100644
--- a/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java
+++ b/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java
@@ -98,17 +98,17 @@
}
/**
- * Returns the deep clone of the specified {@link Attributes} set.
+ * Returns the deep clone of the specified {@link Attributes} list.
*/
- static Set getClonedAttributesSet( Set set )
+ static List getClonedAttributesList( List list )
{
- Set newSet = new HashSet();
- Iterator i = set.iterator();
+ List newList = new ArrayList();
+ Iterator i = list.iterator();
while( i.hasNext() )
{
- newSet.add( ( ( Attributes ) i.next() ).clone() );
+ newList.add( ( ( Attributes ) i.next() ).clone() );
}
- return newSet;
+ return newList;
}
/**
diff --git a/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java b/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java
index 992b804..216e9b3 100644
--- a/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java
+++ b/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java
@@ -64,7 +64,7 @@
super.setInterceptorConfigurations( interceptorConfigurations );
}
- public void setTestEntries( Set testEntries )
+ public void setTestEntries( List testEntries )
{
super.setTestEntries( testEntries );
}
diff --git a/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java b/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java
index a67c765..becf320 100644
--- a/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java
+++ b/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java
@@ -60,7 +60,7 @@
private Set bootstrapSchemas; // Set<BootstrapSchema>
private Set contextPartitionConfigurations = new HashSet(); // Set<ContextPartitionConfiguration>
- private Set testEntries = new HashSet(); // Set<Attributes>
+ private List testEntries = new ArrayList(); // Set<Attributes>
protected StartupConfiguration()
{
@@ -287,19 +287,19 @@
* Returns test directory entries({@link Attributes}) to be loaded while
* bootstrapping.
*/
- public Set getTestEntries()
+ public List getTestEntries()
{
- return ConfigurationUtil.getClonedAttributesSet( testEntries );
+ return ConfigurationUtil.getClonedAttributesList( testEntries );
}
/**
* Sets test directory entries({@link Attributes}) to be loaded while
* bootstrapping.
*/
- protected void setTestEntries( Set testEntries )
+ protected void setTestEntries( List testEntries )
{
- testEntries = ConfigurationUtil.getClonedAttributesSet(
- ConfigurationUtil.getTypeSafeSet( testEntries, Attributes.class ) );
+ testEntries = ConfigurationUtil.getClonedAttributesList(
+ ConfigurationUtil.getTypeSafeList( testEntries, Attributes.class ) );
Iterator i = testEntries.iterator();
while( i.hasNext() )
diff --git a/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java b/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
index 7d973ca..86866cd 100644
--- a/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
+++ b/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
@@ -456,7 +456,7 @@
entry.put( "creatorsName", ContextPartitionNexus.ADMIN_PRINCIPAL );
entry.put( "createTimestamp", DateUtils.getGeneralizedTime() );
- Attribute dn = entry.remove( "dn" );
+ Attribute dn = ( Attribute ) entry.get( "dn" ).clone();
AttributeTypeRegistry registry = globalRegistries.getAttributeTypeRegistry();
NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( registry );
DnParser parser = new DnParser( ncn );