-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove duplicate -Xlint:options flags. #14788
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
This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR. |
// TODO: this depends on the order of argument configuration... | ||
int releaseIndex = options.compilerArgs.indexOf("--release") | ||
options.compilerArgs.removeAt(releaseIndex) | ||
options.compilerArgs.removeAt(releaseIndex) | ||
|
||
// Remove conflicting options for the linter. #14782 | ||
options.compilerArgs.removeAll("-Xlint:options") |
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.
@breskeby is there any nicer way to do this kind of compilerArgs manipulation that doesn't
depend on the ordering of those configuration callbacks? I can think of a custom argument provider but this would be even more confusing than what it is now, I think.
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.
I don't have a better idea than you. I can think of a smarter ArgumentProvider but no easy fix
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.
Thank you!
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 this works it is ok as a first step. I had same idea.
Indeed the problem with configuration order is hard to handle. Currently we rely on order of configuration.
Maybe @breskeby has an idea.
I will comment on JDK issue that there is kind of a regression because the order how the options are applied changed. Maybe they should have a defined order.
I was not able to test it yesterday in train, I just opened issue. My bad.
Greetings from bbuzz2025.
Can you backport this change? |
I will apply and backport, no worries, Uwe. Enjoy a beer in Berlin! |
If I remember: the order of configuration is still predictable by the order of including them into the main build script. I always felt bad with that, but it worked. Just want to confirm it also applies to changes in main. |
Yes, I think this can be relied upon. I don't think it's mentioned anywhere, officially, but I think it's the case. |
Fixes #14782 by not emitting duplicate lint flags to javac.