POC: JDK ClassModel -> ASM ClassReader

ebruneton at free.fr ebruneton at free.fr
Wed Jul 20 06:08:11 UTC 2022


Hi Ben,

Le 19/07/2022 20:37, Ben Evans a écrit :
> What worries me is that:
> 
> a) The Classfile API ends up not containing everything that is really
> needed by library authors, so they don't switch

I don't think a rewrite of ASM on top of ClassFile is necessary for 
that. The work that Rafael is doing should be very helpful already. As 
well as all the feedback you receive on this mailing list.

> b) The cost of switching is very high, so authors keep using ASM,
> which therefore keeps being developed, and we lose the opportunity to
> close a big gap in the long upgrade cycle problem.

For the "long upgrade cycle problem" I think very common libraries which 
are no longer actively maintained (such as cglib - 
https://github.com/cglib/cglib/blob/master/README.md, used in many other 
libraries, such as EasyMock) will continue to be an issue anyway, even 
with the ClassFile API.

> c) Even if a) turns out not to be a problem, the time to get enough of
> the ecosystem moved over to Classfile API is potentially extremely
> long.

 From these 3 points it seems that your goal is for the ClassFile API to 
eventually replace ASM? Yet this is listed as a non goal in 
https://bugs.openjdk.org/browse/JDK-8280389? Can you clarify?

About the "majority of cases" where the class file format does not 
change between two JDK versions, why is the class file version still 
incremented? If it was not, this would solve several cases where tools 
such as ASM must be "updated" for no real reason. Another option would 
be to increment the minor version only, and to reserve major version 
increments for real format changes. If this was added to the JVMS, tools 
such as ASM could take advantage of this, and would need to be updated 
less often (in fact I realize that ASM is already checking the major 
version only, so we unconsciously already assumed that minor version 
changes are not important).

Eric
> 
> There are no easy answers here, of course.
> 
> Thanks,
> 
> Ben


More information about the classfile-api-dev mailing list