Patch against 3x:
- Changes listCommits() signature to return a List<IndexCommit>
- DirReader.listCommits() sorts the list in the end.
- Added a test case to TestIndexReader.
- IndexCommit implements Comparable. Removed impl from CommitPoint (which also removed a redundant duplicate 'gen' member).
I did not implement ReaderCommit to support deletes. Obtaining the lock for this purpose does not seem the right way to me ... IndexWriter has a deleteUnusedFiles which the application can use. If the app only does IR.listCommits, then being able to delete is an advantage, but otherwise it will need to mess with LockObtainFail exceptions. Not sure it's worth the efforts.
I believe it is ready to commit. I'll wait a day or two until I commit it. Your comments are welcome.