RFR: 8361615: CodeBuilder::parameterSlot throws undocumented IOOBE

Adam Sotona asotona at openjdk.org
Wed Jul 9 09:54:47 UTC 2025


On Tue, 8 Jul 2025 18:46:00 GMT, Chen Liang <liach at openjdk.org> wrote:

> In a recent inspection of all methods that accept an `int` argument in the Class-File API, I noticed this method that validates its argument but did not document the validation. The behavior is to throw IOOBE. We can simply document this behavior and enhance existing tests to verify exceptional behaviors in addition to anticipated outputs.
> 
> This is doc plus test only, so should be eligible for backport regardless of priority. A CSR will be created to track this new assertion in the spec.
> 
> Testing: jdk/jdk/classfile/BuilderParamTest.java

Looks good to me.

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

Marked as reviewed by asotona (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26200#pullrequestreview-3000846353


More information about the core-libs-dev mailing list