Skip to content

Upgrade Spoon to 11.5.0 and default the compliance level to 21 - #368

Merged
CatarinaGamboa merged 1 commit into
mainfrom
chore/spoon-11-default-21
Oct 8, 2026
Merged

CatarinaGamboa merged 1 commit into
mainfrom
chore/spoon-11-default-21

Conversation

@CatarinaGamboa

Copy link
Copy Markdown
Collaborator

Redoes #363, which was merged into fix/compliance-level after that branch had already been merged into main (#352), so main is still on Spoon 10.4.2.

Change

  • version.spoon: 10.4.2 → 11.5.0 (JDT 3.46). Its class files target Java 17, so it runs on our Java 20 build.
  • ComplianceLevel: the cap goes from 19 to 26 (highest level JDT 3.46 accepts; 27 throws), and a separate DEFAULT of 21 is used when no pom declares a Java version (it used to be the cap).
  • RefinementTypeChecker#visitCtTryWithResource (from Model the implicit close() of try-with-resources #358): in Spoon 11, CtResource is no longer a CtVariable. A resource is now either a CtLocalVariable (try (R r = ...)) or a CtVariableRead (Java 9 try (r)). Spoon 10 modelled try (r) as an implicit copy of r's declaration, repeated per earlier same-named local. That workaround (skip implicit copies, dedupe by name, header position) is gone: every resource is scanned and closed once, and the implicit close() is built from the declaration's reference or a clone of the read, positioned at the resource.

Downstream

vscode-liquidjava/server/pom.xml declares spoon-core 10.4.2 directly, which overrides the verifier's version. Bump it to 11.5.0 together with the verifier release that includes this.

Testing

mvn test: 379/379 pass, including try_with_resources_correct / try_with_resources_error (both resource forms) and CorrectModernJavaSyntax.

🤖 Generated with Claude Code

Spoon 11.5.0 bundles JDT 3.46, which accepts compliance levels up to 26
(10.4.2's JDT 3.33 stopped at 19). Projects whose pom declares no Java
version are now parsed at 21.

Spoon 11 models a try-with-resources resource as either a local variable
declaration or a read of an existing variable (Java 9 `try (r)`), instead
of an implicit copy of the variable's declaration, so the implicit close()
is built from that node directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CatarinaGamboa
CatarinaGamboa merged commit 43023fc into main Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant