RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException

Tingjun Yuan duke at openjdk.org
Mon Jan 23 02:55:35 UTC 2023


Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a `ClassCastException` (as documented in `java.util.List`) when attempting to set an element with a wrong type.

-------------

Commit messages:
 - Modify Arrays.java

Changes: https://git.openjdk.org/jdk/pull/12135/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12135&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8296935
  Stats: 11 lines in 1 file changed: 9 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/12135.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12135/head:pull/12135

PR: https://git.openjdk.org/jdk/pull/12135


More information about the core-libs-dev mailing list