A few methods take Directory where it makes no sense:
Collection SegmentInfos.files(Directory dir, boolean includeSegmentsFile); String SegmentInfos.toString(Directory dir); String SegmentCommitInfo.toString(Directory dir, int pendingDelCount); String SegmentInfo.toString(Directory dir, int delCount);
The incoming Directory parameter for files() is bogus, if assertions are enabled, it fails if any underlying segment's 'dir' differs. But if assertions are not enabled, it just silently drops them. If we want to add safety around this kind of thing, this is not the way.
For toString(), it just makes the API hard to use for everyone. This change means commits have a working Object.toString() method.