fix test fail

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1540250 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-11-09 02:57:16 +00:00
parent dc47488a2b
commit 7ddbf59fbd
1 changed files with 3 additions and 1 deletions

View File

@ -1475,7 +1475,9 @@ public abstract class BasePostingsFormatTestCase extends LuceneTestCase {
} }
// Also test seeking the TermsEnum: // Also test seeking the TermsEnum:
for(String term : termFreqs.keySet()) { // must make copy because this very code sometimes makes puts while iterating?!
Set<String> copy = new HashSet<String>(termFreqs.keySet());
for(String term : copy) {
if (termsEnum.seekExact(new BytesRef(term))) { if (termsEnum.seekExact(new BytesRef(term))) {
if (random().nextBoolean()) { if (random().nextBoolean()) {
docs = termsEnum.docs(null, docs, DocsEnum.FLAG_FREQS); docs = termsEnum.docs(null, docs, DocsEnum.FLAG_FREQS);