Skip to content

Commit 8a95020

Browse files
viktorklang-oraPaul Sandoz
authored and
Paul Sandoz
committed
8151531: Add notes to BaseStream.spliterator/iterator docs regarding them being escape hatches
Reviewed-by: psandoz
1 parent 0198afc commit 8a95020

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/java.base/share/classes/java/util/stream/BaseStream.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -69,6 +69,11 @@ public interface BaseStream<T, S extends BaseStream<T, S>>
6969
* <p>This is a <a href="package-summary.html#StreamOps">terminal
7070
* operation</a>.
7171
*
72+
* @apiNote
73+
* This operation is provided as an "escape hatch" to enable
74+
* arbitrary client-controlled pipeline traversals in the event that the
75+
* existing operations are not sufficient to the task.
76+
*
7277
* @return the element iterator for this stream
7378
*/
7479
Iterator<T> iterator();
@@ -79,6 +84,11 @@ public interface BaseStream<T, S extends BaseStream<T, S>>
7984
* <p>This is a <a href="package-summary.html#StreamOps">terminal
8085
* operation</a>.
8186
*
87+
* @apiNote
88+
* This operation is provided as an "escape hatch" to enable
89+
* arbitrary client-controlled pipeline traversals in the event that the
90+
* existing operations are not sufficient to the task.
91+
*
8292
* <p>
8393
* The returned spliterator should report the set of characteristics derived
8494
* from the stream pipeline (namely the characteristics derived from the

0 commit comments

Comments
 (0)