Skip to content

Conversation

JoeWang-Java
Copy link
Member

@JoeWang-Java JoeWang-Java commented Sep 23, 2025

Update Commons BCEL to Version 6.10.0.

Test: T1-3 passed


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8336695: Update Commons BCEL to Version 6.10.0 (Enhancement - P4)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 23, 2025

👋 Welcome back joehw! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 23, 2025

@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:

8336695: Update Commons BCEL to Version 6.10.0

Reviewed-by: lancea, naoto, iris

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 master branch:

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 master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Sep 23, 2025

@JoeWang-Java The following label will be automatically applied to this pull request:

  • core-libs

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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 23, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 23, 2025

Webrevs

@liach
Copy link
Member

liach commented Sep 23, 2025

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?

@JoeWang-Java
Copy link
Member Author

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.

Copy link
Contributor

@LanceAndersen LanceAndersen left a 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.
Copy link
Contributor

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.
Copy link
Contributor

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?

@JoeWang-Java
Copy link
Member Author

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

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.

@LanceAndersen
Copy link
Contributor

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

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

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 24, 2025
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

@jdlib
Copy link

jdlib commented Sep 25, 2025

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?

Remove just BCEL or even XSLTC?

@liach
Copy link
Member

liach commented Sep 25, 2025

@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.

@jdlib
Copy link

jdlib commented Sep 27, 2025

@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.

@AlanBateman
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

7 participants