From f6f5830850aef1cafaf95a3ba22cb310bb1a30a9 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Mon, 23 Dec 2019 17:25:55 +0300 Subject: [PATCH] fix compilation GitOrigin-RevId: f1a789b146a030746643238c481a54e93c3833bb --- .../com/intellij/psi/stubs/StubIndexImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java index 3cd61172d534..22cbcbe9fab5 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java @@ -52,7 +52,6 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.function.IntPredicate; -import java.util.stream.Collectors; @State(name = "FileBasedIndex", storages = { @Storage(value = StoragePathMacros.CACHE_FILE), @@ -197,13 +196,14 @@ public final class StubIndexImpl extends StubIndexEx implements PersistentStateC UpdatableIndex index = new VfsAwareMapReduceIndex<>(wrappedExtension, memStorage, null, null, null, lock); if (stubUpdatingIndex instanceof MergedInvertedIndex) { - List> providedIndexExtensions = ((MergedInvertedIndex)stubUpdatingIndex) - .getProvidedExtensions() - .filter(ex -> ex instanceof StubProvidedIndexExtension) - .map(ex -> ((StubProvidedIndexExtension)ex).findProvidedStubIndex(extension)) - .collect(Collectors.toList()); - if (!providedIndexExtensions.isEmpty()) { - index = ProvidedIndexExtension.wrapWithProvidedIndex(providedIndexExtensions, wrappedExtension, index, ((MergedInvertedIndex)stubUpdatingIndex).getHashIndex()); + ProvidedIndexExtension ex = + ((MergedInvertedIndex)stubUpdatingIndex).getProvidedExtension(); + if (ex instanceof StubProvidedIndexExtension) { + ProvidedIndexExtension providedStubIndexExtension = + ((StubProvidedIndexExtension)ex).findProvidedStubIndex(extension); + if (providedStubIndexExtension != null) { + index = ProvidedIndexExtension.wrapWithProvidedIndex(providedStubIndexExtension, wrappedExtension, index); + } } }