void (@NotNull PsiClass psiClass, final String canonicalText, final Map<PsiTypeParameter, PsiType> substitutionMap) { final PsiClass containingClass = psiClass.getContainingClass(); if (containingClass != null) { final String outerClassRef = PsiNameHelper.getOuterClassReference(canonicalText); final String[] classParameters = PsiNameHelper.getClassParametersText(outerClassRef); final PsiType[] args = classParameters.length == 0 ? null : new ClsReferenceParameterListImpl(this, classParameters, TypeAnnotationContainer.EMPTY).getTypeArguments(); final PsiTypeParameter[] typeParameters = containingClass.getTypeParameters(); for (int i = 0; i < typeParameters.length; i++) { if (args != null) { if (i < args.length) { substitutionMap.put(typeParameters[i], args[i]); } } else { substitutionMap.put(typeParameters[i], null); } } if (!containingClass.hasModifierProperty(PsiModifier.STATIC)) { collectOuterClassTypeArgs(containingClass, outerClassRef, substitutionMap); } } }