From 8a95020ab6c61f25954a56e1965529bb2f6f58af Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Wed, 10 May 2023 16:29:34 +0000 Subject: [PATCH] 8151531: Add notes to BaseStream.spliterator/iterator docs regarding them being escape hatches Reviewed-by: psandoz --- .../share/classes/java/util/stream/BaseStream.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/util/stream/BaseStream.java b/src/java.base/share/classes/java/util/stream/BaseStream.java index 0328b25cafd..28e0541efdb 100644 --- a/src/java.base/share/classes/java/util/stream/BaseStream.java +++ b/src/java.base/share/classes/java/util/stream/BaseStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,6 +69,11 @@ public interface BaseStream> *

This is a terminal * operation. * + * @apiNote + * This operation is provided as an "escape hatch" to enable + * arbitrary client-controlled pipeline traversals in the event that the + * existing operations are not sufficient to the task. + * * @return the element iterator for this stream */ Iterator iterator(); @@ -79,6 +84,11 @@ public interface BaseStream> *

This is a terminal * operation. * + * @apiNote + * This operation is provided as an "escape hatch" to enable + * arbitrary client-controlled pipeline traversals in the event that the + * existing operations are not sufficient to the task. + * *

* The returned spliterator should report the set of characteristics derived * from the stream pipeline (namely the characteristics derived from the