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

Qing Xiao duke at openjdk.org
Thu Jul 27 01:41:04 UTC 2023


On Wed, 12 Jul 2023 10:24:23 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> Modified 10 of 12 test/langtools/tools/javap test classes to replace com.sun.tools.classfile library.
>
> 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.

Hi Adam. Another file of Javac package: test/langtools/tools/javac/classreader/BadClass.java also changed the CP index with sun.tools.classfile API. Can you take a look at it?
Until we figured out the way of changing CP index, should I rollback my changes and leave these two tests open?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14837#discussion_r1261346434


More information about the compiler-dev mailing list