changeset 9892:73f36e83538b

Merge
author coffeys
date Fri, 01 Aug 2014 10:17:32 +0100
parents 0e45c20a1964 f5d77a430a29
children 5a32bb851674
files .hgtags src/share/classes/java/util/Collections.java
diffstat 3 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jul 30 06:03:38 2014 -0700
+++ b/.hgtags	Fri Aug 01 10:17:32 2014 +0100
@@ -311,6 +311,7 @@
 be30cb2a3088f2b7b334b499f7eddbd5312312a7 jdk8u20-b23
 dfb9f24d56b51e5a2ca26e77fc69a2464d51a4d3 jdk8u20-b24
 dfb9f24d56b51e5a2ca26e77fc69a2464d51a4d3 jdk8u20-b25
+dd229c5f57bff4e75a70908294a13072b9a48385 jdk8u20-b26
 abca9f6f1a10e9f91b2538bbe7870f54f550d986 jdk8u25-b00
 7d0627679c9fdeaaaa9fe15c7cc11af0763621ec jdk8u25-b01
 b0277ec994b751ebb761814675352506cd56bcd6 jdk8u25-b02
--- a/src/share/classes/java/util/Collections.java	Wed Jul 30 06:03:38 2014 -0700
+++ b/src/share/classes/java/util/Collections.java	Fri Aug 01 10:17:32 2014 +0100
@@ -3486,6 +3486,7 @@
          */
         @Override
         public void replaceAll(UnaryOperator<E> operator) {
+            Objects.requireNonNull(operator);
             list.replaceAll(e -> typeCheck(operator.apply(e)));
         }
 
--- a/test/java/util/Collections/CheckedListReplaceAll.java	Wed Jul 30 06:03:38 2014 -0700
+++ b/test/java/util/Collections/CheckedListReplaceAll.java	Fri Aug 01 10:17:32 2014 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     8047795
+ * @bug     8047795 8053938
  * @summary Ensure that replaceAll operator cannot add bad elements
  * @author  Mike Duigou
  */
@@ -46,5 +46,16 @@
             thwarted.printStackTrace(System.out);
             System.out.println("Curses! Foiled again!");
         }
+
+        unwrapped = Arrays.asList(new Object[]{});  // Empty list
+        wrapped = Collections.checkedList(unwrapped, Integer.class);
+        try {
+            wrapped.replaceAll((UnaryOperator)null);
+            System.out.printf("Bwahaha! I have defeated you! %s\n", wrapped);
+            throw new RuntimeException("NPE not thrown when passed a null operator");
+        } catch (NullPointerException thwarted) {
+            thwarted.printStackTrace(System.out);
+            System.out.println("Curses! Foiled again!");
+        }
     }
 }