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 4dc8f321ff34..3f3e41b42094 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 @@ -68,6 +68,8 @@ public class WrapWithAdapterMethodCallFix extends LocalQuickFixAndIntentionActio if (LambdaUtil.notInferredType(variableType)) return false; String typeText = variableType.getCanonicalText(); + // Empty text can be generated by PsiImmediateClassType if unresolved anonymous class is created like new X() {} + if (typeText.isEmpty()) return false; PsiExpression replacement; try { replacement = createReplacement(context, "((" + typeText + ")null)");