void (@NotNull PsiNewExpression expression) { super.visitNewExpression(expression); final PsiJavaCodeReferenceElement reference = expression.getClassOrAnonymousClassReference(); if (reference != null && reference.resolve() instanceof PsiClass refClass) { final String classUnavailableMessage = JavaRefactoringBundle.message("inline.parameter.depends.on.unavailable.element.inside.method", RefactoringUIUtil.getDescription(refClass, true)); if (!PsiUtil.isAccessible(refClass, myMethod, null)) { myConflicts.putValue(expression, classUnavailableMessage); } else { final PsiClass methodContainingClass = myMethod.getContainingClass(); LOG.assertTrue(methodContainingClass != null); if (!PsiTreeUtil.isAncestor(myMethod, refClass, false)) { PsiElement parent = refClass; while ((parent = parent.getParent()) instanceof PsiClass) { if (!PsiUtil.isAccessible((PsiClass)parent, myMethod, null)) { break; } } if (!(parent instanceof PsiFile)) { myConflicts.putValue(expression, classUnavailableMessage); } } } } }