From bee60b61448835d81a436b1b20a8dd43ba43adb1 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Sat, 8 Oct 2011 18:03:55 +0000 Subject: [PATCH] use fixed byte size valid unicode string rather than a truncated unicde string for fixed IDV variants in RIW git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1180439 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/RandomIndexWriter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java b/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java index e8288f35997..9e028ce7dc4 100644 --- a/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java +++ b/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java @@ -178,7 +178,8 @@ public class RandomIndexWriter implements Closeable { case BYTES_FIXED_DEREF: case BYTES_FIXED_STRAIGHT: case BYTES_FIXED_SORTED: - final String randomUnicodeString = _TestUtil.randomUnicodeString(random, fixedBytesLength); + //make sure we use a valid unicode string with a fixed size byte length + final String randomUnicodeString = _TestUtil.randomFixedByteLengthUnicodeString(random, fixedBytesLength); BytesRef fixedRef = new BytesRef(randomUnicodeString); if (fixedRef.length > fixedBytesLength) { fixedRef = new BytesRef(fixedRef.bytes, 0, fixedBytesLength);