Skip to content

Apache Lucene open-source search software

add a note why we use this strange comparator for this test (and not the standard one)

Uwe Schindler07a5f01b269b
diff --git a/lucene/src/test/org/apache/lucene/util/TestBytesRefHash.java b/lucene/src/test/org/apache/lucene/util/TestBytesRefHash.java
index c87f8869543..73e61b56bf2 100644
--- a/lucene/src/test/org/apache/lucene/util/TestBytesRefHash.java
+++ b/lucene/src/test/org/apache/lucene/util/TestBytesRefHash.java
@@ -174,6 +174,8 @@ public class TestBytesRefHash extends LuceneTestCase {
hash.add(ref);
strings.add(str);
}
+ // We use the UTF-16 comparator here, because we need to be able to
+ // compare to native String.compareTo() [UTF-16]:
int[] sort = hash.sort(BytesRef.getUTF8SortedAsUTF16Comparator());
assertTrue(strings.size() < sort.length);
int i = 0;