From 170ff7a8ad3ae180162b39fd3c6f7fa9528ccacf Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 11 Aug 2021 16:25:12 -0400 Subject: [PATCH] Fix eclipse compilation of hasValue (backport of #76375) (#76379) In #76302 we removed a few warnings in a way that javac was happy with but confused Eclipse. This makes eclipse happy by dropping our overly strict bounds in `AggregationInspectionHelper`. We really weren't using any of the type bounds we'd declared there at all. --- .../aggregations/support/AggregationInspectionHelper.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationInspectionHelper.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationInspectionHelper.java index 8922ed492df48..9d5c129037f6c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationInspectionHelper.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationInspectionHelper.java @@ -134,7 +134,7 @@ public static boolean hasValue(InternalReverseNested agg) { return agg.getDocCount() > 0; } - public static > boolean hasValue(InternalRange agg) { + public static boolean hasValue(InternalRange agg) { return agg.getBuckets().stream().anyMatch(bucket -> bucket.getDocCount() > 0); } @@ -142,8 +142,7 @@ public static boolean hasValue(InternalSampler agg) { return agg.getDocCount() > 0; } - public static , - B extends InternalSignificantTerms.Bucket> boolean hasValue(InternalSignificantTerms agg) { + public static boolean hasValue(InternalSignificantTerms agg) { return agg.getBuckets().stream().anyMatch(bucket -> bucket.getDocCount() > 0); }