diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/WrapWithAdapterMethodCallFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/WrapWithAdapterMethodCallFix.java index 99e2f6ed6230..1cc0f9b3ea24 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/WrapWithAdapterMethodCallFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/WrapWithAdapterMethodCallFix.java @@ -61,7 +61,8 @@ public class WrapWithAdapterMethodCallFix extends LocalQuickFixAndIntentionActio !myOutTypeFilter.test(outType)) { return false; } - PsiType resultType = createReplacement(context, "((" + inType.getCanonicalText() + ")null)").getType(); + PsiType resultType = + createReplacement(context, "((" + GenericsUtil.getVariableTypeByExpressionType(inType).getCanonicalText() + ")null)").getType(); return resultType != null && outType.isAssignableFrom(resultType); }