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
CODETOOLS-7902929: JMH generators fail for benchmark in unnamed package #38
Conversation
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.
In addition to patch comments, there are asm processor test failures with this new test, see GHA checks. It should be fixed e.g. like this:
diff --git a/jmh-generator-asm/src/main/java/org/openjdk/jmh/generators/asm/ASMClassInfo.java b/jmh-generator-asm/src/main/java/org/openjdk/jmh/generators/asm/ASMClassInfo.java
index f435d353..51b0442d 100644
--- a/jmh-generator-asm/src/main/java/org/openjdk/jmh/generators/asm/ASMClassInfo.java
+++ b/jmh-generator-asm/src/main/java/org/openjdk/jmh/generators/asm/ASMClassInfo.java
@@ -79,11 +79,24 @@ class ASMClassInfo extends ClassVisitor implements ClassInfo {
this.superName = superName;
this.idName = name;
this.access = access;
- qualifiedName = name.replace("/", ".");
- packageName = qualifiedName.substring(0, qualifiedName.lastIndexOf("."));
- origQualifiedName = qualifiedName;
- qualifiedName = qualifiedName.replace('$', '.');
- this.name = qualifiedName.substring(qualifiedName.lastIndexOf(".") + 1);
+ this.qualifiedName = name.replace("/", ".");
+
+ int dotIndex = qualifiedName.lastIndexOf(".");
+ if (dotIndex != -1) {
+ packageName = qualifiedName.substring(0, dotIndex);
+ } else {
+ packageName = "";
+ }
+
+ this.origQualifiedName = qualifiedName;
+ this.qualifiedName = qualifiedName.replace('$', '.');
+
+ dotIndex = qualifiedName.lastIndexOf(".");
+ if (dotIndex != -1) {
+ this.name = qualifiedName.substring(dotIndex + 1);
+ } else {
+ this.name = qualifiedName;
+ }
}
@Override
You can reproduce this locally by running mvn ... -Pasm
.
jmh-generator-asm/src/main/java/org/openjdk/jmh/generators/asm/ASMClassInfo.java
Show resolved
Hide resolved
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.
Mondays, eh? Assuming tests are passing now, you are good to go!
👋 Welcome back jzaugg! A progress list of the required criteria for merging this PR into |
@retronym This change now passes all automated pre-integration checks. 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 As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@shipilev) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
To avoid this situation, create a new branch for your changes and reset the
Then proceed to create a new pull request with |
Resubmitted as #39 |
Prior to the patch, the enclosed test failed with:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jmh pull/38/head:pull/38
$ git checkout pull/38
Update a local copy of the PR:
$ git checkout pull/38
$ git pull https://git.openjdk.java.net/jmh pull/38/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 38
View PR using the GUI difftool:
$ git pr show -t 38
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jmh/pull/38.diff