RFR: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull [v6]

duke duke at openjdk.org
Thu Jul 11 21:18:04 UTC 2024


On Wed, 29 May 2024 19:27:17 GMT, Chen Liang <liach at openjdk.org> wrote:

>> I propose to add type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull taking an extra Class parameter, which throws ConstantPoolException instead of ClassCastException on type mismatch, which can happen to malformed ClassFiles.
>> 
>> Requesting a review from @asotona. Thanks!
>> 
>> Proposal on mailing list: https://mail.openjdk.org/pipermail/classfile-api-dev/2024-May/000512.html
>
> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:
> 
>  - Add test to validate ClassReader behavior
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/entry-by-type
>  - Null-check the entry class eagerly, avoid returning null or throwing IAE
>  - Remove redundant import
>  - Use switch
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/entry-by-type
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/entry-by-type
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/entry-by-type
>  - Use constants, beautify code
>  - 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull

@liach 
Your change (at version e9021f24d905741ac1e836c198789c37c368a166) is now ready to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/jdk/pull/19330#issuecomment-2139368471


More information about the core-libs-dev mailing list