Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/422#discussion_r79234404
  
    --- Diff: 
src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java ---
    @@ -1157,6 +1141,56 @@ private static ClassNode makeRawType(final ClassNode 
receiver) {
             return result;
         }
     
    +    private static void removeMethodInSuperInterface(List<MethodNode> 
toBeRemoved, MethodNode one, MethodNode two) {
    +        ClassNode oneDC=one.getDeclaringClass();
    +        ClassNode twoDC=two.getDeclaringClass();
    +        if(oneDC.implementsInterface(twoDC)){
    +            toBeRemoved.add(two);
    +        }else{
    +            toBeRemoved.add(one);
    +        }
    +    }
    +
    +    private static boolean areEquivalentInterfaceMethods(MethodNode one, 
MethodNode two, Parameter[] onePars, Parameter[] twoPars) {
    +        return one.getName().equals(two.getName())
    +                && one.getDeclaringClass().isInterface()
    +                && two.getDeclaringClass().isInterface()
    +                && allParameterTypesAreSame(onePars, twoPars);
    +    }
    +
    +    private static void removeSyntheticMethodIfOne(List<MethodNode> 
toBeRemoved, MethodNode one, MethodNode two) {
    +        if (one.isSynthetic() && !two.isSynthetic()) {
    +            toBeRemoved.add(one);
    +        } else if (two.isSynthetic() && !one.isSynthetic()) {
    +            toBeRemoved.add(two);
    +        }
    +    }
    +
    +    private static void removeMethodWithSuperReturnType(List<MethodNode> 
toBeRemoved, MethodNode one, MethodNode two) {
    +        ClassNode oneRT = one.getReturnType();
    +        ClassNode twoRT = two.getReturnType();
    +        if (oneRT.isDerivedFrom(twoRT) || 
oneRT.implementsInterface(twoRT)) {
    +            toBeRemoved.add(two);
    +        } else if (twoRT.isDerivedFrom(oneRT) || 
twoRT.implementsInterface(oneRT)) {
    +            toBeRemoved.add(one);
    +        }
    +    }
    +
    +    private static boolean areOverloadMethodsInSameClass(MethodNode one, 
MethodNode two){
    +        return one.getName().equals(two.getName()) && 
one.getDeclaringClass()==two.getDeclaringClass();
    +    }
    +
    +    private static boolean allParameterTypesAreSame(Parameter[] onePars, 
Parameter[] twoPars) {
    --- End diff --
    
    Might be able to use 
[`ParameterUtils#parametersEqual(Parameter[],Parameter[])`] 
(https://github.com/apache/groovy/blob/14266ad5b7c265b55334c029e87b1d79ebd2210e/src/main/org/codehaus/groovy/ast/tools/ParameterUtils.java#L26-L38)
 instead of this new method.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to