[ 
https://issues.apache.org/jira/browse/GROOVY-11689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17955575#comment-17955575
 ] 

ASF GitHub Bot commented on GROOVY-11689:
-----------------------------------------

paulk-asert commented on code in PR #2245:
URL: https://github.com/apache/groovy/pull/2245#discussion_r2120162906


##########
src/main/java/org/codehaus/groovy/transform/DelegateASTTransformation.java:
##########
@@ -165,7 +167,10 @@ public void visit(final ASTNode[] nodes, final SourceUnit 
source) {
             if (!checkPropertyOrMethodList(delegate.type, delegate.excludes, 
"excludes", node, MY_TYPE_NAME)) return;
             if (!checkPropertyOrMethodList(delegate.type, delegate.includes, 
"includes", node, MY_TYPE_NAME)) return;
 
-            final Iterable<MethodNode> ownerMethods = 
getAllMethods(delegate.owner);
+            final List<MethodNode> ownerMethods = new 
ArrayList<>(getAllMethods(delegate.owner));

Review Comment:
   getAllMethods creates a new list, so you shouldn't need the outer ArrayList 
(here and below).





> @Delegate generates random method orders
> ----------------------------------------
>
>                 Key: GROOVY-11689
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11689
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: James Daugherty
>            Priority: Major
>
> While working on the Grails build reproducibility, I discovered that the 
> `grails-scaffolding` artifact was not reproducible.  This was because the 
> `@Delegate` method calls getMethods() which we discovered in GROOVY-11674 can 
> have ordering issues.  This ticket is to sort this call to ensure consistent 
> class file creation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to