| Code with Finding: |
class IndexWriter {
private final void prepareCommit(Map commitUserData, boolean internal) throws CorruptIndexException, IOException {
if (hitOOM) {
throw new IllegalStateException("this writer hit an OutOfMemoryError; cannot commit");
}
if (autoCommit && !internal)
throw new IllegalStateException("this method can only be used when autoCommit is false");
if (!autoCommit && pendingCommit != null)
throw new IllegalStateException("prepareCommit was already called with no corresponding call to commit");
if (infoStream != null)
message("prepareCommit: flush");
flush(true, true, true);
startCommit(0, commitUserData);
}
}
|