Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-990

Checkstyle config: Swap scope and exclude scope to access modifier in the check JavadocMethodCheck.

    XMLWordPrintableJSON

Details

    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

          Activity

            People

              slachiewicz Sylwester Lachiewicz
              slachiewicz Sylwester Lachiewicz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: