Skip to content

Add checks for OpenJDK Style §3.10 - Variable Declarations #19641

Closed

Description

@lithops-zty

Parent issue: #19604 #19798

Image

Description

Add Checkstyle checks for all rules under §3.10 - Variable Declarations of the OpenJDK Java Style Guidelines v6.

Rules Covered

From §3.10 - Variable Declarations:

  1. One variable per declaration (and at most one declaration per line) - MultipleVariableDeclarations Check
  2. Square brackets of arrays should be at the type (String[] args) and not on the variable (String args[]). - ArrayTypeStyle Check with javaStyle set to true (default)
  3. Declare a local variable right before it is first used, and initialize it as close to the declaration as possible. - VariableDeclarationUsageDistance Check

Checks to add to openjdk_checks.xml

TreeWalker-level

<module name="TreeWalker">
  <module name="MultipleVariableDeclarations"/>
  <module name="ArrayTypeStyle"/>
  <module name="VariableDeclarationUsageDistance"/>
</module>

Progress Tracker

Check Rule PR
MultipleVariableDeclarations One variable per declaration & one declaration per line #19651
ArrayTypeStyle Java-style array declaration #19749
VariableDeclarationUsageDistance Local variable declaration right before first usage #19856

Activity

  1. vivek-0509 commented on Apr 7, 2026

    @vivek-0509
    Member

    @lithops-zty looks good to me please make PR

  2. added 3 commits that reference this issue on Apr 8, 2026
  3. added 3 commits that reference this issue on Apr 21, 2026
  4. lithops-zty commented on Apr 22, 2026

    @lithops-zty
    ContributorAuthor

    @romani Can you help approve this issue if there's no problem?

  5. added a commit that references this issue on Apr 23, 2026
  6. added a commit that references this issue on Apr 23, 2026
  7. added a commit that references this issue on Apr 23, 2026
  8. added this to the 13.4.1 milestone on Apr 23, 2026
  9. added a commit that references this issue on Apr 24, 2026
  10. added a commit that references this issue on May 11, 2026
  11. modified the milestones: 13.4.1, 13.5.0 on May 11, 2026
  12. romani commented on May 11, 2026

    @romani
    Member

    Square brackets

    are merged.

  13. added 5 commits that reference this issue on May 17, 2026
  14. added a commit that references this issue on May 19, 2026
  15. lithops-zty commented on May 19, 2026

    @lithops-zty
    ContributorAuthor

    @romani @Aman-Baliyan All three checks for Section 3.10 are completed.

  16. romani commented on May 19, 2026

    @romani
    Member

    All is covered by @lithops-zty .
    thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions