String (PsiClass parentClass, @NotNull PsiClass targetClass) { if (parentClass != null && (parentClass.equals(targetClass) || PsiTreeUtil.isAncestor(targetClass, parentClass, true))) { return PsiModifier.PRIVATE; } else { return JavaCodeStyleSettings.getInstance(targetClass.getContainingFile()).VISIBILITY; } }