void (@NotNull GrMethod method, @NotNull PsiClass clazz) { Set<MethodSignature> duplicatedSignatures = GrClassImplUtil.getDuplicatedSignatures(clazz); if (duplicatedSignatures.isEmpty()) return; // optimization PsiSubstitutor substitutor = JavaPsiFacade.getElementFactory(method.getProject()).createRawSubstitutor(method); MethodSignature signature = method.getSignature(substitutor); if (!duplicatedSignatures.contains(signature)) return; String signaturePresentation = GroovyPresentationUtil.getSignaturePresentation(signature); GrMethod original = method instanceof GrReflectedMethod ? ((GrReflectedMethod)method).getBaseMethod() : method; myHolder.newAnnotation(HighlightSeverity.ERROR, GroovyBundle.message("method.duplicate", signaturePresentation, clazz.getName())).range(GrHighlightUtil.getMethodHeaderTextRange(original)).create(); }