RFR: 8331655: ClassFile API ClassCastException with verbose output of certain class files

Adam Sotona asotona at openjdk.org
Fri May 3 15:32:00 UTC 2024


Specifically corrupted constant pool of a class file can cause ClassCastException, when the entries are accessed by Class-File API in exact order.

This fix avoids the ClassCastException and throws ConstantPoolException instead.
Test is attached.

Please review.

Thanks,
Adam

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

Commit messages:
 - 8331655: ClassFile API ClassCastException with verbose output of certain class files

Changes: https://git.openjdk.org/jdk/pull/19088/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19088&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8331655
  Stats: 19 lines in 2 files changed: 12 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/19088.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19088/head:pull/19088

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


More information about the core-libs-dev mailing list