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/04/25 12:53:35 UTC

[groovy] 01/02: Revert changes to tweak the PR

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

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

commit 7619f43d36bccf4fb6fe1cd0cf1e8f7e1383cc68
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Apr 25 20:37:46 2020 +0800

    Revert changes to tweak the PR
---
 src/main/java/groovy/util/GroovyScriptEngine.java    |  2 +-
 src/main/java/org/codehaus/groovy/ast/ClassNode.java | 19 +------------------
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/src/main/java/groovy/util/GroovyScriptEngine.java b/src/main/java/groovy/util/GroovyScriptEngine.java
index 80477fb..7afd183 100644
--- a/src/main/java/groovy/util/GroovyScriptEngine.java
+++ b/src/main/java/groovy/util/GroovyScriptEngine.java
@@ -198,7 +198,7 @@ public class GroovyScriptEngine implements ResourceConnector {
                                 precompiledEntries.put(origName, path);
                             }
                             if (clazz != null) {
-                                ClassNode cn = new ClassNode(clazz, true);
+                                ClassNode cn = new ClassNode(clazz);
                                 return new LookupResult(null, cn);
                             }
                         } catch (ResourceException re) {
diff --git a/src/main/java/org/codehaus/groovy/ast/ClassNode.java b/src/main/java/org/codehaus/groovy/ast/ClassNode.java
index 87b0a48..15f6eb0 100644
--- a/src/main/java/org/codehaus/groovy/ast/ClassNode.java
+++ b/src/main/java/org/codehaus/groovy/ast/ClassNode.java
@@ -31,7 +31,6 @@ import org.codehaus.groovy.ast.tools.ParameterUtils;
 import org.codehaus.groovy.control.CompilePhase;
 import org.codehaus.groovy.transform.ASTTransformation;
 import org.codehaus.groovy.transform.GroovyASTTransformation;
-import org.codehaus.groovy.vmplugin.VMPlugin;
 import org.codehaus.groovy.vmplugin.VMPluginFactory;
 import org.objectweb.asm.Opcodes;
 
@@ -110,7 +109,6 @@ import static java.util.stream.Collectors.joining;
  * @see org.codehaus.groovy.ast.ClassHelper
  */
 public class ClassNode extends AnnotatedNode implements Opcodes {
-    private static final VMPlugin VM_PLUGIN = VMPluginFactory.getPlugin();
 
     private static class MapOfLists {
         Map<Object, List<MethodNode>> map;
@@ -261,21 +259,6 @@ public class ClassNode extends AnnotatedNode implements Opcodes {
     }
 
     /**
-     * Creates a non-primary {@code ClassNode} from a real class and can include the additional class information, e.g. generics types
-     *
-     * @param c the real class
-     * @param includeAdditionalClassInformation whether to include the additional class information
-     * @since 3.0.4
-     */
-    public ClassNode(Class<?> c, boolean includeAdditionalClassInformation) {
-        this(c);
-
-        if (includeAdditionalClassInformation) {
-            VM_PLUGIN.setAdditionalClassInformation(this);
-        }
-    }
-
-    /**
      * The complete class structure will be initialized only when really needed
      * to avoid having too many objects during compilation.
      */
@@ -287,7 +270,7 @@ public class ClassNode extends AnnotatedNode implements Opcodes {
                                          "A redirect() call is missing somewhere!");
             }
             if (lazyInitDone) return;
-            VM_PLUGIN.configureClassNode(compileUnit, this);
+            VMPluginFactory.getPlugin().configureClassNode(compileUnit, this);
             lazyInitDone = true;
         }
     }