Remove non-determinism from ClassSourceFileComposerFactory and RpcProxyCreator.
Review by: robertvawter@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@8694 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java b/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java
index 5203f94..c9d1062 100644
--- a/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java
+++ b/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java
@@ -50,8 +50,8 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -133,9 +133,9 @@
TypeOracle typeOracle = ctx.getTypeOracle();
JClassType objectType = typeOracle.getJavaLangObject();
- Set<JType> classLiterals = new HashSet<JType>();
- Map<JType, JMethod> serializerMethods = new HashMap<JType, JMethod>();
- Map<JType, List<String>> fields = new HashMap<JType, List<String>>();
+ Set<JType> classLiterals = new LinkedHashSet<JType>();
+ Map<JType, JMethod> serializerMethods = new LinkedHashMap<JType, JMethod>();
+ Map<JType, List<String>> fields = new LinkedHashMap<JType, List<String>>();
StringBuilder sb = writeArtificialRescues(typeOracle, serializationSto,
deserializationSto);
@@ -303,7 +303,7 @@
private StringBuilder writeArtificialRescues(TypeOracle typeOracle,
SerializableTypeOracle serializationSto,
SerializableTypeOracle deserializationSto) {
- Set<JType> serializableTypes = new HashSet<JType>();
+ Set<JType> serializableTypes = new LinkedHashSet<JType>();
Collections.addAll(serializableTypes,
serializationSto.getSerializableTypes());
Collections.addAll(serializableTypes,
diff --git a/user/src/com/google/gwt/user/rebind/ClassSourceFileComposerFactory.java b/user/src/com/google/gwt/user/rebind/ClassSourceFileComposerFactory.java
index fc926a1..1caab03 100644
--- a/user/src/com/google/gwt/user/rebind/ClassSourceFileComposerFactory.java
+++ b/user/src/com/google/gwt/user/rebind/ClassSourceFileComposerFactory.java
@@ -20,7 +20,7 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -68,9 +68,9 @@
private String className;
- private Set<String> imports = new HashSet<String>();
+ private Set<String> imports = new LinkedHashSet<String>();
- private Set<String> interfaceNames = new HashSet<String>();
+ private Set<String> interfaceNames = new LinkedHashSet<String>();
private String packageName;