Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion RULES.md
Original file line number Diff line number Diff line change
@@ -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 |
Expand Down
10 changes: 5 additions & 5 deletions STANDARD.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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) {
Expand Down
13 changes: 10 additions & 3 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@
</module>
<!-- G-10.8: braces always -->
<module name="NeedBraces"/>
<!-- G-10.2: final on locals, enhanced-for variables and parameters never reassigned
(catch parameters and try-with-resources variables are left to review) -->
<!-- G-10.2: final on locals, enhanced-for variables, catch parameters and method and constructor parameters
never reassigned; a parameter that is reassigned, and the parameters of a method without a body, are not
reported (FinalParameters, used until 2.0.1, reported every parameter without final). try-with-resources
variables are left to review. -->
<module name="FinalLocalVariable">
<property name="validateEnhancedForLoopVariable" value="true"/>
<property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
</module>
<!-- G-10.2: a local declared without an initialiser and assigned later stays bare -->
<module name="SuppressionXpathSingleFilter">
<property name="checks" value="FinalLocalVariable"/>
<property name="query" value="//SLIST/VARIABLE_DEF[not(ASSIGN)]/IDENT"/>
</module>
<module name="FinalParameters"/>
</module>
</module>
Loading