From 54cb8933e3f2c9b41bbd39c7014441ef3391ffbb Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Tue, 14 Nov 2006 20:57:02 +0000 Subject: [PATCH] moving to JDK1.4 LinkedHashMap instead of LinkedMap where possible. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@474974 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/lib/meta/CFMetaDataSerializer.java | 4 ++-- .../openjpa/lib/util/FormatPreservingProperties.java | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataSerializer.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataSerializer.java index 1e47e3739..a5f41ed31 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataSerializer.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataSerializer.java @@ -19,8 +19,8 @@ import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; +import java.util.LinkedHashMap; -import org.apache.commons.collections.map.LinkedMap; import org.xml.sax.SAXException; /** @@ -55,7 +55,7 @@ public abstract class CFMetaDataSerializer extends XMLMetaDataSerializer { * that package */ protected Map groupByPackage(Collection objs) throws SAXException { - Map packages = new LinkedMap(); + Map packages = new LinkedHashMap(); String packageName; Collection packageObjs; Object obj; diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java index f52372294..32d090239 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java @@ -30,14 +30,13 @@ import java.util.Calendar; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; -import org.apache.commons.collections.set.ListOrderedSet; - /* * ### things to add: - should probably be a SourceTracker * - if an entry is removed, should there be an option to remove comments @@ -85,7 +84,7 @@ public class FormatPreservingProperties extends Properties { private boolean insertTimestamp = false; private PropertySource source; - private ListOrderedSet newKeys = new ListOrderedSet(); + private LinkedHashSet newKeys = new LinkedHashSet(); private HashSet modifiedKeys = new HashSet(); // marker that indicates that we're not deserializing @@ -237,7 +236,7 @@ public class FormatPreservingProperties extends Properties { c.modifiedKeys = (HashSet) modifiedKeys.clone(); if (newKeys != null) { - c.newKeys = new ListOrderedSet(); + c.newKeys = new LinkedHashSet(); c.newKeys.addAll(newKeys); } @@ -444,7 +443,7 @@ public class FormatPreservingProperties extends Properties { lines.addAll(source); // next write out new keys, then the rest of the keys - ListOrderedSet keys = new ListOrderedSet(); + LinkedHashSet keys = new LinkedHashSet(); keys.addAll(newKeys); keys.addAll(keySet());