From 06994471b51c92e8701b6a9053471344bcdf8e2d Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Thu, 13 Oct 2016 20:43:43 +0300 Subject: [PATCH] [index] MapReduceIndex does not necessarily have inputs index Add some Nullable annotations, fix possible NPE. --- .../src/com/intellij/util/indexing/MapReduceIndex.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java index 81b13eef9bba..e61f70b4ffbb 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java @@ -72,7 +72,7 @@ public class MapReduceIndex implements UpdatableIndex myContents; private PersistentHashMap myInputsSnapshotMapping; - protected PersistentHashMap> myInputsIndex; + @Nullable protected PersistentHashMap> myInputsIndex; private PersistentHashMap myIndexingTrace; private final ReentrantReadWriteLock myLock = new ReentrantReadWriteLock(); @@ -305,7 +305,7 @@ public class MapReduceIndex implements UpdatableIndex inputsIndex) { + private static void doForce(@Nullable PersistentHashMap inputsIndex) { if (inputsIndex != null && inputsIndex.isDirty()) { inputsIndex.force(); } @@ -350,7 +350,7 @@ public class MapReduceIndex implements UpdatableIndex index) { + private static void doClose(@Nullable PersistentHashMap index) { if (index != null) { try { index.close(); @@ -703,7 +703,7 @@ public class MapReduceIndex implements UpdatableIndex newData) throws IOException {