From 4b206bd3796e6a3209f6bc7a14f64a1011eb11e0 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Fri, 18 Aug 2017 17:41:49 +0300 Subject: [PATCH] Don't cache the path of VFile move and rename events The path is different before() and after() the VFS change, so if cached it stays equal to the old path, not new. Follow-up to fcde9ad --- .../intellij/openapi/vfs/newvfs/events/VFileMoveEvent.java | 6 ++++++ .../openapi/vfs/newvfs/events/VFilePropertyChangeEvent.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/platform/core-api/src/com/intellij/openapi/vfs/newvfs/events/VFileMoveEvent.java b/platform/core-api/src/com/intellij/openapi/vfs/newvfs/events/VFileMoveEvent.java index 33e8e5a1eb53..d6ae762d1c9a 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/newvfs/events/VFileMoveEvent.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/newvfs/events/VFileMoveEvent.java @@ -57,6 +57,12 @@ public class VFileMoveEvent extends VFileEvent { return "VfsEvent[move " + myFile.getName() +" from " + myOldParent + " to " + myNewParent + "]"; } + @NotNull + @Override + public String getPath() { + return computePath(); + } + @NotNull @Override protected String computePath() { diff --git a/platform/core-api/src/com/intellij/openapi/vfs/newvfs/events/VFilePropertyChangeEvent.java b/platform/core-api/src/com/intellij/openapi/vfs/newvfs/events/VFilePropertyChangeEvent.java index 00d8af54ed78..0b3ab8b86e25 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/newvfs/events/VFilePropertyChangeEvent.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/newvfs/events/VFilePropertyChangeEvent.java @@ -99,6 +99,12 @@ public class VFilePropertyChangeEvent extends VFileEvent { return myPropertyName; } + @NotNull + @Override + public String getPath() { + return computePath(); + } + @NotNull @Override protected String computePath() {