Repository navigation
1.1.0
New checks
- EmptyBodyCheck: flags empty if and else bodies (both
if (x) {}andif (x);forms) - EmptySwitchCheck: flags switch statements with no cases
- MethodAlphabeticalOrderCheck: enforces methods are sorted alphabetically within their section (static, instance)
- PreferEnhancedSwitchCheck: flags traditional switches that can be converted to arrow (
->) syntax - SwitchCaseOrderCheck: enforces sorted case labels: alphabetical for names, numerical for literals, named constants before
numbers, comma-separated labels sorted internally, default must be last
Enhanced checks
- NoBlankLineBetweenSingleCasesCheck: new sub-rule: no blank line after braced cases (the closing brace provides visual
separation) - OverloadMethodOrderCheck: now compares parameter types when param counts are equal: primitives sort before reference types,
alphabetical within each group, array types sort right after their base type
Refactoring
- Checkstyle version centralized in
gradle.properties - CheckstylePlugin reads checkstyle version from
plugin.propertiesinstead of hardcoding it - Converted internal switches to enhanced syntax in
ClassStructureOrderCheck,ControlFlowBracesCheck,MultilineCallFormattingCheck,NoBlankLineBetweenSingleCasesCheck, andNoUnnecessaryThisCheck - Extracted shared
AstUtilclass withannotationName()andlastLine()helpers (previously duplicated in
AnnotationAlphabeticalOrderCheck,ControlFlowBracesCheck, andNoBlankLineBetweenSingleCasesCheck) - Fixed switch case ordering across existing checks to comply with new
SwitchCaseOrderCheck
Full Changelog: 1.0.0...1.1.0