Repository navigation
Add missing preview feature checks to some java hints - #8850
Merged
Merged
Conversation
Member
Author
|
will take another look today and make this a bit nicer. Planning to move the lang feature check into an enum, since the catch-all utility class is already large enough. edit: done |
mbien
force-pushed
the
hints-missing-preview-feature-checks
branch
2 times, most recently
from
September 22, 2025 16:12
7c30487 to
7e2af35
Compare
Member
Author
|
I hoped I could use the enum from within the annotation, but I forgot that enum fields don't count as constants from javac's POV, since they are created during construction. e.g this doesn't work: @Hint(displayName = "#DN_ConvertToTextBlock", description = "#DESC_ConvertToTextBlock", category="rules15",
minSourceVersion = Feature.TEXT_BLOCK.PREVIEW) |
Some hints didn't check if the feature was supported by the source version / preview flag combination.
mbien
force-pushed
the
hints-missing-preview-feature-checks
branch
from
October 2, 2025 18:25
7e2af35 to
0b13dfc
Compare
Contributor
|
FWIW, makes sense to me, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some hints didn't (correctly) check if the feature was supported by the source version / preview flag combination.
example:
NB 27 will suggest to convert this into a rule switch on JDK 17 (without preview enabled) which it shouldn't:
(feature went final in 21)