Skip to content

Apache Lucene open-source search software

LUCENE-3590: deprecate dancing comparators

Robert Muir7f366cd0da92
diff --git a/lucene/src/java/org/apache/lucene/util/BytesRef.java b/lucene/src/java/org/apache/lucene/util/BytesRef.java
index 2c94a7005b0..5cbb610b566 100644
--- a/lucene/src/java/org/apache/lucene/util/BytesRef.java
+++ b/lucene/src/java/org/apache/lucene/util/BytesRef.java
@@ -275,12 +275,18 @@ public final class BytesRef implements Comparable<BytesRef>,Cloneable {
}
}
+ /** @deprecated */
+ @Deprecated
private final static Comparator<BytesRef> utf8SortedAsUTF16SortOrder = new UTF8SortedAsUTF16Comparator();
+ /** @deprecated This comparator is only a transition mechanism */
+ @Deprecated
public static Comparator<BytesRef> getUTF8SortedAsUTF16Comparator() {
return utf8SortedAsUTF16SortOrder;
}
+ /** @deprecated */
+ @Deprecated
private static class UTF8SortedAsUTF16Comparator implements Comparator<BytesRef> {
// Only singleton
private UTF8SortedAsUTF16Comparator() {};
diff --git a/lucene/src/java/org/apache/lucene/util/CharsRef.java b/lucene/src/java/org/apache/lucene/util/CharsRef.java
index cd38d4a9c0a..6a8c853165f 100644
--- a/lucene/src/java/org/apache/lucene/util/CharsRef.java
+++ b/lucene/src/java/org/apache/lucene/util/CharsRef.java
@@ -216,12 +216,18 @@ public final class CharsRef implements Comparable<CharsRef>, CharSequence, Clone
return new CharsRef(chars, offset + start, offset + end - 1);
}
+ /** @deprecated */
+ @Deprecated
private final static Comparator<CharsRef> utf16SortedAsUTF8SortOrder = new UTF16SortedAsUTF8Comparator();
+ /** @deprecated This comparator is only a transition mechanism */
+ @Deprecated
public static Comparator<CharsRef> getUTF16SortedAsUTF8Comparator() {
return utf16SortedAsUTF8SortOrder;
}
+ /** @deprecated */
+ @Deprecated
private static class UTF16SortedAsUTF8Comparator implements Comparator<CharsRef> {
// Only singleton
private UTF16SortedAsUTF8Comparator() {};