From 9a73a2efb302e008bbff1ba172c7f99e414dc146 Mon Sep 17 00:00:00 2001 From: Colin Goodheart-Smithe Date: Thu, 22 Dec 2016 13:50:54 +0000 Subject: [PATCH] Fix stackoverflow error on InternalNumericMetricAggregation --- .../metrics/InternalNumericMetricsAggregation.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java index b9442637a6b..010e24346bf 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java @@ -105,12 +105,18 @@ public abstract class InternalNumericMetricsAggregation extends InternalMetricsA } @Override - protected int doHashCode() { + public int hashCode() { return Objects.hash(format, super.hashCode()); } @Override - protected boolean doEquals(Object obj) { + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (obj.getClass() != getClass()) { + return false; + } InternalNumericMetricsAggregation other = (InternalNumericMetricsAggregation) obj; return super.equals(obj) && Objects.equals(format, other.format);