JDK-8297283 : Improve Unsupported exception messages for java.util.AbstractList
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 19
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2022-11-18
  • Updated: 2022-11-18
Description
Various implementations of java.util.List extend AbstractList. AbstractList provides useful methods for java.util.List and placeholders that throw UnsupportedOperationException.
When unsupported methods are called, the exception message is empty.
The analysis of those exceptions would be improved if the message would identify the method being invoked and the class implementing the List.
This information can be gleaned from the stacktrace and the source code but understanding and resolution would be quicker with a cogent message.