mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
EA-37682 - NPE: ChangeTypeArgumentsFix.fun
This commit is contained in:
+5
-1
@@ -63,7 +63,8 @@ public class ChangeTypeArgumentsFix implements IntentionAction, HighPriorityActi
|
||||
return "Change type arguments to <" + StringUtil.join(myPsiClass.getTypeParameters(), new Function<PsiTypeParameter, String>() {
|
||||
@Override
|
||||
public String fun(PsiTypeParameter typeParameter) {
|
||||
return substitutor.substitute(typeParameter).getPresentableText();
|
||||
final PsiType substituted = substitutor.substitute(typeParameter);
|
||||
return substituted != null ? substituted.getPresentableText() : CommonClassNames.JAVA_LANG_OBJECT;
|
||||
}
|
||||
}, ", ") + ">";
|
||||
}
|
||||
@@ -94,6 +95,9 @@ public class ChangeTypeArgumentsFix implements IntentionAction, HighPriorityActi
|
||||
final PsiType actualType = myExpressions[i].getType();
|
||||
if (expectedType == null || actualType == null || !TypeConversionUtil.isAssignable(expectedType, actualType)) return false;
|
||||
}
|
||||
for (PsiTypeParameter parameter : typeParameters) {
|
||||
if (substitutor.substitute(parameter) == null) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user