diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java index c0d7103e42e8e..0b09ad3d3d85e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java @@ -71,8 +71,9 @@ protected final void writeTermTypeInfoTo(StreamOutput out) throws IOException { } @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public Iterator iterator() { - return buckets.stream().map(bucket -> (SignificantTerms.Bucket) bucket).toList().iterator(); + return (Iterator) buckets.iterator(); } @Override