RFR: 8295059: test/langtools/tools/javap 12 test classes use com.sun.tools.classfile library

Adam Sotona asotona at openjdk.org
Thu Jul 27 01:41:03 UTC 2023


On Tue, 11 Jul 2023 20:17:58 GMT, Qing Xiao <duke at openjdk.org> wrote:

> Modified 10 of 12 test/langtools/tools/javap test classes to replace com.sun.tools.classfile library.

I think it looks good, good job 👍

It looks good, thanks.

test/langtools/tools/javap/TestClassNameWarning.java line 182:

> 180:         Classfile.of().buildTo(
> 181:                 classes.resolve("Z.class"),
> 182:                 ClassDesc.of("0"), cb -> {

Zero constant pool index means there is physically no entry (a kind of null value).
According to the spec the class name CP entry is mandatory, so Classfile API does not allow to enter no value and create a class file with 0 index of the class name.
We will have to figure out the way how to write 0 CP index for class name or skip this part of the test.
ClassDesc.of("0") is valid class name, so testing of the 0 CP index is skipped here.

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

PR Review: https://git.openjdk.org/jdk/pull/14837#pullrequestreview-1526023965
PR Review: https://git.openjdk.org/jdk/pull/14837#pullrequestreview-1544948636
PR Review Comment: https://git.openjdk.org/jdk/pull/14837#discussion_r1260961973


More information about the compiler-dev mailing list