This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 1e342f1daf GROOVY-11715: Grails reproducible build part 3:
@DelegatesTo ordering
1e342f1daf is described below
commit 1e342f1daff5ac2d5ecd9a375ae96e1161336df8
Author: Paul King <[email protected]>
AuthorDate: Thu Jul 17 23:16:53 2025 +1000
GROOVY-11715: Grails reproducible build part 3: @DelegatesTo ordering
---
.../java/org/codehaus/groovy/classgen/AsmClassGenerator.java | 10 ++++++----
.../codehaus/groovy/classgen/asm/TypeAnnotationsTest.groovy | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java
b/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java
index 6f6fdb06a3..a84538d496 100644
--- a/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java
+++ b/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java
@@ -132,6 +132,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
+import java.util.TreeMap;
import java.util.function.Consumer;
import static org.apache.groovy.ast.tools.ClassNodeUtils.getField;
@@ -2221,10 +2222,11 @@ public class AsmClassGenerator extends ClassGenerator {
* @param av the visitor to use
*/
public void visitAnnotationAttributes(final AnnotationNode an, final
AnnotationVisitor av) {
- Map<String, Object> constantAttrs = new HashMap<>();
- Map<String, PropertyExpression> enumAttrs = new HashMap<>();
- Map<String, Object> atAttrs = new HashMap<>();
- Map<String, ListExpression> arrayAttrs = new HashMap<>();
+ // GROOVY-11715 TODO If we can determine what was causing the issues
mentioned on that ticket, we should change these back to LinkedHashMap
+ Map<String, Object> constantAttrs = new TreeMap<>();
+ Map<String, PropertyExpression> enumAttrs = new TreeMap<>();
+ Map<String, Object> atAttrs = new TreeMap<>();
+ Map<String, ListExpression> arrayAttrs = new TreeMap<>();
for (Map.Entry<String, Expression> member :
an.getMembers().entrySet()) {
String name = member.getKey();
diff --git
a/src/test/groovy/org/codehaus/groovy/classgen/asm/TypeAnnotationsTest.groovy
b/src/test/groovy/org/codehaus/groovy/classgen/asm/TypeAnnotationsTest.groovy
index 03b5570c2c..07f259bdec 100644
---
a/src/test/groovy/org/codehaus/groovy/classgen/asm/TypeAnnotationsTest.groovy
+++
b/src/test/groovy/org/codehaus/groovy/classgen/asm/TypeAnnotationsTest.groovy
@@ -226,7 +226,7 @@ final class TypeAnnotationsTest extends
AbstractBytecodeTestCase {
assert bytecode.hasSequence([
'public sizeZeroOrPositive(Ljava/util/List;)Z',
'@Lnet/jqwik/api/Property;()',
- '@Lnet/jqwik/api/constraints/IntRange;(min=0, max=10) :
METHOD_FORMAL_PARAMETER 0, 0;',
+ '@Lnet/jqwik/api/constraints/IntRange;(max=10, min=0) :
METHOD_FORMAL_PARAMETER 0, 0;',
'// annotable parameter count: 1 (visible)',
'@Lnet/jqwik/api/ForAll;() // parameter 0'
])