You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2016/02/14 01:01:49 UTC

lucene-solr git commit: LUCENE-7028: Deprecate a duplicate method in NumericUtils

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_5x aaa05e20e -> 3e5e54847


LUCENE-7028: Deprecate a duplicate method in NumericUtils


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3e5e5484
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3e5e5484
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3e5e5484

Branch: refs/heads/branch_5x
Commit: 3e5e548472ca7c285b76a610684f0c87d13e9572
Parents: aaa05e2
Author: Uwe Schindler <us...@apache.org>
Authored: Sun Feb 14 00:57:27 2016 +0100
Committer: Uwe Schindler <us...@apache.org>
Committed: Sun Feb 14 01:01:35 2016 +0100

----------------------------------------------------------------------
 lucene/CHANGES.txt                              |  3 ++
 .../org/apache/lucene/util/NumericUtils.java    | 32 +++++++++++---------
 2 files changed, 21 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3e5e5484/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 932f50e..380cd69 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -70,6 +70,9 @@ API Changes
 * LUCENE-6988: IndexableField.tokenStream() no longer throws IOException
   (Alan Woodward)
 
+* LUCENE-7028: Deprecate a duplicate method in NumericUtils.
+  (Uwe Schindler)
+
 Optimizations
 
 * LUCENE-6930: Decouple GeoPointField from NumericType by using a custom

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3e5e5484/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java b/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java
index 9235953..e990234 100644
--- a/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java
+++ b/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java
@@ -92,7 +92,7 @@ public final class NumericUtils {
   /**
    * The maximum term length (used for <code>byte[]</code> buffer size)
    * for encoding <code>long</code> values.
-   * @see #longToPrefixCodedBytes
+   * @see #longToPrefixCoded
    */
   public static final int BUF_SIZE_LONG = 63/7 + 2;
 
@@ -105,7 +105,7 @@ public final class NumericUtils {
   /**
    * The maximum term length (used for <code>byte[]</code> buffer size)
    * for encoding <code>int</code> values.
-   * @see #intToPrefixCodedBytes
+   * @see #intToPrefixCoded
    */
   public static final int BUF_SIZE_INT = 31/7 + 2;
 
@@ -116,9 +116,11 @@ public final class NumericUtils {
    * @param val the numeric value
    * @param shift how many bits to strip from the right
    * @param bytes will contain the encoded value
+   * @deprecated Use {@link #longToPrefixCoded} instead.
    */
-  public static void longToPrefixCoded(final long val, final int shift, final BytesRefBuilder bytes) {
-    longToPrefixCodedBytes(val, shift, bytes);
+  @Deprecated
+  public static void longToPrefixCodedBytes(final long val, final int shift, final BytesRefBuilder bytes) {
+    longToPrefixCoded(val, shift, bytes);
   }
 
   /**
@@ -128,9 +130,11 @@ public final class NumericUtils {
    * @param val the numeric value
    * @param shift how many bits to strip from the right
    * @param bytes will contain the encoded value
+   * @deprecated Use {@link #longToPrefixCoded} instead.
    */
-  public static void intToPrefixCoded(final int val, final int shift, final BytesRefBuilder bytes) {
-    intToPrefixCodedBytes(val, shift, bytes);
+  @Deprecated
+  public static void intToPrefixCodedBytes(final int val, final int shift, final BytesRefBuilder bytes) {
+    intToPrefixCoded(val, shift, bytes);
   }
 
   /**
@@ -141,7 +145,7 @@ public final class NumericUtils {
    * @param shift how many bits to strip from the right
    * @param bytes will contain the encoded value
    */
-  public static void longToPrefixCodedBytes(final long val, final int shift, final BytesRefBuilder bytes) {
+  public static void longToPrefixCoded(final long val, final int shift, final BytesRefBuilder bytes) {
     // ensure shift is 0..63
     if ((shift & ~0x3f) != 0) {
       throw new IllegalArgumentException("Illegal shift value, must be 0..63; got shift=" + shift);
@@ -169,7 +173,7 @@ public final class NumericUtils {
    * @param shift how many bits to strip from the right
    * @param bytes will contain the encoded value
    */
-  public static void intToPrefixCodedBytes(final int val, final int shift, final BytesRefBuilder bytes) {
+  public static void intToPrefixCoded(final int val, final int shift, final BytesRefBuilder bytes) {
     // ensure shift is 0..31
     if ((shift & ~0x1f) != 0) {
       throw new IllegalArgumentException("Illegal shift value, must be 0..31; got shift=" + shift);
@@ -219,7 +223,7 @@ public final class NumericUtils {
    * This method can be used to decode a term's value.
    * @throws NumberFormatException if the supplied {@link BytesRef} is
    * not correctly prefix encoded.
-   * @see #longToPrefixCodedBytes
+   * @see #longToPrefixCoded
    */
   public static long prefixCodedToLong(final BytesRef val) {
     long sortableBits = 0L;
@@ -243,7 +247,7 @@ public final class NumericUtils {
    * This method can be used to decode a term's value.
    * @throws NumberFormatException if the supplied {@link BytesRef} is
    * not correctly prefix encoded.
-   * @see #intToPrefixCodedBytes
+   * @see #intToPrefixCoded
    */
   public static int prefixCodedToInt(final BytesRef val) {
     int sortableBits = 0;
@@ -428,8 +432,8 @@ public final class NumericUtils {
      */
     public void addRange(final long min, final long max, final int shift) {
       final BytesRefBuilder minBytes = new BytesRefBuilder(), maxBytes = new BytesRefBuilder();
-      longToPrefixCodedBytes(min, shift, minBytes);
-      longToPrefixCodedBytes(max, shift, maxBytes);
+      longToPrefixCoded(min, shift, minBytes);
+      longToPrefixCoded(max, shift, maxBytes);
       addRange(minBytes.get(), maxBytes.get());
     }
   
@@ -457,8 +461,8 @@ public final class NumericUtils {
      */
     public void addRange(final int min, final int max, final int shift) {
       final BytesRefBuilder minBytes = new BytesRefBuilder(), maxBytes = new BytesRefBuilder();
-      intToPrefixCodedBytes(min, shift, minBytes);
-      intToPrefixCodedBytes(max, shift, maxBytes);
+      intToPrefixCoded(min, shift, minBytes);
+      intToPrefixCoded(max, shift, maxBytes);
       addRange(minBytes.get(), maxBytes.get());
     }