RFR: 8294966: jdk.jartool sun.tools.jar.FingerPrint uses ASM to parse class jar entries
Adam Sotona
asotona at openjdk.org
Thu Mar 9 17:41:37 UTC 2023
On Tue, 7 Mar 2023 20:47:31 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> 8294966: jdk.jartool sun.tools.jar.FingerPrint uses ASM to parse class jar entries
>> This patch converts it to use Classfile API.
>>
>> Please review.
>> Thanks,
>> Adam
>
> src/jdk.jartool/share/classes/sun/tools/jar/FingerPrint.java line 42:
>
>> 40: import jdk.internal.classfile.FieldModel;
>> 41: import jdk.internal.classfile.MethodModel;
>> 42: import jdk.internal.classfile.attribute.EnclosingMethodAttribute;
>
> this import is unused.
fixed, thanks.
> src/jdk.jartool/share/classes/sun/tools/jar/FingerPrint.java line 313:
>
>> 311: @Override
>> 312: public void visitEnd() {
>> 313: this.nestedClass = this.outerClassName != null;
>
> `this.nestedClass` is updated after the attributes are visited. Suggest to rename `nestedClass` to `maybeNestedClass` and change `isNestedClass` to:
>
> public boolean isNestedClass() {
> return attrs.maybeNestedClass && attrs.outerClassName != null;
> }
I've changed `nestedClass` according to the suggestion, thanks.
-------------
PR: https://git.openjdk.org/jdk/pull/11694
More information about the core-libs-dev
mailing list