summaryrefslogtreecommitdiff
path: root/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/StaticImportMethodFix.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/StaticImportMethodFix.java')
-rw-r--r--java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/StaticImportMethodFix.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/StaticImportMethodFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/StaticImportMethodFix.java
index 60282d1be91b..b9f69e3c84e7 100644
--- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/StaticImportMethodFix.java
+++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/StaticImportMethodFix.java
@@ -186,7 +186,8 @@ public class StaticImportMethodFix implements IntentionAction {
.inferTypeArguments(method.getTypeParameters(), method.getParameterList().getParameters(), argumentList.getExpressions(),
PsiSubstitutor.EMPTY, element.getParent(), DefaultParameterTypeInferencePolicy.INSTANCE);
if (PsiUtil.isApplicable(method, substitutorForMethod, argumentList)) {
- if (expectedType == null || TypeConversionUtil.isAssignable(expectedType, substitutorForMethod.substitute(method.getReturnType()))) {
+ final PsiType returnType = substitutorForMethod.substitute(method.getReturnType());
+ if (expectedType == null || returnType == null || TypeConversionUtil.isAssignable(expectedType, returnType)) {
applicableList.add(method);
}
}