You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/11/15 14:32:19 UTC

[groovy] branch master updated: GROOVY-9772: AnnotationCollectorTransform generates code not marked with @Generated (closes #1416)

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 6287e05  GROOVY-9772: AnnotationCollectorTransform generates code not marked with @Generated (closes #1416)
6287e05 is described below

commit 6287e059b7cf9cb2eea07c7041881381f68ab1f8
Author: Kishore Kumar M V <ki...@huawei.com>
AuthorDate: Sun Nov 15 22:31:01 2020 +0800

    GROOVY-9772: AnnotationCollectorTransform generates code not marked with @Generated (closes #1416)
---
 .../org/codehaus/groovy/transform/AnnotationCollectorTransform.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java b/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
index c0e3e9b..3323e2b 100644
--- a/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
+++ b/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
@@ -19,6 +19,7 @@
 package org.codehaus.groovy.transform;
 
 import groovy.transform.AnnotationCollector;
+import org.apache.groovy.ast.tools.ClassNodeUtils;
 import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.ast.ASTNode;
 import org.codehaus.groovy.ast.AnnotatedNode;
@@ -137,7 +138,7 @@ public class AnnotationCollectorTransform {
 
             ArrayExpression ae = new ArrayExpression(ClassHelper.OBJECT_TYPE.makeArray(), outer);
             Statement code = new ReturnStatement(ae);
-            helper.addMethod("value", ACC_PUBLIC | ACC_STATIC,
+            ClassNodeUtils.addGeneratedMethod(helper, "value", ACC_PUBLIC | ACC_STATIC,
                     ClassHelper.OBJECT_TYPE.makeArray().makeArray(),
                     Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, code);