int (@NotNull List<? extends Change> changes, @NotNull FilePath filePath) { int idx = -1; for (int i = 0; i < changes.size(); i++) { final Change change = changes.get(i); if ((change.getAfterRevision() != null) && (change.getAfterRevision().getFile().equals(filePath))) { idx = i; break; } } if (idx >= 0) return idx; idx = 0; // try to use name only final String name = filePath.getName(); for (int i = 0; i < changes.size(); i++) { final Change change = changes.get(i); if ((change.getAfterRevision() != null) && (change.getAfterRevision().getFile().getName().equals(name))) { idx = i; break; } } return idx; }