-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8308753: Class-File API transition to Preview #15706
Conversation
…CodeStackTracker.java Co-authored-by: Maurizio Cimadamore <54672762+mcimadamore@users.noreply.github.com>
…CodeStackTracker.java Co-authored-by: Maurizio Cimadamore <54672762+mcimadamore@users.noreply.github.com>
…CodeRelabeler.java Co-authored-by: Maurizio Cimadamore <54672762+mcimadamore@users.noreply.github.com>
…d to AbstractRefEntry, AbstractRefsEntry and AbstractNamedEntry
…ons to ConstantDynamicEntry, MethodHandleEntry and MethodTypeEntry
I know, but for memory consumption reasons everyone should prefer just passing an InputStream. Is the memory consumption with |
FYI |
# Conflicts: # test/langtools/tools/javac/7199823/InnerClassCannotBeVerified.java
# Conflicts: # test/jdk/jdk/classfile/StackMapsTest.java
int JAVA_21_VERSION = 65; | ||
|
||
/** 66 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more scalable way to express the major class version? The current approach means we have to add two fields per year. Maybe a lookup function would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is explicit list of supported class file versions, so I don't see any other way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not be possible to expose an immutable Map<Integer, Integer>
that maps from Java version to major class version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually out of scope of this PR. Feel free to request a new ClassFile API feature.
# Conflicts: # src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java
@asotona This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 2b00ac0. |
Classfile API is an internal library under package
jdk.internal.classfile
in JDK 21.This pull request turns the Classfile API into a preview feature and moves it into
java.lang.classfile
.It repackages all uses across JDK and tests and adds lots of missing Javadoc.
This PR goes in sync with JDK-8308754: Class-File API (Preview) (CSR)
and JDK-8280389: Class-File API (Preview) (JEP).
Online javadoc is available at:
https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html
In addition to the primary transition to preview, this pull request also includes:
CLASSFILE_API
, has been added.Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added.
Please review this pull request to help the Classfile API turn into a preview.
Any comments are welcome.
Thanks,
Adam
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706
$ git checkout pull/15706
Update a local copy of the PR:
$ git checkout pull/15706
$ git pull https://git.openjdk.org/jdk.git pull/15706/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15706
View PR using the GUI difftool:
$ git pr show -t 15706
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15706.diff
Webrev
Link to Webrev Comment