IDEA-184554 IncorrectOperationException from WrapWithAdapterMethodCallFix

Reproducible only if 'Good code is red' inspection from DevKit is switched on
This commit is contained in:
Tagir Valeev
2018-01-08 18:55:40 +07:00
parent 81cad6fdb3
commit b3a708b86e
@@ -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)");