Repository navigation
2.0.1: Checkstyle checks G-10.2 as written - #1
Merged
Merged
Conversation
… deferred locals stay bare)
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.
The Checkstyle configuration did not check G-10.2 as the rule is written.
FinalParametersreported every parameter withoutfinal, including one reassigned in the body, which G-10.2 leaves bare (found adopting the config in jfrq:probe(final K key, int index)incrementsindex). Replaced byFinalLocalVariableonPARAMETER_DEF, which reports only parameters never reassigned and none of a method without a body.FinalLocalVariablereported a local declared without an initialiser and assigned later, which G-10.2 also leaves bare. ASuppressionXpathSingleFilter(//SLIST/VARIABLE_DEF[not(ASSIGN)]/IDENT) leaves those out; an enhanced-forvariable is still checked.RULES.mdregenerated (tools/rules.py --check: 140 rules, 0 failures).Tested with Checkstyle 14.3.0 on a probe file. Reported: a parameter never reassigned, a local never reassigned, a bare catch parameter, a bare enhanced-
forvariable. Not reported: a reassigned parameter, a reassigned local, deferred locals (in a block and in a switch arm), the parameters of abstract and interface methods, a lambda. G-10.2's own example passes clean.