Skip to content

Commit

Permalink
Fix eclipse compilation of hasValue
Browse files Browse the repository at this point in the history
In elastic#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.
  • Loading branch information
nik9000 committed Aug 11, 2021
1 parent b86d526 commit ee5e15e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,15 @@ public static boolean hasValue(InternalReverseNested agg) {
return agg.getDocCount() > 0;
}

public static <B extends InternalRange.Bucket, R extends InternalRange<B, R>> boolean hasValue(InternalRange<B, R> agg) {
public static boolean hasValue(InternalRange<?, ?> agg) {
return agg.getBuckets().stream().anyMatch(bucket -> bucket.getDocCount() > 0);
}

public static boolean hasValue(InternalSampler agg) {
return agg.getDocCount() > 0;
}

public static <A extends InternalSignificantTerms<A, B>,
B extends InternalSignificantTerms.Bucket<B>> boolean hasValue(InternalSignificantTerms<A, B> agg) {
public static boolean hasValue(InternalSignificantTerms<?, ?> agg) {
return agg.getBuckets().stream().anyMatch(bucket -> bucket.getDocCount() > 0);
}

Expand Down

0 comments on commit ee5e15e

Please sign in to comment.