CandidateInfo[] (PsiExpressionList argList) { final PsiCall call = getCall(argList); PsiResolveHelper helper = JavaPsiFacade.getInstance(argList.getProject()).getResolveHelper(); if (call instanceof PsiCallExpression) { CandidateInfo[] candidates = getCandidates((PsiCallExpression)call); ArrayList<CandidateInfo> result = new ArrayList<>(); if (!(argList.getParent() instanceof PsiAnonymousClass)) { cand: for (CandidateInfo candidate : candidates) { PsiMethod methodCandidate = (PsiMethod)candidate.getElement(); for (CandidateInfo info : result) { if (MethodSignatureUtil.isSuperMethod(methodCandidate, (PsiMethod)info.getElement())) { continue cand; } } if (candidate.isStaticsScopeCorrect()) { boolean accessible = candidate.isAccessible(); if (!accessible && methodCandidate.getModifierList().hasModifierProperty(PsiModifier.PRIVATE)) { // privates are accessible within one file accessible = JavaPsiFacade.getInstance(methodCandidate.getProject()).getResolveHelper() .isAccessible(methodCandidate, methodCandidate.getModifierList(), call, null, null); } if (accessible) result.add(candidate); } } } else { PsiClass aClass = (PsiClass)argList.getParent(); for (CandidateInfo candidate : candidates) { if (candidate.isStaticsScopeCorrect() && helper.isAccessible((PsiMethod)candidate.getElement(), argList, aClass)) { result.add(candidate); } } } return result.isEmpty() ? candidates : result.toArray(CandidateInfo.EMPTY_ARRAY); } else { assert call instanceof PsiEnumConstant; //We are inside our own enum, no isAccessible check needed PsiMethod[] constructors = ((PsiEnumConstant)call).getContainingClass().getConstructors(); CandidateInfo[] result = new CandidateInfo[constructors.length]; for (int i = 0; i < constructors.length; i++) { result[i] = new CandidateInfo(constructors[i], PsiSubstitutor.EMPTY); } return result; } }