RFR: 8361909: ConstantPoolBuilder::loadableConstantEntry and constantValueEntry should throw NPE
Adam Sotona
asotona at openjdk.org
Fri Jul 11 14:18:43 UTC 2025
On Thu, 10 Jul 2025 22:32:45 GMT, Chen Liang <liach at openjdk.org> wrote:
> Currently, the aforementioned two methods do not throw NPE upon null input, but throw IAE.
>
> This behavior is bad for composition: `bsmEntry` actually throws IAE for nested null in the argument list/array, and other APIs are similarly affected.
>
> Given this domino effect, I think the best way is to fix the API itself to correctly throw NPE instead. A small CSR is opened to record this change.
Looks reasonable.
-------------
Marked as reviewed by asotona (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26257#pullrequestreview-3010505438
More information about the core-libs-dev
mailing list