April 25, 2024

Beznadegi

The Joy of Technology

OpenJDK proposal would provide Java class file API

[ad_1]

Java would get an API for processing Java course data files, underneath a proposal afoot in the Java neighborhood.

The draft classfile API proposal phone calls for provision of an API for parsing, building, and reworking Java course documents. This classfile library to begin with would provide as an inside substitute for the ASM Java bytecode manipulation framework. Sooner or later, ASM would be taken off solely from the JDK.

The classfile API proposal notes that class file technology, parsing, and instrumentation are ubiquitous in the Java ecosystem, with numerous resources and libraries needing to course of action class documents. Frameworks generally accomplish on-the-fly bytecode instrumentation. The JDK, the proposal states, really should provide an exact, finish, up-to-day, performant API for studying, producing, and reworking Java class information.

Design aims and rules for the API include things like acquiring all course file entities, this kind of as procedures and fields, represented by immutable objects. User-driven navigation also is a goal. Motivating the connect with for a Java classfile library are variables which includes:

  • JDK consolidation, with the JDK by itself considerable in working with course information. And there is a delay inherent in the JDK’s use of ASM.
  • Edition skew concerning frameworks and operating the JDK. Applications and frameworks processing class information usually bundle a classfile library this kind of as ASM. But mainly because new class file attributes can appear in any release of the JDK, applications and frameworks are much more routinely encountering class information that are more recent than the library they are bundled with, ensuing in runtime faults or in frameworks seeking to parse class file formats from the future. Developers want a classfile library that will be up-to-day with operating the JDK.
  • The JVM and class file format now are evolving more rapidly than ahead of. Even though some evolutions are simple, other individuals are more complex, this kind of as Venture Valhalla bringing forth new bytecodes, subject descriptors, and verification policies.
  • The language has enhanced substantially since ASM was penned.

Strategies call for at first changing ASM as a runtime dependency of the JDK without unacceptable reduction of general performance. A further aim would be to substitute the inner classreader library employed by the compiler and JDK equipment. Ultimately, a vary of frameworks and apps need to be ready to use the library as an different to ASM, cglib, and other bytecode libraries.

Copyright © 2022 IDG Communications, Inc.

[ad_2]

Source connection