Details
-
Dependency upgrade
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
In Checkstyle 8.42 scope property for JavadocMethod and MissingJavadocMethod modules was replaced with accessModifiers (see checkstyle/checkstyle#7417).
Migration Notes:
Property excludeScope was dropped and scope property was from
https://checkstyle.org/property_types.html#scope to accessModifiers of type https://checkstyle.org/property_types.html#access_modifiers .
The change to accessModifiers basically combines scope and excludeScope into 1 field and allows you specify the exact modifiers you want to validate methods with. Scope ambiguously only let you choose 1 specific modifier, and any other modifers above it in our type documentation were included, regardless if you wanted to include them or not. With accessModifiers you can now write out any and all modifiers you wish to cover, with no ambiguity.
Examples:
scope => accessModifiers
private => private, package, protected, and public
package => package, protected, and public
protected => protected, and public
public => public
excludeScope only allowed you to remove that 1 specific modifier. So scope of private and excludeScope of package included the modifiers private, protected, and public. With access modifiers you can have the same config with:
<module name="JavadocMethod">
<property name="accessModifiers" value="private, protected, public"/>
</module>
Scope did support anonymous inner classes. Since that is technically not a modifier, it is no longer supported and there is workaround.
Attachments
Issue Links
- blocks
-
MCHECKSTYLE-406 Make plugin compatible with Checkstyle 8.44 (Upgraded to 9.1)
- Closed