InferenceVariable[] (PsiTypeParameter[] typeParameters, PsiType[] parameters) { if (Registry.is("javac.fresh.variables.for.captured.wildcards.only")) { final List<PsiTypeParameter> capturedParams = new ArrayList<>(); PsiSubstitutor restParamSubstitution = PsiSubstitutor.EMPTY; for (int i = 0; i < parameters.length; i++) { PsiType parameter = parameters[i]; if (parameter instanceof PsiCapturedWildcardType) { capturedParams.add(typeParameters[i]); } else { restParamSubstitution = restParamSubstitution.put(typeParameters[i], parameter); } } InferenceVariable[] variables = initBounds(null, restParamSubstitution, capturedParams.toArray(PsiTypeParameter.EMPTY_ARRAY)); int idx = 0; for (PsiType parameter : parameters) { if (parameter instanceof PsiCapturedWildcardType) { InferenceVariable variable = variables[idx++]; if (isProperType(((PsiCapturedWildcardType)parameter).getWildcard())) { variable.putUserData(ORIGINAL_CAPTURE, (PsiCapturedWildcardType)parameter); } } } return variables; } return initBounds(null, typeParameters); }