text: public int compareTo(IndexCommit commit) {if (getDirectory() != commit.getDirectory()) {throw new UnsupportedOperationException("cannot compare IndexCommits from different Directory instances");}long gen = getGeneration();long comgen = commit.getGeneration();return Long.compare(gen, comgen);}