-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8336695: Update Commons BCEL to Version 6.10.0 #27459
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back joehw! A progress list of the required criteria for merging this PR into |
@JoeWang-Java 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 52 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@JoeWang-Java The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Last time I tried to migrate off BCEL to ClassFile API, I noted only xalan xsltc is using it to write class files. Is it possible for us to remove it in the long run? |
Possibly, but there is no justification for investing more resources in these libs than keeping them updated as required. |
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.
Overall, I think this is fine
Can you clarify/confirm that the comment changes are from upstream? I commented on a couple of examples.
Not sure why the change from "Returns" to "Gets" in several places so I am assuming this an upstream change
|
||
/** | ||
* Lookups class somewhere found on your CLASSPATH, or wherever the repository instance looks for it. | ||
* Lookups class somewhere found on your CLASSPATH, or whereever the repository instance looks for it. |
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.
The original "wherever" is correct
|
||
/** | ||
* Set access flags aka "modifiers". | ||
* Sets access flags also known as modifiers. |
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.
Why change here, but not other cases such as the one that follows?
Yes, they are from upstream. There were 174 lines/javadoc changes for the class AccessFlags alone. I basically applied them without change, including the ones you mentioned. It's tempting to fix them, but then we'll have to re-visit them the next time we update. We used to do so. We are fortunate we haven't had to go through the exercise for the other libs as Xalan/Xerces for example, haven't had many releases in recent years. |
Thank you for the clarification Joe. Just approved your PR |
/* | ||
* reserved comment block | ||
* DO NOT REMOVE OR ALTER! | ||
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. |
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.
IANAL, but I think the original year needs to be here, as apparently it has been in the repository.
Also, I see other files, e.g., ArrayElementValue.java
has the same header ("reserved comment block"). Should they also have Oracle copyright?
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.
Oracle copyright is added when we make changes to the upstream source. In this case, I replaced the newly introduced reference to Apache Commons Lang with a Utils method, thus the copyright year 2025 since we haven't made changes to the upstream source until now. Also added is the LastModified tag as required by the license. Note the tag was not there until now.
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.
If Apache's bcel constantly introduce new dependencies, monkey patches like these are no better than migrating the whole xsltc to use ClassFile API for bytecode generation, in my opinion.
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.
Migrating off of BCEL would certainly be great. If you have the time and interest, you're more than welcome to explore it further.
* <a href="http://java.sun.com/j2me/"> Java 2 Micro Edition</a> (J2ME). This attribute is used by the | ||
* <a href="http://java.sun.com/products/cldc/">KVM</a> and contained within the Code attribute of a method. See CLDC | ||
* <a href="https://java.sun.com/j2me/"> Java 2 Micro Edition</a> (J2ME). This attribute is used by the | ||
* <a href="https://java.sun.com/products/cldc/">KVM</a> and contained within the Code attribute of a method. See CLDC |
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 change from "http" to "https" highlights the age of these links. Both re-direct to the same page.
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.
True, probably did not check the resulting page. It was a http to https patch at BCEL.
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.
Yea. Not much you can do about without increasing the maintenance cost at our end. I think it's fine to keep what's there.
Remove just BCEL or even XSLTC? |
@jdlib If we need to maintain a patched (to remove extra dependencies) BCEL, I believe we are better off maintaining a patched (to use ClassFile API instead of BCEL) xsltc. |
@liach Refactoring XSLTC to use the classfile API seems to be a quite straightforward exercise (e.g. moving all use of BCEL classes into xsltc.MethodGenerator, (new) xsltc.InstructionList etc and then redirect their implementation to the classfile API), but not sure if the result can then be easily patched. On the other hand there may not be that much activity on the Apache XSLTC side anymore. I would almost like to volunteer for such a migration. |
It would be a nice project to do. If you do take it on then I think you'll need to survey the tests for javax.xml.transform and get some sense as to how well the XSLT compiler is tested. Maybe more tests are needed. A cautious approach would be to leave BCEL in place with a system probably or some means to go back to the old implementation until there is confidence that the replacement implementation is good. Also have a means to capture the generated classes from the old and new implementations might help on the confidence too. |
Update Commons BCEL to Version 6.10.0.
Test: T1-3 passed
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27459/head:pull/27459
$ git checkout pull/27459
Update a local copy of the PR:
$ git checkout pull/27459
$ git pull https://git.openjdk.org/jdk.git pull/27459/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27459
View PR using the GUI difftool:
$ git pr show -t 27459
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27459.diff
Using Webrev
Link to Webrev Comment