changeset 7712:8b76012be75c

NPE if action is null
author psandoz
date Fri, 22 Mar 2013 12:13:41 +0100
parents 3011747dd9c3
children 0e50e2e77de2
files src/share/classes/java/util/Spliterator.java
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/Spliterator.java	Fri Mar 22 11:40:21 2013 +0100
+++ b/src/share/classes/java/util/Spliterator.java	Fri Mar 22 12:13:41 2013 +0100
@@ -239,6 +239,7 @@
      * @param action The action
      * @return {@code false} if no remaining elements existed
      * upon entry to this method, else {@code true}.
+     * @throws NullPointerException if the specified action is null
      */
     boolean tryAdvance(Consumer<? super T> action);
 
@@ -253,6 +254,7 @@
      * it returns {@code false}.  It should be overridden whenever possible.
      *
      * @param action The action
+     * @throws NullPointerException if the specified action is null
      */
     default void forEach(Consumer<? super T> action) {
         do { } while (tryAdvance(action));
@@ -502,6 +504,7 @@
          * @param action The action
          * @return {@code false} if no remaining elements existed
          * upon entry to this method, else {@code true}.
+         * @throws NullPointerException if the specified action is null
          */
         boolean tryAdvance(IntConsumer action);
 
@@ -517,6 +520,7 @@
          * possible.
          *
          * @param action The action
+         * @throws NullPointerException if the specified action is null
          */
         default void forEach(IntConsumer action) {
             do { } while (tryAdvance(action));
@@ -586,6 +590,7 @@
          * @param action The action
          * @return {@code false} if no remaining elements existed
          * upon entry to this method, else {@code true}.
+         * @throws NullPointerException if the specified action is null
          */
         boolean tryAdvance(LongConsumer action);
 
@@ -601,6 +606,7 @@
          * possible.
          *
          * @param action The action
+         * @throws NullPointerException if the specified action is null
          */
         default void forEach(LongConsumer action) {
             do { } while (tryAdvance(action));
@@ -671,6 +677,7 @@
          * @param action The action
          * @return {@code false} if no remaining elements existed
          * upon entry to this method, else {@code true}.
+         * @throws NullPointerException if the specified action is null
          */
         boolean tryAdvance(DoubleConsumer action);
 
@@ -686,6 +693,7 @@
          * possible.
          *
          * @param action The action
+         * @throws NullPointerException if the specified action is null
          */
         default void forEach(DoubleConsumer action) {
             do { } while (tryAdvance(action));