RFR: 8305990: Stripping debug info of ASM 9.5 fails [v3]
Adam Sotona
asotona at openjdk.org
Tue Apr 25 09:17:10 UTC 2023
On Thu, 20 Apr 2023 08:24:40 GMT, Adam Sotona <asotona at openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java line 86:
>>
>>> 84: }
>>> 85:
>>> 86: public void setMajorVersion(int majorVersion) {
>>
>> We should ensure the version is not changed once writing has already happened, and the constant pool builder should have access to the major version as well to prevent writing of invalid entries (like condy before java 11)
>
> The class version is set into the BufWriterImpl at the last stage and user cannot affect it later.
>
> For the invalid entries I would like to see a use case where it may happen unintentionally. Otherwise the Classfile API is not a spec-enforcing library. The library should guide to create valid classfile with minimal effort (using defaults), however it should also allow to construct whatever classfile, if it is user intention.
the version field is now final
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13478#discussion_r1176237298
More information about the core-libs-dev
mailing list