mirror of https://github.com/apache/lucene.git
correct java code fragment in javadocs for reopen
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@743303 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6e692d38ec
commit
18b819abe0
|
@ -340,14 +340,18 @@ public abstract class IndexReader implements Cloneable {
|
|||
* <pre>
|
||||
* IndexReader reader = ...
|
||||
* ...
|
||||
* IndexReader new = r.reopen();
|
||||
* if (new != reader) {
|
||||
* ... // reader was reopened
|
||||
* IndexReader newReader = r.reopen();
|
||||
* if (newReader != reader) {
|
||||
* ... // reader was reopened
|
||||
* reader.close();
|
||||
* }
|
||||
* reader = new;
|
||||
* reader = newReader;
|
||||
* ...
|
||||
* </pre>
|
||||
*
|
||||
* Be sure to synchronize that code so that other threads,
|
||||
* if present, can never use reader after it has been
|
||||
* closed and before it's switched to newReader.
|
||||
*
|
||||
* @throws CorruptIndexException if the index is corrupt
|
||||
* @throws IOException if there is a low-level IO error
|
||||
|
|
Loading…
Reference in New Issue