diff --git a/groovy18-reproducible-bytecode.patch b/groovy18-reproducible-bytecode.patch index 8eba1f4..e280b7c 100644 --- a/groovy18-reproducible-bytecode.patch +++ b/groovy18-reproducible-bytecode.patch @@ -1,3 +1,41 @@ +--- groovy-core-GROOVY_1_8_9/src/main/groovy/util/ProxyGenerator.java 2023-09-26 13:31:23.332876047 +0200 ++++ groovy-core-GROOVY_1_8_9/src/main/groovy/util/ProxyGenerator.java 2023-09-26 22:14:38.014274779 +0200 +@@ -96,7 +96,7 @@ + } + + public GroovyObject instantiateAggregateFromBaseClass(Closure cl, Class clazz) { +- Map m = new HashMap(); ++ Map m = new TreeMap(); + m.put("*", cl); + return instantiateAggregateFromBaseClass(m, clazz, null); + } +@@ -132,7 +132,7 @@ + } + + public GroovyObject instantiateAggregate(Map closureMap, List interfaces, Class clazz, Object[] constructorArgs) { +- Map map = new HashMap(); ++ Map map = new LinkedHashMap(); + if (closureMap != null) { + map = closureMap; + } +@@ -181,7 +181,7 @@ + buffer.append(" }\n"); + + // add overwriting methods +- Map selectedMethods = new HashMap(); ++ Map selectedMethods = new TreeMap(); + List publicAndProtectedMethods = getInheritedMethods(baseClass, new ArrayList()); + boolean closureIndicator = map.containsKey("*"); + for (Method method : publicAndProtectedMethods) { +@@ -269,7 +269,7 @@ + } + + public GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List interfaces, Object delegate, Class baseClass, String name) { +- Map map = new HashMap(); ++ Map map = new LinkedHashMap(); + if (closureMap != null) { + map = closureMap; + } --- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ast/ClassNode.java 2023-09-26 13:31:23.339542759 +0200 +++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ast/ClassNode.java 2023-09-26 19:47:32.055269643 +0200 @@ -406,7 +406,7 @@ @@ -10,60 +48,61 @@ return res; } --- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ast/VariableScope.java 2023-09-26 13:31:23.339542759 +0200 -+++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ast/VariableScope.java 2023-09-26 19:45:48.534571007 +0200 ++++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ast/VariableScope.java 2023-09-26 20:06:22.392879780 +0200 @@ -16,8 +16,8 @@ package org.codehaus.groovy.ast; import java.util.Collections; -import java.util.HashMap; import java.util.Iterator; -+import java.util.TreeMap; ++import java.util.LinkedHashMap; import java.util.Map; /** -@@ -107,17 +107,17 @@ +@@ -107,18 +107,15 @@ VariableScope copy = new VariableScope(); copy.clazzScope = clazzScope; if (declaredVariables.size() > 0) { - copy.declaredVariables = new HashMap(); -+ copy.declaredVariables = new TreeMap(); - copy.declaredVariables.putAll(declaredVariables); +- copy.declaredVariables.putAll(declaredVariables); ++ copy.declaredVariables = new LinkedHashMap(declaredVariables); } copy.inStaticContext = inStaticContext; copy.parent = parent; if (referencedClassVariables.size() > 0) { - copy.referencedClassVariables = new HashMap(); -+ copy.referencedClassVariables = new TreeMap(); - copy.referencedClassVariables.putAll(referencedClassVariables); +- copy.referencedClassVariables.putAll(referencedClassVariables); ++ copy.referencedClassVariables = new LinkedHashMap(referencedClassVariables); } if (referencedLocalVariables.size() > 0) { - copy.referencedLocalVariables = new HashMap(); -+ copy.referencedLocalVariables = new TreeMap(); - copy.referencedLocalVariables.putAll(referencedLocalVariables); +- copy.referencedLocalVariables.putAll(referencedLocalVariables); ++ copy.referencedLocalVariables = new LinkedHashMap(referencedLocalVariables); } copy.resolvesDynamic = resolvesDynamic; -@@ -126,7 +126,7 @@ + return copy; +@@ -126,7 +123,7 @@ public void putDeclaredVariable(Variable var) { if (declaredVariables == Collections.EMPTY_MAP) - declaredVariables = new HashMap(); -+ declaredVariables = new TreeMap(); ++ declaredVariables = new LinkedHashMap(); declaredVariables.put(var.getName(), var); } -@@ -144,13 +144,13 @@ +@@ -144,13 +141,13 @@ public void putReferencedLocalVariable(Variable var) { if (referencedLocalVariables == Collections.EMPTY_MAP) - referencedLocalVariables = new HashMap(); -+ referencedLocalVariables = new TreeMap(); ++ referencedLocalVariables = new LinkedHashMap(); referencedLocalVariables.put(var.getName(), var); } public void putReferencedClassVariable(Variable var) { if (referencedClassVariables == Collections.EMPTY_MAP) - referencedClassVariables = new HashMap(); -+ referencedClassVariables = new TreeMap(); ++ referencedClassVariables = new LinkedHashMap(); referencedClassVariables.put(var.getName(), var); } @@ -74,7 +113,7 @@ private Map, ASTTransformation> transformInstances; private static CompilationUnit compUnit; - private static Set globalTransformNames = new HashSet(); -+ private static Set globalTransformNames = new TreeSet(); ++ private static Set globalTransformNames = new LinkedHashSet(); private ASTTransformationVisitor(CompilePhase phase) { this.phase = phase; @@ -85,7 +124,7 @@ import java.util.Arrays; -import java.util.HashSet; -+import java.util.TreeSet; ++import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -94,7 +133,7 @@ final LinkedList> varStack = new LinkedList>(); - Set names = new HashSet(); -+ Set names = new TreeSet(); ++ Set names = new LinkedHashSet(); for (FieldNode field : parent.getFields()) { names.add(field.getName()); } @@ -103,7 +142,7 @@ private void addVariablesToStack(Parameter[] params) { - Set names = new HashSet(); -+ Set names = new TreeSet(); ++ Set names = new LinkedHashSet(); names.addAll(varStack.getLast()); for (Parameter param : params) { names.add(param.getName()); @@ -112,7 +151,7 @@ @Override public void visitBlockStatement(BlockStatement block) { - Set names = new HashSet(); -+ Set names = new TreeSet(); ++ Set names = new LinkedHashSet(); names.addAll(varStack.getLast()); varStack.add(names); super.visitBlockStatement(block);