RFR: 8294972: Convert jdk.jlink internal plugins to use the Classfile API [v4]
Mandy Chung
mchung at openjdk.org
Tue Mar 14 18:04:14 UTC 2023
On Tue, 14 Mar 2023 15:22:04 GMT, Adam Sotona <asotona at openjdk.org> wrote:
>> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java line 62:
>>
>>> 60: // XXX. Do we have debug info? Is Asm ready for module-info?
>>> 61: } else {
>>> 62: byte[] content = newClassReader(path, resource, Classfile.Option.processDebug(false))
>>
>> ASM `ClassReader.SKIP_DEBUG` flag indicates to skip the SourceFile, SourceDebugExtension, LocalVariableTable, LocalVariableTypeTable, LineNumberTable and MethodParameters attributes.
>>
>> `Classfile.Option.processDebug(false)` only skips LocalVariableTable, LocalVariableTypeTable, CHARACTER_RANGE_TABLE attributes. To implement the same behavior as `SKIP_DEBUG`, it needs `Classfile.Option.processLineNumbers(false)` and skipping other attributes.
>
> Right, I'll fix it, thanks.
Looks like `LineNumberTable` is not stripped even with `Option.processLineNumbers(false)`.
-------------
PR: https://git.openjdk.org/jdk/pull/12944
More information about the core-libs-dev
mailing list