Skip to content

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

Open
asya-vorobeva wants to merge 1 commit intomasterfrom
asya/S6856-improve-1
Open

SONARJAVA-5975 S6856: Add support for record component extraction#5520
asya-vorobeva wants to merge 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 2 times, most recently from 0cb5128 to 4d1505f Compare March 10, 2026 12:31
- 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>
@sonarqube-next
Copy link

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 ?

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