ASM6 and non standard attribute

Remi Forax <[email protected]> Fri, 19 May 2017 10:37:58 +0200 (CEST)
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
Hi all,
Java 9 introduces some new standard bytecode attributes and those are already recognized by ASM6, but the OpenJDK (not Java) also introduces two new non standard attributes ModuleHashes and ModuleTarget that are specific to jmod which like tools like javac or java has features that are not described by the JLS or the JVMS.
The problem of these two non standard attributes is that the default mechanism for unrecognized attributes of ASM is to copy the bytes of the attributes, it works well with ModuleTarget because it only contains two Strings but ModuleHashes associate a hash (a String) to a module name so if someone use the Remapper to rename modules (like by exmple the shade plugin of Maven of the shadow plugin of gradle), the module name will not be changed in the attribute by ASM.

The plan is that at some point in the future, the jmod file format will be standardized, currently it's based on zip and the idea is to move to a format more close to the dex format of android (with one constant pool shared by several classes) so maybe those attributes may change/disappear. 

So the question is not should be support those non standard attributes or not, because here i think we have no choice but support them, the question is more how we should support those attributes,
as methods of the ModuleVisitor like the other attributes, or should we use another design that shows that those attribute are non standard an may change in the future.

regards,
Rémi


-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws