Skip to content

Commit

Permalink
8296935: Arrays.asList() can return a List that throws undocumented A…
Browse files Browse the repository at this point in the history
…rrayStoreException

Reviewed-by: rriggs, lancea
  • Loading branch information
Stuart Marks committed Apr 28, 2023
1 parent 05af487 commit da9efee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/java.base/share/classes/java/util/Arrays.java
Original file line number Diff line number Diff line change
Expand Up @@ -4186,6 +4186,10 @@ private static boolean[] copyOfRangeBoolean(boolean[] original, int from, int to
* those that would change the size of the returned list. Those methods leave
* the list unchanged and throw {@link UnsupportedOperationException}.
*
* <p>If the specified array's actual component type differs from the type
* parameter T, this can result in operations on the returned list throwing an
* {@code ArrayStoreException}.
*
* @apiNote
* This method acts as bridge between array-based and collection-based
* APIs, in combination with {@link Collection#toArray}.
Expand Down

1 comment on commit da9efee

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.