From 777e950dfa2e613f9495a8975c5f89bf7e51f8d4 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 19 Jul 2012 15:54:37 +0200 Subject: [PATCH] EA-37559 - NPE: HighlightMethodUtil.checkConstructorCall --- .../impl/analysis/HighlightMethodUtil.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) 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;