Tag

ArrayStoreException

0 views collected around this technical thread.

IT Services Circle
IT Services Circle
Dec 26, 2024 · Fundamentals

Understanding the JDK Bug in Arrays.asList().toArray() and Its Fix in JDK 9

This article explains a long‑standing JDK bug where Arrays.asList().toArray() returns an Object[] that causes ArrayStoreException when modified, analyzes the underlying implementation differences between java.util.ArrayList and Arrays$ArrayList, and describes how the issue was finally fixed in JDK 9.

ArrayStoreExceptionArrays.asListJDK
0 likes · 9 min read
Understanding the JDK Bug in Arrays.asList().toArray() and Its Fix in JDK 9