Repository navigation
SONARJAVA-7239: Improve S9357 to not raise on GWT versions older than 2.8 - #6399
romainbrenguier wants to merge 1 commit into
Conversation
…WT older than 2.8 GWT supports lambda expressions only since version 2.8, so anonymous classes cannot be replaced by lambdas in projects depending on an older GWT version. Also add the missing variable type in the rule description example. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Code Review ✅ Approved🟡 Medium risk · Dependency-version gating disables S9357 when an older GWT artifact is present, which could suppress useful findings even if that artifact does not constrain the code. Makes S9357 skip projects that depend on GWT older than 2.8, since those versions cannot rewrite anonymous classes as lambdas, and updates the RSPEC example accordingly. No issues found. Verification Rules 2/2 met Repos 5 inspectedFunctional validation No results Rules 2 passed 1 not applicable
Broader impact Repos 5 inspectedCross-repo 5 repositories inspected 0 open impacts
Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|




Summary
DependencyVersionAwareand turns itself off whengwt-user,gwt-devorgwt-servletis older than 2.8. Projects on GWT 2.8+ and projects without GWT behave as before.InterfaceImplementation taskVariable = ...) and listed the GWT case under the exceptions. The same change should also go into the RSPEC repository.Tests
AnonymousClassOnFunctionalInterfaceCheckGwtSample, verified against these classpaths: GWT 2.8 (issue raised), GWT 2.7 (no issue), and a mix ofgwt-user2.8 withgwt-dev2.6 (no issue).🤖 Generated with Claude Code
Agent workflow
Tool link: https://github.com/SonarSource/languages-experimental-tooling/tree/romain/my-tickets/personal/romain-brenguier
PR created using
uv run create_with_claude.py