From 9c69111454c7bd2dd24dceeb22b3113290c3ef23 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 21 Apr 2014 16:27:53 +0400 Subject: [PATCH] [vcs] Reuse the VirtualFile instead of creating FilePathImpl on File Relates to IDEA-119996 --- .../com/intellij/openapi/vcs/changes/ui/TreeModelBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/TreeModelBuilder.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/TreeModelBuilder.java index ba022cbc282c..48a17aeaa31a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/TreeModelBuilder.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/TreeModelBuilder.java @@ -504,7 +504,8 @@ public class TreeModelBuilder { ChangesBrowserNode parentNode = myFoldersCache.get(parentPath.getKey()); if (parentNode == null) { - parentNode = ChangesBrowserNode.create(myProject, new FilePathImpl(new File(parentPath.getPath()), true)); + FilePathImpl filePath = parentPath.getVf() == null ? new FilePathImpl(new File(parentPath.getPath()), true) : new FilePathImpl(parentPath.getVf()); + parentNode = ChangesBrowserNode.create(myProject, filePath); ChangesBrowserNode grandPa = getParentNodeFor(parentPath, policy, rootNode); model.insertNodeInto(parentNode, grandPa, grandPa.getChildCount()); myFoldersCache.put(parentPath.getKey(), parentNode);