groovy git commit: Remove ACC_SYNTHETIC of `GroovyObject`'s methods

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: Remove ACC_SYNTHETIC of `GroovyObject`'s methods

Daniel.Sun
Repository: groovy
Updated Branches:
  refs/heads/master af98abb4d -> 7afe48587


Remove ACC_SYNTHETIC of `GroovyObject`'s methods

http://groovy.329449.n5.nabble.com/Synthetic-GroovyObject-methods-tp5748032.html


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/7afe4858
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/7afe4858
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/7afe4858

Branch: refs/heads/master
Commit: 7afe48587e9c7919b0de021c7dd84a7b54f0fe6c
Parents: af98abb
Author: sunlan <[hidden email]>
Authored: Tue Mar 13 08:45:33 2018 +0800
Committer: sunlan <[hidden email]>
Committed: Tue Mar 13 08:45:33 2018 +0800

----------------------------------------------------------------------
 .../java/org/codehaus/groovy/classgen/Verifier.java     | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7afe4858/src/main/java/org/codehaus/groovy/classgen/Verifier.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/Verifier.java b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
index d02b6ca..af18c7e 100644
--- a/src/main/java/org/codehaus/groovy/classgen/Verifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
@@ -83,7 +83,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import static java.lang.reflect.Modifier.isAbstract;
 import static java.lang.reflect.Modifier.isFinal;
 import static java.lang.reflect.Modifier.isPrivate;
 import static java.lang.reflect.Modifier.isPublic;
@@ -405,10 +404,11 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
 
         boolean shouldAnnotate = classNode.getModule().getContext() != null;
         AnnotationNode generatedAnnotation = shouldAnnotate ? new AnnotationNode(ClassHelper.make(GENERATED_ANNOTATION)) : null;
+        boolean shouldBeSynthetic = false; // !isAbstract(node.getModifiers());
 
         if (!node.hasMethod("getMetaClass", Parameter.EMPTY_ARRAY)) {
             metaClassField = setMetaClassFieldIfNotExists(node, metaClassField);
-            MethodNode methodNode = addMethod(node, !isAbstract(node.getModifiers()),
+            MethodNode methodNode = addMethod(node, shouldBeSynthetic,
                     "getMetaClass",
                     ACC_PUBLIC,
                     ClassHelper.METACLASS_TYPE,
@@ -476,7 +476,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
                 setMetaClassCode = new BytecodeSequence(list);
             }
 
-            MethodNode methodNode = addMethod(node, !isAbstract(node.getModifiers()),
+            MethodNode methodNode = addMethod(node, shouldBeSynthetic,
                     "setMetaClass",
                     ACC_PUBLIC, ClassHelper.VOID_TYPE,
                     SET_METACLASS_PARAMS, ClassNode.EMPTY_ARRAY,
@@ -492,7 +492,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
             blockScope.putReferencedLocalVariable(vMethods);
             blockScope.putReferencedLocalVariable(vArguments);
 
-            MethodNode methodNode = addMethod(node, !isAbstract(node.getModifiers()),
+            MethodNode methodNode = addMethod(node, shouldBeSynthetic,
                     "invokeMethod",
                     ACC_PUBLIC,
                     ClassHelper.OBJECT_TYPE, INVOKE_METHOD_PARAMS,
@@ -513,7 +513,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
         }
 
         if (!node.hasMethod("getProperty", GET_PROPERTY_PARAMS)) {
-            MethodNode methodNode = addMethod(node, !isAbstract(node.getModifiers()),
+            MethodNode methodNode = addMethod(node, shouldBeSynthetic,
                     "getProperty",
                     ACC_PUBLIC,
                     ClassHelper.OBJECT_TYPE,
@@ -534,7 +534,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
         }
 
         if (!node.hasMethod("setProperty", SET_PROPERTY_PARAMS)) {
-            MethodNode methodNode = addMethod(node, !isAbstract(node.getModifiers()),
+            MethodNode methodNode = addMethod(node, shouldBeSynthetic,
                     "setProperty",
                     ACC_PUBLIC,
                     ClassHelper.VOID_TYPE,

Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun