26
26
import com .google .javascript .rhino .JSDocInfo ;
27
27
import com .google .javascript .rhino .Node ;
28
28
import java .util .ArrayList ;
29
- import java .util .HashMap ;
30
- import java .util .HashSet ;
31
29
import java .util .LinkedHashMap ;
32
30
import java .util .LinkedHashSet ;
33
31
import java .util .List ;
@@ -107,7 +105,7 @@ public final class ConcretizeStaticInheritanceForInlining implements CompilerPas
107
105
static final DiagnosticType DUPLICATE_CLASS =
108
106
DiagnosticType .error ("DUPLICATE_CLASS" , "Multiple classes cannot share the same name: {0}" );
109
107
110
- private final Set <String > duplicateClassNames = new HashSet <>();
108
+ private final Set <String > duplicateClassNames = new LinkedHashSet <>();
111
109
112
110
// Property names that may cause issues if they are concretized.
113
111
private static final ImmutableSet <String > BANNED_PROP_NAMES =
@@ -117,7 +115,7 @@ private static class JavascriptClass {
117
115
// All static members to the class including get set properties.
118
116
private final Set <Node > staticMembers = new LinkedHashSet <>();
119
117
// Keep updated the set of static member names to avoid O(n^2) searches.
120
- private final Set <String > staticMemberNames = new HashSet <>();
118
+ private final Set <String > staticMemberNames = new LinkedHashSet <>();
121
119
// Collect all the static field accesses to the class.
122
120
private final Set <Node > staticFieldAccess = new LinkedHashSet <>();
123
121
// Collect all get set properties as defined by Object.defineProperties(...)
@@ -203,7 +201,9 @@ private void copyDeclarations(
203
201
}
204
202
205
203
private void copyStaticMembers (
206
- JavascriptClass superClass , JavascriptClass subClass , Node inheritsCall ,
204
+ JavascriptClass superClass ,
205
+ JavascriptClass subClass ,
206
+ Node inheritsCall ,
207
207
FindStaticMembers findStaticMembers ) {
208
208
for (Node staticMember : superClass .staticMembers ) {
209
209
checkState (staticMember .isAssign (), staticMember );
@@ -276,7 +276,7 @@ private class FindStaticMembers extends AbstractPostOrderCallback {
276
276
final List <Node > inheritsCalls = new ArrayList <>();
277
277
// Store the order we find class definitions and static fields. Copied statics must occur
278
278
// after both the namespace and the copied property are defined.
279
- final Map <Node , Integer > nodeOrder = new HashMap <>();
279
+ final Map <Node , Integer > nodeOrder = new LinkedHashMap <>();
280
280
281
281
@ Override
282
282
public void visit (NodeTraversal t , Node n , Node parent ) {
0 commit comments