void (@NotNull PsiNewExpression expression) { super.visitNewExpression(expression); if (expression.getType() instanceof PsiArrayType) { return; } final PsiMethod constructor = expression.resolveMethod(); final PsiClass aClass; if (constructor == null) { final PsiJavaCodeReferenceElement classReference = expression.getClassOrAnonymousClassReference(); if (classReference == null) { return; } final PsiElement target = classReference.resolve(); if (!(target instanceof PsiClass)) { return; } aClass = (PsiClass)target; if (aClass.isInterface() || !aClass.hasModifierProperty(PsiModifier.PRIVATE)) { return; } } else { if (!constructor.hasModifierProperty(PsiModifier.PRIVATE)) { return; } aClass = constructor.getContainingClass(); } if (!isInnerClassAccess(expression, aClass)) { return; } registerNewExpressionError(expression, aClass); }