Parent issue: #19604
Description
Add Checkstyle checks for all rules under §3.5 - Modifiers of the OpenJDK Java Style Guidelines v6.
Rules covered
From §3.5 - Modifiers:
- Modifiers should go in the order: access modifier,
abstract, static, final, transient, volatile, default, synchronized, native, strictfp — ModifierOrder Check
- Modifiers should not be written out when they are implicit (e.g., interface methods should not be declared
public or abstract, nested enums/interfaces should not be declared static) — RedundantModifier Check
- Method parameters and local variables should not be declared
final unless it improves readability — cannot be enforced (subjective guideline)
- Fields should be declared
final unless there is a compelling reason to make them mutable — cannot be enforced (subjective guideline)
Checks to add to openjdk_checks.xml
TreeWalker-level:
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
Parent issue: #19604
Description
Add Checkstyle checks for all rules under §3.5 - Modifiers of the OpenJDK Java Style Guidelines v6.
Rules covered
From §3.5 - Modifiers:
abstract,static,final,transient,volatile,default,synchronized,native,strictfp—ModifierOrderCheckpublicorabstract, nested enums/interfaces should not be declaredstatic) —RedundantModifierCheckfinalunless it improves readability — cannot be enforced (subjective guideline)finalunless there is a compelling reason to make them mutable — cannot be enforced (subjective guideline)Checks to add to
openjdk_checks.xmlTreeWalker-level: