mirror of https://github.com/apache/lucene.git
LUCENE-6173: Use Objects.hash() for simplicty. Also unbreak branch_5x
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1650739 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
df660ce6c4
commit
969dcdb43c
|
@ -17,6 +17,8 @@ package org.apache.lucene.analysis;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
|
||||
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
|
||||
import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
|
||||
|
@ -224,13 +226,7 @@ public final class NumericTokenStream extends TokenStream {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + precisionStep;
|
||||
result = prime * result + shift;
|
||||
result = prime * result + Long.hashCode(value);
|
||||
result = prime * result + valueSize;
|
||||
return result;
|
||||
return Objects.hash(precisionStep, shift, value, valueSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.lucene.util.BytesRef;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A TokenStream used internally by {@link org.apache.lucene.spatial.prefix.PrefixTreeStrategy}.
|
||||
|
@ -134,11 +135,7 @@ class CellTokenStream extends TokenStream {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((cell == null) ? 0 : cell.hashCode());
|
||||
result = prime * result + Boolean.hashCode(omitLeafByte);
|
||||
return result;
|
||||
return Objects.hash(cell, omitLeafByte);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue