Hello all;

This changeset corrects a reported problem with the lists returned by 
Collections.checkedList(). Since Java 8 the replaceAll() method on checked 
lists has erroneously allowed the operator providing replacements to provide 
illegal replacement values which are then stored, unchecked into the wrapped 
list.

This changeset adds a check on the proposed replacement value and throws a 
ClassCastException if the replacement value is incompatible with the list. 
Additionally the javadoc is updated to inform users that a ClassCastException 
may result if the proposed replacement is unacceptable.

Note that this changeset takes the strategy of failing when the illegal value 
is encountered. Replacements of earlier items in the list are retained.

jbsbug: https://bugs.openjdk.java.net/browse/JDK-8047795
webrev: http://cr.openjdk.java.net/~mduigou/JDK-8047795/0/webrev/

This change will be backported to Java 8.

Mike

Reply via email to