boolean (@Nullable PsiType qualifierType, @NotNull Object object, boolean checkBases) { if (!(object instanceof PsiMember)) return false; if (qualifierType instanceof PsiArrayType) { //length and clone() PsiFile file = ((PsiMember)object).getContainingFile(); //yes, they're a bit dummy return file == null || file.getVirtualFile() == null; } else if (qualifierType instanceof PsiClassType) { PsiClass qualifierClass = ((PsiClassType)qualifierType).resolve(); if (qualifierClass == null) return false; if (object instanceof PsiMethod && qualifierClass.findMethodBySignature((PsiMethod)object, checkBases) != null) { return true; } PsiClass memberClass = ((PsiMember)object).getContainingClass(); return checkBases ? InheritanceUtil.isInheritorOrSelf(qualifierClass, memberClass, true) : qualifierClass.equals(memberClass); } return false; }