LUCENE-952: force synchronized access to writer instance variable to fix infinite spin loop in TestGdataIndexer

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@554189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2007-07-07 12:28:04 +00:00
parent d7c0af3f30
commit 96ea45d193
2 changed files with 6 additions and 1 deletions

View File

@ -400,6 +400,11 @@ public class GDataIndexer {
}
// Used only for testing
protected synchronized IndexWriter getWriter() {
return this.writer;
}
/**
* This factory method creates a new GDataIndexer using a instance of
* {@link IndexTask}

View File

@ -552,7 +552,7 @@ public void testAddDocument() throws IOException {
latch.countDown();
documentLatch.await(5000,TimeUnit.MILLISECONDS);
// wait active for the commit
while(this.indexer.writer != null){}
while(this.indexer.getWriter() != null){}
IndexSearcher s = new IndexSearcher(this.dir);
Hits h = s.search(new TermQuery(delTerm));