From 8a511acde865f7caefc2b92cc7264f1869497791 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 25 Jun 2015 18:28:46 +0200 Subject: [PATCH] more diagnostics for VfsData.initFile exceptions (IDEA-141920) --- .../vfs/newvfs/persistent/PersistentFSImpl.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 2bc1fd8c148e..f79f148eff55 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 @@ -919,7 +919,18 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone VirtualFileSystemEntry root = myRoots.get(rootUrl); if (root != null) return root; - VfsData.initFile(rootId, segment, -1, directoryData); + try { + VfsData.initFile(rootId, segment, -1, directoryData); + } + catch (AssertionError e) { + for (Map.Entry entry : myRoots.entrySet()) { + final VirtualFileSystemEntry existingRoot = entry.getValue(); + if (Math.abs(existingRoot.getId()) == rootId) { + throw new RuntimeException("Duplicate FS roots: " + rootUrl + " and " + entry.getKey() + ", id=" + rootId + ", valid=" + existingRoot.isValid(), e); + } + } + throw new RuntimeException("No root duplication", e); + } incStructuralModificationCount(); mark = writeAttributesToRecord(rootId, 0, newRoot, fs, attributes);