RFR: 8315678: Classfile API ConstantPool::entryCount and ConstantPool::entryByIndex methods are confusing [v2]

Adam Sotona asotona at openjdk.org
Tue Sep 5 15:25:04 UTC 2023


> Classfile API `ConstantPool::entryCount` and `ConstantPool::entryByIndex` methods are confusing and unsafe to use without knowledge of constant pool specification.
> This patch renames `ConstantPool::entryCount` to `ConstantPool::size` and adds checks to `ConstantPool::entryByIndex` for invalid or unusable indexes.
> `ConstantPool` newly extends `Iterable<PoolEntry>` for simplified user iteration over all pool entries.
> Range checks for invalid index have been added also to `ConstantPoo::bootstrapMethodEntry` methods and several `@jvms` javadoc tags have been added to pool entries.
> 
> Please review.
> 
> Thanks,
> Adam

Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:

  fixed tests

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15567/files
  - new: https://git.openjdk.org/jdk/pull/15567/files/17c57540..38406b28

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15567&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15567&range=00-01

  Stats: 8 lines in 4 files changed: 0 ins; 2 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/15567.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15567/head:pull/15567

PR: https://git.openjdk.org/jdk/pull/15567


More information about the core-libs-dev mailing list