Checkstyle 13.5.0 is now available, bringing important updates for Java code quality and style enforcement. This release focuses on expanding check capabilities, refining existing rules, and addressing several reported issues.

Key Changes

  • New Features:

    • A new check, UnusedTryResourceShouldBeUnnamed, helps identify and enforce best practices for try-with-resources statements.
    • The AvoidStarImport check gains a maxAllowedStarImports property, offering more granular control by permitting at most one star import per file.
    • RightCurlyCheck now supports the LITERAL_DEFAULT token, enhancing its applicability.
  • Style Guide Enhancements & Bug Fixes:

    • Google Style: Improved enforcement for comments enclosed in boxes, correct indentation of text blocks, and proper line breaking rules for lambda arrows.
    • OpenJDK Style: Multiple new checks have been added to align with OpenJDK Style guidelines, covering aspects like Variable Declarations (§3.10), Package Names (§4.1), Import statements (§3.3), Java Source Files (§2), and Package declarations (§3.2).
    • Accuracy Improvements: Fixes address false positives in RequireThis and IndentationCheck, and false negatives in PatternVariableAssignment and SimplifyBooleanExpression.
    • Javadoc & JDK25 Support: JavadocTypeCheck now correctly matches record component @param tags, and the tool adds support for flexible constructor bodies targeted for JDK25. MissingJavadocTypeCheck also received an update to use AST of Javadoc.

For full details, refer to the official release notes.

Impact for QA Teams

QA teams will benefit from more precise and comprehensive static code analysis. The enhanced style guide checks ensure greater consistency across codebases, reducing manual review effort. Fewer false positives and negatives mean more reliable reports, allowing teams to focus on genuine code quality issues.