From 05461bb7131fb4ef24f8d8e61df329f7329cab55 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 18 Jan 2016 13:28:23 +0100 Subject: [PATCH] IDEA-CR-7861 "make parameter result @notnull" --- .../highlighting/HighlightUsagesHandler.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandler.java index 3d9db0b9044e..f9fae6eb033b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandler.java @@ -418,17 +418,12 @@ public class HighlightUsagesHandler extends HighlightHandlerBase { * @deprecated Use {@link #collectRangesToHighlight} */ public static List getRangesToHighlight(@NotNull PsiReference ref) { - return collectRangesToHighlight(ref, null); + return collectRangesToHighlight(ref, new ArrayList()); } @NotNull - public static List collectRangesToHighlight(@NotNull PsiReference ref, @Nullable List result) { - final List relativeRanges = ReferenceRange.getRanges(ref); - if (result == null) { - result = new ArrayList(relativeRanges.size()); - } - - for (TextRange relativeRange : relativeRanges) { + public static List collectRangesToHighlight(@NotNull PsiReference ref, @NotNull List result) { + for (TextRange relativeRange : ReferenceRange.getRanges(ref)) { PsiElement element = ref.getElement(); TextRange range = safeCut(element.getTextRange(), relativeRange); // injection occurs