From 2c8c1f1d82e5f568b1d05817bb1d8095df2afd00 Mon Sep 17 00:00:00 2001 From: marregui Date: Fri, 30 Oct 2026 16:05:13 +0100 Subject: [PATCH] 2.0.1: Checkstyle checks G-10.2 as written (reassigned parameters and deferred locals stay bare) --- CHANGELOG.md | 9 +++++++++ RULES.md | 2 +- STANDARD.md | 10 +++++----- config/checkstyle/checkstyle.xml | 13 ++++++++++--- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3be4df4..172777e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 2.0.1 (2026-10-30) + +- `config/checkstyle/checkstyle.xml` checks G-10.2 as written. `FinalParameters` reported every parameter without + `final`, including one reassigned in the body, which the rule leaves bare; `FinalLocalVariable` now checks + parameters (`PARAMETER_DEF`), reporting only those never reassigned and none of a method without a body. + `FinalLocalVariable` also reported a local declared without an initialiser and assigned later, which the rule + leaves bare; a `SuppressionXpathSingleFilter` leaves those out. Catch parameters are now checked by the build, not + left to review. No rule text changed except G-10.2's sentence on which checker reports what. + ## 2.0.0 (2026-10-30) - Written for coding agents first: every rule is one block with its scope, the principles it follows from, how it is diff --git a/RULES.md b/RULES.md index 87a5ad7..b184ace 100644 --- a/RULES.md +++ b/RULES.md @@ -1,6 +1,6 @@ # Rules index -Generated from [`STANDARD.md`](STANDARD.md) v2.0.0 by `tools/rules.py`; do not edit by hand. One row per +Generated from [`STANDARD.md`](STANDARD.md) v2.0.1 by `tools/rules.py`; do not edit by hand. One row per rule. Read the rule's block in the standard before applying it or reporting a finding against it. | ID | Rule | Scope | Class | Checked by | Finding | diff --git a/STANDARD.md b/STANDARD.md index 956295e..443383b 100644 --- a/STANDARD.md +++ b/STANDARD.md @@ -1,6 +1,6 @@ # Java Coding Standard -Version 2.0.0, 2026-10-30. JDK 25 baseline. +Version 2.0.1, 2026-10-30. JDK 25 baseline. This standard says how Java is written, changed and judged in the repositories that follow it. Its first readers are coding agents (Claude, Codex) that write, change and review code; its second readers are the engineers who own that @@ -1565,10 +1565,10 @@ parameters of a method without a body (`abstract`, `native`, interface declarations). A sweep over existing code is applied by a tool (G-13.9); new and changed lines are written with `final` directly. javac rejects a `final` on a reassigned variable but never reports a missing one: Checkstyle's -`FinalLocalVariable` and `FinalParameters` (in this standard's -`config/checkstyle/checkstyle.xml`) report locals, enhanced-`for` variables and -parameters; catch parameters and `try`-with-resources variables are left to -review. +`FinalLocalVariable` (in this standard's `config/checkstyle/checkstyle.xml`) +reports locals, enhanced-`for` variables, catch parameters and method and +constructor parameters that are never reassigned, and leaves out a local declared +without an initialiser; `try`-with-resources variables are left to review. ```java public long sum(final LongList values, final int from) { diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index acaa431..aaf6204 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -27,11 +27,18 @@ - + + + + + + + -