void (PsiType type, PsiElement place, PsiScopeProcessor processor) { if (type instanceof PsiArrayType) { LanguageLevel languageLevel = PsiUtil.getLanguageLevel(place); final PsiClass arrayClass = JavaPsiFacade.getElementFactory(place.getProject()).getArrayClass(languageLevel); final PsiTypeParameter[] arrayTypeParameters = arrayClass.getTypeParameters(); PsiSubstitutor substitutor = PsiSubstitutor.EMPTY; if (arrayTypeParameters.length > 0) { substitutor = substitutor.put(arrayTypeParameters[0], ((PsiArrayType)type).getComponentType()); } arrayClass.processDeclarations(processor, ResolveState.initial().put(PsiSubstitutor.KEY, substitutor), arrayClass, place); } else if (type instanceof PsiIntersectionType) { for (PsiType psiType : ((PsiIntersectionType)type).getConjuncts()) { processTypeDeclarations(psiType, place, processor); } } else if (type instanceof PsiDisjunctionType) { final PsiType lub = ((PsiDisjunctionType)type).getLeastUpperBound(); processTypeDeclarations(lub, place, processor); } else if (type instanceof PsiCapturedWildcardType) { final PsiType classType = convertToTypeParameter((PsiCapturedWildcardType)type, place); if (classType != null) { processTypeDeclarations(classType, place, processor); } } else { final JavaResolveResult result = PsiUtil.resolveGenericsClassInType(type); final PsiClass clazz = (PsiClass)result.getElement(); if (clazz != null) { clazz.processDeclarations(processor, ResolveState.initial().put(PsiSubstitutor.KEY, result.getSubstitutor()), clazz, place); } } }