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 fortry-with-resourcesstatements. - The
AvoidStarImportcheck gains amaxAllowedStarImportsproperty, offering more granular control by permitting at most one star import per file. RightCurlyChecknow supports theLITERAL_DEFAULTtoken, enhancing its applicability.
- A new check,
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
RequireThisandIndentationCheck, and false negatives inPatternVariableAssignmentandSimplifyBooleanExpression. - Javadoc & JDK25 Support:
JavadocTypeChecknow correctly matches record component@paramtags, and the tool adds support for flexible constructor bodies targeted for JDK25.MissingJavadocTypeCheckalso 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.
