Skip to content

SONARJAVA-5975 S6856: Add support for record component extraction#5520

Merged
asya-vorobeva merged 1 commit intomasterfrom
asya/S6856-improve-1
Mar 11, 2026
Merged

SONARJAVA-5975 S6856: Add support for record component extraction#5520
asya-vorobeva merged 1 commit intomasterfrom
asya/S6856-improve-1

Conversation

@asya-vorobeva
Copy link
Contributor

@asya-vorobeva asya-vorobeva commented Mar 10, 2026

  • Support @BindParam annotation for custom binding names on record components
  • Records are only processed for Spring Web >= 5.3

Part of SONARJAVA-5975

@hashicorp-vault-sonar-prod
Copy link
Contributor

hashicorp-vault-sonar-prod bot commented Mar 10, 2026

SONARJAVA-5975

@asya-vorobeva asya-vorobeva force-pushed the asya/S6856-improve-1 branch 3 times, most recently from 4d1505f to ce6f433 Compare March 10, 2026 12:38
Copy link
Contributor

@aurelien-coet-sonarsource aurelien-coet-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two small comments, but otherwise LGTM

type.symbol().memberSymbols().stream()
.filter(Symbol::isVariableSymbol)
.map(Symbol.VariableSymbol.class::cast)
.filter(f -> !f.isStatic()).forEach(field -> properties.add(getComponentName(field)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: for readability

Suggested change
.filter(f -> !f.isStatic()).forEach(field -> properties.add(getComponentName(field)));
.filter(f -> !f.isStatic())
.forEach(field -> properties.add(getComponentName(field)));


static class RecordBinding {
@GetMapping("/reports/{project}/{year}/{month}") // Noncompliant
// Compliant
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this // Compliant comment be removed ?

- Support @BindParam annotation for custom binding names on record components
- Records are only processed for Spring Web >= 5.3
- Update rule description and title
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@asya-vorobeva asya-vorobeva enabled auto-merge (squash) March 11, 2026 08:23
@sonarqube-next
Copy link

@asya-vorobeva asya-vorobeva merged commit 1d35938 into master Mar 11, 2026
14 checks passed
@asya-vorobeva asya-vorobeva deleted the asya/S6856-improve-1 branch March 11, 2026 08:38
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.

2 participants