Skip to content

1.1.0

Choose a tag to compare

@EtK2000 EtK2000 released this 11 Mar 23:27
· 132 commits to master since this release

New checks

  • EmptyBodyCheck: flags empty if and else bodies (both if (x) {} and if (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.properties instead of hardcoding it
  • Converted internal switches to enhanced syntax in ClassStructureOrderCheck, ControlFlowBracesCheck, MultilineCallFormattingCheck, NoBlankLineBetweenSingleCasesCheck, and NoUnnecessaryThisCheck
  • Extracted shared AstUtil class with annotationName() and lastLine() helpers (previously duplicated in
    AnnotationAlphabeticalOrderCheck, ControlFlowBracesCheck, and NoBlankLineBetweenSingleCasesCheck)
  • Fixed switch case ordering across existing checks to comply with new SwitchCaseOrderCheck

Full Changelog: 1.0.0...1.1.0