From 31dc44c005372fc96711361425a32585ecd11540 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 30 Jun 2017 17:14:45 +0300 Subject: [PATCH] fixed CME (values() returned ArrayList which is fail-fast) --- .../openapi/vfs/ex/dummy/DummyCachingFileSystem.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java b/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java index 3b5c4e60c296..33de7529e278 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java @@ -32,6 +32,7 @@ import org.jetbrains.annotations.Nullable; import java.io.IOException; import java.util.Collection; +import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentMap; import java.util.stream.Collectors; @@ -161,10 +162,10 @@ public abstract class DummyCachingFileSystem extends Dumm } protected void clearInvalidFiles() { - Collection values = myCachedFiles.values(); - for (T t : values) { + for (Map.Entry entry : myCachedFiles.entrySet()) { + T t = entry.getValue(); if (t == null || !t.isValid()) { - values.remove(t); + myCachedFiles.remove(entry.getKey()); } } }