CommitChange (@NotNull Change change) { FilePath beforePath = getBeforePath(change); FilePath afterPath = getAfterPath(change); ContentRevision bRev = change.getBeforeRevision(); ContentRevision aRev = change.getAfterRevision(); VcsRevisionNumber beforeRevision = bRev != null ? bRev.getRevisionNumber() : null; VcsRevisionNumber afterRevision = aRev != null ? aRev.getRevisionNumber() : null; List<String> changelistIds = change instanceof ChangeListChange changeListChange ? singletonList(changeListChange.getChangeListId()) : null; VirtualFile virtualFile = aRev instanceof CurrentContentRevision currentRevision ? currentRevision.getVirtualFile() : null; return new CommitChange(beforePath, afterPath, beforeRevision, afterRevision, changelistIds, virtualFile); }