void (final @NotNull PsiAnonymousClass aClass) { super.visitAnonymousClass(aClass); PsiExpressionList argumentList = aClass.getArgumentList(); if (AnonymousCanBeLambdaInspection.isLambdaForm(aClass, Collections.emptySet()) && argumentList != null && argumentList.isEmpty()) { PsiMethod method = aClass.getMethods()[0]; PsiClassType type = aClass.getBaseClassType(); AnonymousLambdaAlternative alternative = getAlternative(type.resolve(), method); if(alternative != null) { final PsiElement lBrace = aClass.getLBrace(); LOG.assertTrue(lBrace != null); final TextRange rangeInElement = new TextRange(0, lBrace.getStartOffsetInParent() + aClass.getStartOffsetInParent() - 1); holder.registerProblem(aClass.getParent(), rangeInElement, JavaAnalysisBundle.message("anonymous.ref.loc.can.be.replaced.with.0", alternative.myReplacementMessage), new ReplaceWithLambdaAlternativeFix(alternative)); } } }