diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java index 294c0e80c711..9bda079a5260 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java @@ -1280,19 +1280,21 @@ public class HighlightMethodUtil { String toolTip = createMismatchedArgumentsHtmlTooltip(result, list); PsiElement infoElement = list.getTextLength() > 0 ? list : constructorCall; HighlightInfo info = HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, infoElement, description, toolTip); - QuickFixAction.registerQuickFixAction(info, constructorCall.getTextRange(), new CreateConstructorFromCallFix(constructorCall)); - if (classReference != null) { - ConstructorParametersFixer.registerFixActions(classReference, constructorCall, info, getFixRange(infoElement)); - ChangeMethodSignatureFromUsageFix.registerIntentions(results, list, info, null); - ChangeTypeArgumentsFix.registerIntentions(results, list, info, aClass); - ConvertDoubleToFloatFix.registerIntentions(results, list, info, null); - PermuteArgumentsFix.registerFix(info, constructorCall, toMethodCandidates(results), getFixRange(list)); - ChangeParameterClassFix.registerQuickFixActions(constructorCall, list, info); - QuickFixAction.registerQuickFixAction(info, getFixRange(list), new SurroundWithArrayFix(constructorCall)); + if (info != null) { + QuickFixAction.registerQuickFixAction(info, constructorCall.getTextRange(), new CreateConstructorFromCallFix(constructorCall)); + if (classReference != null) { + ConstructorParametersFixer.registerFixActions(classReference, constructorCall, info, getFixRange(infoElement)); + ChangeMethodSignatureFromUsageFix.registerIntentions(results, list, info, null); + ChangeTypeArgumentsFix.registerIntentions(results, list, info, aClass); + ConvertDoubleToFloatFix.registerIntentions(results, list, info, null); + PermuteArgumentsFix.registerFix(info, constructorCall, toMethodCandidates(results), getFixRange(list)); + ChangeParameterClassFix.registerQuickFixActions(constructorCall, list, info); + QuickFixAction.registerQuickFixAction(info, getFixRange(list), new SurroundWithArrayFix(constructorCall)); + } + info.navigationShift = +1; + holder.add(info); + ChangeStringLiteralToCharInMethodCallFix.registerFixes(constructors, constructorCall, info); } - info.navigationShift = +1; - holder.add(info); - ChangeStringLiteralToCharInMethodCallFix.registerFixes(constructors, constructorCall, info); } else { HighlightInfo highlightInfo;