From c5a46ab4acd2bdd1a5ea74bd57a7f14bd10273b6 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 9 Apr 2019 12:23:41 +0200 Subject: [PATCH] NullableStuffInspectionBase: cheaper scope calculation --- .../codeInspection/nullable/NullableStuffInspectionBase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java index 9fbf41fb76f4..3f6df81e0d14 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java @@ -296,8 +296,9 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection @NotNull Set> visited) { if (!visited.add(Couple.of(expectedType, assignedType))) return false; - if (isNullityConflict(JavaGenericsUtil.getCollectionItemType(expectedType, place.getResolveScope()), - JavaGenericsUtil.getCollectionItemType(assignedType, place.getResolveScope()))) { + GlobalSearchScope scope = holder.getFile().getResolveScope(); + if (isNullityConflict(JavaGenericsUtil.getCollectionItemType(expectedType, scope), + JavaGenericsUtil.getCollectionItemType(assignedType, scope))) { return true; }