From 3e401e1a9572980eeab43d95bcb4654bd0591bf8 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Mon, 18 Mar 2019 15:45:22 +0700 Subject: [PATCH] CommonDataflow#getExpressionRange contract --- .../com/intellij/codeInspection/dataFlow/CommonDataflow.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/CommonDataflow.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/CommonDataflow.java index 39fc2609dbb2..9ea2a9672710 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/CommonDataflow.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/CommonDataflow.java @@ -297,8 +297,10 @@ public class CommonDataflow { * @param expression expression to get its range * @return long range set */ + @Contract("null -> null") @Nullable public static LongRangeSet getExpressionRange(@Nullable PsiExpression expression) { + if (expression == null) return null; Object value = ExpressionUtils.computeConstantExpression(expression); LongRangeSet rangeSet = LongRangeSet.fromConstant(value); if (rangeSet != null) return rangeSet;