ThroughRenameInfo (@NotNull final FilePath file, @Nullable final File firstTo) { final String path = FilePathsHelper.convertPath(file); if (myAlsoReverted.contains(path)) return null; final NavigableMap<String, File> head = myRenames.headMap(path, true); if (head == null || head.isEmpty()) return null; for (Map.Entry<String, File> entry : head.descendingMap().entrySet()) { if (path.equals(entry.getKey())) return null; if (path.startsWith(entry.getKey())) { final String convertedBase = FileUtil.toSystemIndependentName(entry.getKey()); final String convertedChild = FileUtil.toSystemIndependentName(file.getPath()); final String relativePath = FileUtil.getRelativePath(convertedBase, convertedChild, '/'); assert relativePath != null; return new ThroughRenameInfo(entry.getValue(), new File(entry.getValue(), relativePath), firstTo, file.getIOFile(), firstTo != null); } } return null; }