if (commit != null) {
throw new IllegalArgumentException("a reader obtained from IndexWriter.getReader() cannot currently accept a commit");
}
if (!writer.isOpen(true)) {
throw new AlreadyClosedException("cannot reopen: the IndexWriter this reader was obtained from is now closed");
}
// TODO: right now we *always* make a new reader; in
// the future we could have write make some effort to
// detect that no changes have occurred