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 2021/08/12 23:52:47 UTC

[groovy] branch danielsun/mark-generated updated (9ff1aef -> ac55b0b)

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a change to branch danielsun/mark-generated
in repository https://gitbox.apache.org/repos/asf/groovy.git.


 discard 9ff1aef  Attach annotations to internal methods
     new ac55b0b  Attach annotations to internal method `$getLookup`

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (9ff1aef)
            \
             N -- N -- N   refs/heads/danielsun/mark-generated (ac55b0b)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/java/org/codehaus/groovy/classgen/Verifier.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

[groovy] 01/01: Attach annotations to internal method `$getLookup`

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch danielsun/mark-generated
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit ac55b0b54e63f1d4ab5c7af7f79fc902967febf3
Author: Daniel Sun <su...@apache.org>
AuthorDate: Fri Aug 13 07:52:34 2021 +0800

    Attach annotations to internal method `$getLookup`
---
 src/main/java/org/codehaus/groovy/classgen/Verifier.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/Verifier.java b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
index 5425c24..809d7f2 100644
--- a/src/main/java/org/codehaus/groovy/classgen/Verifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
@@ -416,7 +416,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
             modifiers |= ACC_STATIC;
         }
 
-        node.addSyntheticMethod(
+        MethodNode getLookupMethodNode = node.addSyntheticMethod(
                 "$getLookup",
                 modifiers,
                 ClassHelper.make(MethodHandles.Lookup.class),
@@ -430,6 +430,11 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
                     }
                 })
         );
+        boolean shouldAnnotate = classNode.getModule().getContext() != null;
+        if (shouldAnnotate) {
+            getLookupMethodNode.addAnnotation(new AnnotationNode(ClassHelper.make(GENERATED_ANNOTATION)));
+            getLookupMethodNode.addAnnotation(new AnnotationNode(ClassHelper.make(INTERNAL_ANNOTATION)));
+        }
     }
 
     private void addStaticMetaClassField(final ClassNode node, final String classInternalName) {