From efbef20361e4ca04fe8493ecb3a4a49441a524db Mon Sep 17 00:00:00 2001 From: Isabel Drost-Fromm Date: Wed, 7 Sep 2016 11:53:39 +0200 Subject: [PATCH] Remove call to getClass from hashCode implementations. --- .../index/rankeval/DiscountedCumulativeGainAt.java | 2 +- .../java/org/elasticsearch/index/rankeval/PrecisionAtN.java | 2 +- .../java/org/elasticsearch/index/rankeval/RankEvalSpec.java | 2 +- .../java/org/elasticsearch/index/rankeval/RatedDocument.java | 2 +- .../java/org/elasticsearch/index/rankeval/RatedDocumentKey.java | 2 +- .../java/org/elasticsearch/index/rankeval/RatedRequest.java | 2 +- .../java/org/elasticsearch/index/rankeval/ReciprocalRank.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainAt.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainAt.java index 07a3ac1a467..36d2a208353 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainAt.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainAt.java @@ -225,6 +225,6 @@ public class DiscountedCumulativeGainAt extends RankedListQualityMetric { @Override public final int hashCode() { - return Objects.hash(getClass(), position, normalize, unknownDocRating); + return Objects.hash(position, normalize, unknownDocRating); } } diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/PrecisionAtN.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/PrecisionAtN.java index 7d64dc31c8c..ac8675a2a37 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/PrecisionAtN.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/PrecisionAtN.java @@ -197,6 +197,6 @@ public class PrecisionAtN extends RankedListQualityMetric { @Override public final int hashCode() { - return Objects.hash(getClass(), n); + return Objects.hash(n); } } diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalSpec.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalSpec.java index f329ee17f9e..39e937aaf6c 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalSpec.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalSpec.java @@ -169,6 +169,6 @@ public class RankEvalSpec extends ToXContentToBytes implements Writeable { @Override public final int hashCode() { - return Objects.hash(getClass(), specId, ratedRequests, metric); + return Objects.hash(specId, ratedRequests, metric); } } diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocument.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocument.java index 9b2dbf3fc09..8a9ad2071e2 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocument.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocument.java @@ -136,6 +136,6 @@ public class RatedDocument extends ToXContentToBytes implements Writeable, FromX @Override public final int hashCode() { - return Objects.hash(getClass(), key, rating); + return Objects.hash(key, rating); } } diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocumentKey.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocumentKey.java index cdffcf2ac57..feef20b890c 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocumentKey.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocumentKey.java @@ -139,6 +139,6 @@ public class RatedDocumentKey extends ToXContentToBytes implements Writeable, Fr @Override public final int hashCode() { - return Objects.hash(getClass(), index, type, docId); + return Objects.hash(index, type, docId); } } diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java index 2eb88a7f0e8..86861a2c95e 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java @@ -225,6 +225,6 @@ public class RatedRequest extends ToXContentToBytes implements Writeable { @Override public final int hashCode() { - return Objects.hash(getClass(), specId, testRequest, indices.hashCode(), types.hashCode(), ratedDocs.hashCode()); + return Objects.hash(specId, testRequest, indices.hashCode(), types.hashCode(), ratedDocs.hashCode()); } } diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/ReciprocalRank.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/ReciprocalRank.java index 6d6626f9c4e..803900a3521 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/ReciprocalRank.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/ReciprocalRank.java @@ -187,6 +187,6 @@ public class ReciprocalRank extends RankedListQualityMetric { @Override public final int hashCode() { - return Objects.hash(getClass(), maxAcceptableRank); + return Objects.hash(maxAcceptableRank); } }