void (PsiMethod method, PsiElement toHighlight, AnnotationHolder holder) { final HierarchicalMethodSignature signature = method.getHierarchicalMethodSignature(); final List<HierarchicalMethodSignature> superSignatures = signature.getSuperSignatures(); PsiType returnType = signature.getSubstitutor().substitute(method.getReturnType()); for (HierarchicalMethodSignature superMethodSignature : superSignatures) { PsiMethod superMethod = superMethodSignature.getMethod(); PsiType declaredReturnType = superMethod.getReturnType(); PsiType superReturnType = superMethodSignature.getSubstitutor().substitute(declaredReturnType); if (PsiTypes.voidType().equals(superReturnType) && method instanceof GrMethod && ((GrMethod)method).getReturnTypeElementGroovy() == null) return; if (superMethodSignature.isRaw()) superReturnType = TypeConversionUtil.erasure(declaredReturnType); if (returnType == null || superReturnType == null || method == superMethod) continue; PsiClass superClass = superMethod.getContainingClass(); if (superClass == null) continue; String highlightInfo = checkSuperMethodSignature(superMethod, superMethodSignature, superReturnType, method, signature, returnType); if (highlightInfo != null) { holder.newAnnotation(HighlightSeverity.ERROR, highlightInfo).range(toHighlight).create(); return; } } }