make a private copy of the term returned from frozenDeletes iterator since term is reused

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1152284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2011-07-29 15:51:30 +00:00
parent b7e7683968
commit 75e72c1fd9
1 changed files with 3 additions and 2 deletions

View File

@ -16,7 +16,6 @@ package org.apache.lucene.index;
* License for the specific language governing permissions and limitations under
* the License.
*/
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
@ -73,7 +72,9 @@ public class TestDocumentsWriterDeleteQueue extends LuceneTestCase {
assertEquals(uniqueValues, bd2.terms.keySet());
HashSet<Term> frozenSet = new HashSet<Term>();
for (Term t : queue.freezeGlobalBuffer(null).termsIterable()) {
frozenSet.add(t);
BytesRef bytesRef = new BytesRef();
bytesRef.copy(t.bytes);
frozenSet.add(new Term(t.field, bytesRef));
}
assertEquals(uniqueValues, frozenSet);
assertEquals("num deletes must be 0 after freeze", 0, queue