void (@NotNull PsiNewExpression expression) { if (!referencesStaticallyAccessible) { return; } super.visitNewExpression(expression); final PsiJavaCodeReferenceElement classReference = expression.getClassOrAnonymousClassReference(); if (classReference == null) { return; } final PsiElement target = classReference.resolve(); if (!(target instanceof PsiClass)) { return; } if (!isClassStaticallyAccessible((PsiClass)target)) { referencesStaticallyAccessible = false; } }