You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/10/19 13:02:10 UTC

groovy git commit: refactor

Repository: groovy
Updated Branches:
  refs/heads/master 3e74103ec -> 4f2dd6162


refactor


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

Branch: refs/heads/master
Commit: 4f2dd61624fc2874de6690eec77e0867a7bc6f0b
Parents: 3e74103
Author: paulk <pa...@asert.com.au>
Authored: Thu Oct 19 22:12:26 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu Oct 19 22:12:26 2017 +1000

----------------------------------------------------------------------
 .../apache/groovy/ast/tools/ClassNodeUtils.java | 220 +++++++++++++++++++
 src/main/org/codehaus/groovy/ast/ClassNode.java |  13 +-
 .../groovy/ast/tools/ClassNodeUtils.java        | 181 +++------------
 .../classgen/ClassCompletionVerifier.java       |   4 +-
 .../org/codehaus/groovy/classgen/Verifier.java  |   6 +-
 .../groovy/control/StaticImportVisitor.java     |  12 +-
 .../codehaus/groovy/control/StaticVerifier.java |   2 +-
 7 files changed, 261 insertions(+), 177 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/4f2dd616/src/main/org/apache/groovy/ast/tools/ClassNodeUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/groovy/ast/tools/ClassNodeUtils.java b/src/main/org/apache/groovy/ast/tools/ClassNodeUtils.java
index b8fd27a..77509d0 100644
--- a/src/main/org/apache/groovy/ast/tools/ClassNodeUtils.java
+++ b/src/main/org/apache/groovy/ast/tools/ClassNodeUtils.java
@@ -18,7 +18,23 @@
  */
 package org.apache.groovy.ast.tools;
 
+import org.codehaus.groovy.ast.ClassHelper;
 import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.MethodNode;
+import org.codehaus.groovy.ast.Parameter;
+import org.codehaus.groovy.ast.PropertyNode;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.expr.MapExpression;
+import org.codehaus.groovy.ast.expr.SpreadExpression;
+import org.codehaus.groovy.ast.expr.TupleExpression;
+
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.codehaus.groovy.ast.ClassHelper.boolean_TYPE;
 
 /**
  * Utility class for working with ClassNodes
@@ -49,5 +65,209 @@ public class ClassNodeUtils {
         return cNode.getName();
     }
 
+    /**
+     * Add methods from the super class.
+     *
+     * @param cNode The ClassNode
+     * @return A map of methods
+     */
+    public static Map<String, MethodNode> getDeclaredMethodsFromSuper(ClassNode cNode) {
+        ClassNode parent = cNode.getSuperClass();
+        if (parent == null) {
+            return new HashMap<String, MethodNode>();
+        }
+        return parent.getDeclaredMethodsMap();
+    }
+
+    /**
+     * Add in methods from all interfaces. Existing entries in the methods map take precedence.
+     * Methods from interfaces visited early take precedence over later ones.
+     *
+     * @param cNode The ClassNode
+     * @param methodsMap A map of existing methods to alter
+     */
+    public static void addDeclaredMethodsFromInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
+        // add in unimplemented abstract methods from the interfaces
+        for (ClassNode iface : cNode.getInterfaces()) {
+            Map<String, MethodNode> ifaceMethodsMap = iface.getDeclaredMethodsMap();
+            for (String methSig : ifaceMethodsMap.keySet()) {
+                if (!methodsMap.containsKey(methSig)) {
+                    MethodNode methNode = ifaceMethodsMap.get(methSig);
+                    methodsMap.put(methSig, methNode);
+                }
+            }
+        }
+    }
+
+    /**
+     * Get methods from all interfaces.
+     * Methods from interfaces visited early will be overwritten by later ones.
+     *
+     * @param cNode The ClassNode
+     * @return A map of methods
+     */
+    public static Map<String, MethodNode> getDeclaredMethodsFromInterfaces(ClassNode cNode) {
+        Map<String, MethodNode> result = new HashMap<String, MethodNode>();
+        ClassNode[] interfaces = cNode.getInterfaces();
+        for (ClassNode iface : interfaces) {
+            result.putAll(iface.getDeclaredMethodsMap());
+        }
+        return result;
+    }
+
+    /**
+     * Adds methods from interfaces and parent interfaces. Existing entries in the methods map take precedence.
+     * Methods from interfaces visited early take precedence over later ones.
+     *
+     * @param cNode The ClassNode
+     * @param methodsMap A map of existing methods to alter
+     */
+    public static void addDeclaredMethodsFromAllInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
+        List cnInterfaces = Arrays.asList(cNode.getInterfaces());
+        ClassNode parent = cNode.getSuperClass();
+        while (parent != null && !parent.equals(ClassHelper.OBJECT_TYPE)) {
+            ClassNode[] interfaces = parent.getInterfaces();
+            for (ClassNode iface : interfaces) {
+                if (!cnInterfaces.contains(iface)) {
+                    methodsMap.putAll(iface.getDeclaredMethodsMap());
+                }
+            }
+            parent = parent.getSuperClass();
+        }
+    }
+
+    /**
+     * Returns true if the given method has a possibly matching static method with the given name and arguments.
+     * Handles default arguments and optionally spread expressions.
+     *
+     * @param cNode     the ClassNode of interest
+     * @param name      the name of the method of interest
+     * @param arguments the arguments to match against
+     * @param trySpread whether to try to account for SpreadExpressions within the arguments
+     * @return true if a matching method was found
+     */
+    public static boolean hasPossibleStaticMethod(ClassNode cNode, String name, Expression arguments, boolean trySpread) {
+        int count = 0;
+        boolean foundSpread = false;
+
+        if (arguments instanceof TupleExpression) {
+            TupleExpression tuple = (TupleExpression) arguments;
+            for (Expression arg : tuple.getExpressions()) {
+                if (arg instanceof SpreadExpression) {
+                    foundSpread = true;
+                } else {
+                    count++;
+                }
+            }
+        } else if (arguments instanceof MapExpression) {
+            count = 1;
+        }
+
+        for (MethodNode method : cNode.getMethods(name)) {
+            if (method.isStatic()) {
+                Parameter[] parameters = method.getParameters();
+                // do fuzzy match for spread case: count will be number of non-spread args
+                if (trySpread && foundSpread && parameters.length >= count) return true;
+
+                if (parameters.length == count) return true;
+
+                // handle varargs case
+                if (parameters.length > 0 && parameters[parameters.length - 1].getType().isArray()) {
+                    if (count >= parameters.length - 1) return true;
+                    // fuzzy match any spread to a varargs
+                    if (trySpread && foundSpread) return true;
+                }
+
+                // handle parameters with default values
+                int nonDefaultParameters = 0;
+                for (Parameter parameter : parameters) {
+                    if (!parameter.hasInitialExpression()) {
+                        nonDefaultParameters++;
+                    }
+                }
+
+                if (count < parameters.length && nonDefaultParameters <= count) {
+                    return true;
+                }
+                // TODO handle spread with nonDefaultParams?
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Return true if we have a static accessor
+     */
+    public static boolean hasPossibleStaticProperty(ClassNode cNode, String methodName) {
+        // assume explicit static method call checked first so we can assume a simple check here
+        if (!methodName.startsWith("get") && !methodName.startsWith("is")) {
+            return false;
+        }
+        String propName = getPropNameForAccessor(methodName);
+        PropertyNode pNode = getStaticProperty(cNode, propName);
+        return pNode != null && (methodName.startsWith("get") || boolean_TYPE.equals(pNode.getType()));
+    }
+
+    /**
+     * Returns the property name, e.g. age, given an accessor name, e.g. getAge.
+     * Returns the original if a valid prefix cannot be removed.
+     *
+     * @param accessorName the accessor name of interest, e.g. getAge
+     * @return the property name, e.g. age, or original if not a valid property accessor name
+     */
+    public static String getPropNameForAccessor(String accessorName) {
+        if (!isValidAccessorName(accessorName)) return accessorName;
+        int prefixLength = accessorName.startsWith("is") ? 2 : 3;
+        return String.valueOf(accessorName.charAt(prefixLength)).toLowerCase() + accessorName.substring(prefixLength + 1);
+    }
+
+    /**
+     * Detect whether the given accessor name starts with "get", "set" or "is" followed by at least one character.
+     *
+     * @param accessorName the accessor name of interest, e.g. getAge
+     * @return true if a valid prefix is found
+     */
+    public static boolean isValidAccessorName(String accessorName) {
+        if (accessorName.startsWith("get") || accessorName.startsWith("is") || accessorName.startsWith("set")) {
+            int prefixLength = accessorName.startsWith("is") ? 2 : 3;
+            return accessorName.length() > prefixLength;
+        };
+        return false;
+    }
+
+    public static boolean hasStaticProperty(ClassNode cNode, String propName) {
+        return getStaticProperty(cNode, propName) != null;
+    }
+
+    /**
+     * Detect whether a static property with the given name is within the class
+     * or a super class.
+     *
+     * @param cNode the ClassNode of interest
+     * @param propName the property name
+     * @return the static property if found or else null
+     */
+    public static PropertyNode getStaticProperty(ClassNode cNode, String propName) {
+        ClassNode classNode = cNode;
+        while (classNode != null) {
+            for (PropertyNode pn : classNode.getProperties()) {
+                if (pn.getName().equals(propName) && pn.isStatic()) return pn;
+            }
+            classNode = classNode.getSuperClass();
+        }
+        return null;
+    }
+
+    /**
+     * Detect whether a given ClassNode is a inner class (non-static).
+     *
+     * @param cNode the ClassNode of interest
+     * @return true if the given node is a (non-static) inner class, else false
+     */
+    public static boolean isInnerClass(ClassNode cNode) {
+        return cNode.redirect().getOuterClass() != null
+                && !Modifier.isStatic(cNode.getModifiers());
+    }
+
     private ClassNodeUtils() { }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/4f2dd616/src/main/org/codehaus/groovy/ast/ClassNode.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/ast/ClassNode.java b/src/main/org/codehaus/groovy/ast/ClassNode.java
index 8c9bac1..3e677b4 100644
--- a/src/main/org/codehaus/groovy/ast/ClassNode.java
+++ b/src/main/org/codehaus/groovy/ast/ClassNode.java
@@ -20,6 +20,7 @@ package org.codehaus.groovy.ast;
 
 import groovy.lang.groovydoc.Groovydoc;
 import groovy.lang.groovydoc.GroovydocHolder;
+import org.apache.groovy.ast.tools.ClassNodeUtils;
 import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.ast.expr.BinaryExpression;
 import org.codehaus.groovy.ast.expr.Expression;
@@ -28,7 +29,6 @@ import org.codehaus.groovy.ast.expr.TupleExpression;
 import org.codehaus.groovy.ast.stmt.BlockStatement;
 import org.codehaus.groovy.ast.stmt.ExpressionStatement;
 import org.codehaus.groovy.ast.stmt.Statement;
-import org.codehaus.groovy.ast.tools.ClassNodeUtils;
 import org.codehaus.groovy.ast.tools.ParameterUtils;
 import org.codehaus.groovy.control.CompilePhase;
 import org.codehaus.groovy.transform.ASTTransformation;
@@ -450,15 +450,8 @@ public class ClassNode extends AnnotatedNode implements Opcodes, GroovydocHolder
     }
 
     public Map<String, MethodNode> getDeclaredMethodsMap() {
-        // Start off with the methods from the superclass.
-        ClassNode parent = getSuperClass();
-        Map<String, MethodNode> result;
-        if (parent != null) {
-            result = parent.getDeclaredMethodsMap();
-        } else {
-            result = new HashMap<String, MethodNode>();
-        }
-        ClassNodeUtils.addInterfaceMethods(this, result);
+        Map<String, MethodNode> result = ClassNodeUtils.getDeclaredMethodsFromSuper(this);
+        ClassNodeUtils.addDeclaredMethodsFromInterfaces(this, result);
 
         // And add in the methods implemented in this class.
         for (MethodNode method : getMethods()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/4f2dd616/src/main/org/codehaus/groovy/ast/tools/ClassNodeUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/ast/tools/ClassNodeUtils.java b/src/main/org/codehaus/groovy/ast/tools/ClassNodeUtils.java
index 077e6cb..5c43586 100644
--- a/src/main/org/codehaus/groovy/ast/tools/ClassNodeUtils.java
+++ b/src/main/org/codehaus/groovy/ast/tools/ClassNodeUtils.java
@@ -17,193 +17,64 @@
  * under the License.
  *
  */
-
 package org.codehaus.groovy.ast.tools;
 
-import org.codehaus.groovy.ast.ClassHelper;
 import org.codehaus.groovy.ast.ClassNode;
 import org.codehaus.groovy.ast.MethodNode;
-import org.codehaus.groovy.ast.Parameter;
 import org.codehaus.groovy.ast.PropertyNode;
 import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.MapExpression;
-import org.codehaus.groovy.ast.expr.SpreadExpression;
-import org.codehaus.groovy.ast.expr.TupleExpression;
 
-import java.lang.reflect.Modifier;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
-import static org.codehaus.groovy.ast.ClassHelper.boolean_TYPE;
-
+@Deprecated
 public class ClassNodeUtils {
-    public static void addInterfaceMethods(ClassNode cnode, Map<String, MethodNode> methodsMap) {
-        // add in unimplemented abstract methods from the interfaces
-        for (ClassNode iface : cnode.getInterfaces()) {
-            Map<String, MethodNode> ifaceMethodsMap = iface.getDeclaredMethodsMap();
-            for (String methSig : ifaceMethodsMap.keySet()) {
-                if (!methodsMap.containsKey(methSig)) {
-                    MethodNode methNode = ifaceMethodsMap.get(methSig);
-                    methodsMap.put(methSig, methNode);
-                }
-            }
-        }
+    @Deprecated
+    public static void addInterfaceMethods(ClassNode cNode, Map<String, MethodNode> methodsMap) {
+        org.apache.groovy.ast.tools.ClassNodeUtils.addDeclaredMethodsFromInterfaces(cNode, methodsMap);
     }
 
-    public static Map<String, MethodNode> getDeclaredMethodMapsFromInterfaces(ClassNode classNode) {
-        Map<String, MethodNode> result = new HashMap<String, MethodNode>();
-        ClassNode[] interfaces = classNode.getInterfaces();
-        for (ClassNode iface : interfaces) {
-            result.putAll(iface.getDeclaredMethodsMap());
-        }
-        return result;
+    @Deprecated
+    public static Map<String, MethodNode> getDeclaredMethodMapsFromInterfaces(ClassNode cNode) {
+        return org.apache.groovy.ast.tools.ClassNodeUtils.getDeclaredMethodsFromInterfaces(cNode);
     }
 
-    public static void addDeclaredMethodMapsFromSuperInterfaces(ClassNode cn, Map<String, MethodNode> allInterfaceMethods) {
-        List cnInterfaces = Arrays.asList(cn.getInterfaces());
-        ClassNode sn = cn.getSuperClass();
-        while (sn != null && !sn.equals(ClassHelper.OBJECT_TYPE)) {
-            ClassNode[] interfaces = sn.getInterfaces();
-            for (ClassNode iface : interfaces) {
-                if (!cnInterfaces.contains(iface)) {
-                    allInterfaceMethods.putAll(iface.getDeclaredMethodsMap());
-                }
-            }
-            sn = sn.getSuperClass();
-        }
+    @Deprecated
+    public static void addDeclaredMethodMapsFromSuperInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
+        org.apache.groovy.ast.tools.ClassNodeUtils.addDeclaredMethodsFromAllInterfaces(cNode, methodsMap);
     }
 
-    /**
-     * Returns true if the given method has a possibly matching static method with the given name and arguments.
-     *
-     * @param cNode     the ClassNode of interest
-     * @param name      the name of the method of interest
-     * @param arguments the arguments to match against
-     * @param trySpread whether to try to account for SpreadExpressions within the arguments
-     * @return true if a matching method was found
-     */
+    @Deprecated
     public static boolean hasPossibleStaticMethod(ClassNode cNode, String name, Expression arguments, boolean trySpread) {
-        int count = 0;
-        boolean foundSpread = false;
-
-        if (arguments instanceof TupleExpression) {
-            TupleExpression tuple = (TupleExpression) arguments;
-            for (Expression arg : tuple.getExpressions()) {
-                if (arg instanceof SpreadExpression) {
-                    foundSpread = true;
-                } else {
-                    count++;
-                }
-            }
-        } else if (arguments instanceof MapExpression) {
-            count = 1;
-        }
-
-        for (MethodNode method : cNode.getMethods(name)) {
-            if (method.isStatic()) {
-                Parameter[] parameters = method.getParameters();
-                // do fuzzy match for spread case: count will be number of non-spread args
-                if (trySpread && foundSpread && parameters.length >= count) return true;
-
-                if (parameters.length == count) return true;
-
-                // handle varargs case
-                if (parameters.length > 0 && parameters[parameters.length - 1].getType().isArray()) {
-                    if (count >= parameters.length - 1) return true;
-                    // fuzzy match any spread to a varargs
-                    if (trySpread && foundSpread) return true;
-                }
-
-                // handle parameters with default values
-                int nonDefaultParameters = 0;
-                for (Parameter parameter : parameters) {
-                    if (!parameter.hasInitialExpression()) {
-                        nonDefaultParameters++;
-                    }
-                }
-
-                if (count < parameters.length && nonDefaultParameters <= count) {
-                    return true;
-                }
-                // TODO handle spread with nonDefaultParams?
-            }
-        }
-        return false;
+        return org.apache.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticMethod(cNode, name, arguments, trySpread);
     }
 
-    /**
-     * Return true if we have a static accessor
-     */
-    public static boolean hasPossibleStaticProperty(ClassNode candidate, String methodName) {
-        // assume explicit static method call checked first so we can assume a simple check here
-        if (!methodName.startsWith("get") && !methodName.startsWith("is")) {
-            return false;
-        }
-        String propName = getPropNameForAccessor(methodName);
-        PropertyNode pNode = getStaticProperty(candidate, propName);
-        return pNode != null && (methodName.startsWith("get") || boolean_TYPE.equals(pNode.getType()));
+    @Deprecated
+    public static boolean hasPossibleStaticProperty(ClassNode cNode, String methodName) {
+        return org.apache.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticProperty(cNode, methodName);
     }
 
-    /**
-     * Returns the property name, e.g. age, given an accessor name, e.g. getAge.
-     * Returns the original if a valid prefix cannot be removed.
-     *
-     * @param accessorName the accessor name of interest, e.g. getAge
-     * @return the property name, e.g. age, or original if not a valid property accessor name
-     */
+    @Deprecated
     public static String getPropNameForAccessor(String accessorName) {
-        if (!isValidAccessorName(accessorName)) return accessorName;
-        int prefixLength = accessorName.startsWith("is") ? 2 : 3;
-        return String.valueOf(accessorName.charAt(prefixLength)).toLowerCase() + accessorName.substring(prefixLength + 1);
+        return org.apache.groovy.ast.tools.ClassNodeUtils.getPropNameForAccessor(accessorName);
     }
 
-    /**
-     * Detect whether the given accessor name starts with "get", "set" or "is" followed by at least one character.
-     *
-     * @param accessorName the accessor name of interest, e.g. getAge
-     * @return true if a valid prefix is found
-     */
+    @Deprecated
     public static boolean isValidAccessorName(String accessorName) {
-        if (accessorName.startsWith("get") || accessorName.startsWith("is") || accessorName.startsWith("set")) {
-            int prefixLength = accessorName.startsWith("is") ? 2 : 3;
-            return accessorName.length() > prefixLength;
-        };
-        return false;
+        return org.apache.groovy.ast.tools.ClassNodeUtils.isValidAccessorName(accessorName);
     }
 
+    @Deprecated
     public static boolean hasStaticProperty(ClassNode cNode, String propName) {
-        return getStaticProperty(cNode, propName) != null;
+        return org.apache.groovy.ast.tools.ClassNodeUtils.hasStaticProperty(cNode, propName);
     }
 
-    /**
-     * Detect whether a static property with the given name is within the class
-     * or a super class.
-     *
-     * @param cNode the ClassNode of interest
-     * @param propName the property name
-     * @return the static property if found or else null
-     */
+    @Deprecated
     public static PropertyNode getStaticProperty(ClassNode cNode, String propName) {
-        ClassNode classNode = cNode;
-        while (classNode != null) {
-            for (PropertyNode pn : classNode.getProperties()) {
-                if (pn.getName().equals(propName) && pn.isStatic()) return pn;
-            }
-            classNode = classNode.getSuperClass();
-        }
-        return null;
+        return org.apache.groovy.ast.tools.ClassNodeUtils.getStaticProperty(cNode, propName);
     }
 
-    /**
-     * Detect whether a given ClassNode is a inner class (non-static).
-     *
-     * @param currentClass the ClassNode of interest
-     * @return true if the given node is a (non-static) inner class, else false
-     */
-    public static boolean isInnerClass(ClassNode currentClass) {
-        return currentClass.redirect().getOuterClass() != null
-                && !Modifier.isStatic(currentClass.getModifiers());
+    @Deprecated
+    public static boolean isInnerClass(ClassNode cNode) {
+        return org.apache.groovy.ast.tools.ClassNodeUtils.isInnerClass(cNode);
     }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/4f2dd616/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java b/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
index 05f421f..be7c930 100644
--- a/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
+++ b/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
@@ -23,6 +23,7 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.groovy.ast.tools.ClassNodeUtils;
 import org.codehaus.groovy.ast.*;
 import org.codehaus.groovy.ast.expr.BinaryExpression;
 import org.codehaus.groovy.ast.expr.ConstantExpression;
@@ -35,7 +36,6 @@ import org.codehaus.groovy.ast.expr.PropertyExpression;
 import org.codehaus.groovy.ast.expr.TupleExpression;
 import org.codehaus.groovy.ast.expr.VariableExpression;
 import org.codehaus.groovy.ast.stmt.CatchStatement;
-import org.codehaus.groovy.ast.tools.ClassNodeUtils;
 import org.codehaus.groovy.ast.tools.GeneralUtils;
 import org.codehaus.groovy.control.SourceUnit;
 import org.codehaus.groovy.runtime.MetaClassHelper;
@@ -104,7 +104,7 @@ public class ClassCompletionVerifier extends ClassCodeVisitorSupport {
             result = new HashMap<String, MethodNode>();
         }
         // add in unimplemented abstract methods from the interfaces
-        ClassNodeUtils.addInterfaceMethods(node, result);
+        ClassNodeUtils.addDeclaredMethodsFromInterfaces(node, result);
         for (MethodNode methodNode : node.getMethods()) {
             MethodNode mn = result.get(methodNode.getTypeDescriptor());
             if (mn != null && (mn.isStatic() ^ methodNode.isStatic()) && !methodNode.isStaticConstructor()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/4f2dd616/src/main/org/codehaus/groovy/classgen/Verifier.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/Verifier.java b/src/main/org/codehaus/groovy/classgen/Verifier.java
index da26a1b..77a910b 100644
--- a/src/main/org/codehaus/groovy/classgen/Verifier.java
+++ b/src/main/org/codehaus/groovy/classgen/Verifier.java
@@ -22,6 +22,7 @@ import groovy.lang.GroovyClassLoader;
 import groovy.lang.GroovyObject;
 import groovy.lang.MetaClass;
 import groovy.transform.Generated;
+import org.apache.groovy.ast.tools.ClassNodeUtils;
 import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.ast.*;
 import org.codehaus.groovy.ast.expr.ArgumentListExpression;
@@ -39,7 +40,6 @@ import org.codehaus.groovy.ast.stmt.BlockStatement;
 import org.codehaus.groovy.ast.stmt.ExpressionStatement;
 import org.codehaus.groovy.ast.stmt.ReturnStatement;
 import org.codehaus.groovy.ast.stmt.Statement;
-import org.codehaus.groovy.ast.tools.ClassNodeUtils;
 import org.codehaus.groovy.ast.tools.GenericsUtils;
 import org.codehaus.groovy.ast.tools.PropertyNodeUtils;
 import org.codehaus.groovy.classgen.asm.BytecodeHelper;
@@ -1201,9 +1201,9 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
         Map genericsSpec = new HashMap();
 
         // unimplemented abstract methods from interfaces
-        Map<String, MethodNode> abstractMethods = ClassNodeUtils.getDeclaredMethodMapsFromInterfaces(classNode);
+        Map<String, MethodNode> abstractMethods = ClassNodeUtils.getDeclaredMethodsFromInterfaces(classNode);
         Map<String, MethodNode> allInterfaceMethods = new HashMap<String, MethodNode>(abstractMethods);
-        ClassNodeUtils.addDeclaredMethodMapsFromSuperInterfaces(classNode, allInterfaceMethods);
+        ClassNodeUtils.addDeclaredMethodsFromAllInterfaces(classNode, allInterfaceMethods);
 
         List<MethodNode> declaredMethods = new ArrayList<MethodNode>(classNode.getMethods());
         // remove all static, private and package private methods

http://git-wip-us.apache.org/repos/asf/groovy/blob/4f2dd616/src/main/org/codehaus/groovy/control/StaticImportVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/StaticImportVisitor.java b/src/main/org/codehaus/groovy/control/StaticImportVisitor.java
index d4a2566..199b4ad 100644
--- a/src/main/org/codehaus/groovy/control/StaticImportVisitor.java
+++ b/src/main/org/codehaus/groovy/control/StaticImportVisitor.java
@@ -54,12 +54,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import static org.codehaus.groovy.ast.tools.ClassNodeUtils.getPropNameForAccessor;
-import static org.codehaus.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticMethod;
-import static org.codehaus.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticProperty;
-import static org.codehaus.groovy.ast.tools.ClassNodeUtils.hasStaticProperty;
-import static org.codehaus.groovy.ast.tools.ClassNodeUtils.isInnerClass;
-import static org.codehaus.groovy.ast.tools.ClassNodeUtils.isValidAccessorName;
+import static org.apache.groovy.ast.tools.ClassNodeUtils.getPropNameForAccessor;
+import static org.apache.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticMethod;
+import static org.apache.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticProperty;
+import static org.apache.groovy.ast.tools.ClassNodeUtils.hasStaticProperty;
+import static org.apache.groovy.ast.tools.ClassNodeUtils.isInnerClass;
+import static org.apache.groovy.ast.tools.ClassNodeUtils.isValidAccessorName;
 import static org.codehaus.groovy.runtime.MetaClassHelper.capitalize;
 
 /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/4f2dd616/src/main/org/codehaus/groovy/control/StaticVerifier.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/StaticVerifier.java b/src/main/org/codehaus/groovy/control/StaticVerifier.java
index a1e6c1e..53706f9 100644
--- a/src/main/org/codehaus/groovy/control/StaticVerifier.java
+++ b/src/main/org/codehaus/groovy/control/StaticVerifier.java
@@ -39,7 +39,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import static org.codehaus.groovy.ast.tools.ClassNodeUtils.isInnerClass;
+import static org.apache.groovy.ast.tools.ClassNodeUtils.isInnerClass;
 
 /**
  * Verifier to check non-static access in static contexts