diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java index c860a774735b..876a13eb631f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java @@ -865,18 +865,17 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone int startIndex = 0; List applyEvents = new ArrayList<>(events.size()); - List validated = new ArrayList<>(events.size()); Set files = new THashSet<>(events.size()); Set middleDirs = new THashSet<>(events.size()); while (startIndex != events.size()) { applyEvents.clear(); - validated.clear(); + List validated = new ArrayList<>(events.size() - startIndex); files.clear(); middleDirs.clear(); startIndex = groupAndValidate(events, startIndex, applyEvents, validated, files, middleDirs); if (!validated.isEmpty()) { - List toSend = Collections.unmodifiableList(new ArrayList<>(validated)); + List toSend = Collections.unmodifiableList(validated); myPublisher.before(toSend); applyEvents.forEach(Runnable::run);