ConstructorDescriptor (@NotNull PsiNewExpression expression) { PsiMethod constructor = expression.resolveConstructor(); if (constructor != null) { PsiClass containingClass = constructor.getContainingClass(); if (containingClass != null && !PsiReflectionAccessUtil.isPublicMember(constructor)) { return new ConstructorDescriptor(expression, constructor, containingClass); } } else { PsiJavaCodeReferenceElement classReference = expression.getClassReference(); PsiElement referent = classReference != null ? classReference.resolve() : null; if (referent instanceof PsiClass && !PsiReflectionAccessUtil.isAccessible((PsiClass)referent)) { return new ConstructorDescriptor(expression, null, (PsiClass)referent); } } return null; }