int (@NotNull VirtualFile file1, @NotNull VirtualFile file2) { List<OrderEntry> entries1 = myProjectFileIndex.getOrderEntriesForFile(file1); List<OrderEntry> entries2 = myProjectFileIndex.getOrderEntriesForFile(file2); if (entries1.size() != entries2.size()) return 0; int res = 0; for (OrderEntry entry1 : entries1) { Module module = entry1.getOwnerModule(); ModuleFileIndex moduleFileIndex = ModuleRootManager.getInstance(module).getFileIndex(); OrderEntry entry2 = moduleFileIndex.getOrderEntryForFile(file2); if (entry2 == null) { return 0; } else { int aRes = entry2.compareTo(entry1); if (aRes == 0) return 0; if (res == 0) { res = aRes; } else if (res != aRes) { return 0; } } } return res; }