void (@NotNull PsiParameter parameter) { super.visitParameter(parameter); if (!myClass.isEquivalentTo(PsiUtil.resolveClassInType(parameter.getType()))) return; for (PsiReference psiReference : ReferencesSearch.search(parameter)) { final PsiElement refElement = psiReference.getElement(); if (refElement instanceof PsiExpression) { final PsiReferenceExpression referenceExpression = PsiTreeUtil.getParentOfType(refElement, PsiReferenceExpression.class); if (referenceExpression != null && referenceExpression.getQualifierExpression() == refElement) { final PsiElement resolvedMember = referenceExpression.resolve(); if (resolvedMember != null && PsiTreeUtil.isAncestor(myClass, resolvedMember, false)) { if (resolvedMember instanceof PsiMethod) { if (myClass.findMethodsBySignature((PsiMethod)resolvedMember, true).length > 1) { //skip inherited methods continue; } } result.putValue(refElement, JavaRefactoringBundle.message("inline.to.anonymous.no.method.calls")); } } } } }