Github user jwagenleitner commented on a diff in the pull request: https://github.com/apache/groovy/pull/422#discussion_r79297788 --- Diff: src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java --- @@ -1116,39 +1117,23 @@ private static ClassNode makeRawType(final ClassNode receiver) { for (int j=i+1;j<list.size();j++) { MethodNode two = list.get(j); if (toBeRemoved.contains(two)) continue; - if (one.getName().equals(two.getName()) && one.getDeclaringClass()==two.getDeclaringClass()) { - Parameter[] onePars = one.getParameters(); - Parameter[] twoPars = two.getParameters(); - if (onePars.length == twoPars.length) { - boolean sameTypes = true; - for (int k = 0; k < onePars.length; k++) { - Parameter onePar = onePars[k]; - Parameter twoPar = twoPars[k]; - if (!onePar.getType().equals(twoPar.getType())) { - sameTypes = false; - break; - } - } - if (sameTypes) { - 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); - } + Parameter[] onePars = one.getParameters(); + Parameter[] twoPars = two.getParameters(); + if (onePars.length == twoPars.length) { + if (areOverloadMethodsInSameClass(one,two)) { + if (ParameterUtils.parametersEqual(onePars, twoPars)){ --- End diff -- If the `Parameter[]` parameters are removed from `areEquivalentInterfaceMethods` method I think these arguments can be replaced with `one.getParameters(), two.getParameters()` and then the local variables wouldn't be needed. Just a suggestion.
--- 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. ---