-
Notifications
You must be signed in to change notification settings - Fork 5.8k
JDK-8292498: java/lang/invoke/lambda/LogGeneratedClassesTest.java failed with "AssertionError: only show error once expected [1] but found [0]" #9911
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
Conversation
…led with "AssertionError: only show error once expected [1] but found [0]"
👋 Welcome back darcy! A progress list of the required criteria for merging this PR into |
Webrevs
|
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.
Its a shame. Code changes look good. I recommend adding an internal comment within the top of the class declaration indicating why anon inner classes are used, esp. since this there is more action at a distance than the usual case where lambdas are used too early in the JDK initialization process.
@jddarcy 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 5 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
This is very unfortunate, the reason to use Lambdas was to avoid creating all the subclasses that would be generated by subclassing the location() method. At least in this form, the subclasses are not initialized until they are used. |
Agree that adding an explanatory comment is a good practice; I thought the same myself shortly after creating the PR :-) |
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.
Indeed this is unfortunate. The change looks good.
Stupid question: it seems none of these lambdas/anonymous classes capture any parameters, all are stateless, and several seems to be identical. Would it make the code cleaner to use static inner classes? |
Keeping the source for the function/body close to or nested in the declaration of each enum is very desirable. |
Yes, the enum's method was coded in approximately this way to help with maintenance and readability. If this proves to be troublesome over time, there are harder-to-read/understand refactorings that could be used instead. |
/integrate |
Going to push as commit f567fa0.
Your commit was automatically rebased without conflicts. |
The use of lambda's in the initialization of AccessFlag runs afoul of CDS in some cases due to occurring early in the platform's initialization. Instead of lambdas, using anonymous classes gets around the issue.
Clean tier1 and tier 2 Mach 5 run with these changes.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9911/head:pull/9911
$ git checkout pull/9911
Update a local copy of the PR:
$ git checkout pull/9911
$ git pull https://git.openjdk.org/jdk pull/9911/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9911
View PR using the GUI difftool:
$ git pr show -t 9911
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9911.diff