Skip to content

SONARJAVA-6711 USER-2405 Fix S3252 false positive for Quarkus Panache entity static methods - #5866

Merged
romainbrenguier merged 1 commit into
masterfrom
romain/user-2405
Aug 4, 2026
Merged

SONARJAVA-6711 USER-2405 Fix S3252 false positive for Quarkus Panache entity static methods#5866
romainbrenguier merged 1 commit into
masterfrom
romain/user-2405

Conversation

@romainbrenguier

Copy link
Copy Markdown
Contributor

Panache uses bytecode generation to create static method implementations in entity subclasses, so accessing them via the derived type is the intended usage pattern. Skip the issue when the static member's owner is a Panache entity base class.

Part of

Panache uses bytecode generation to create static method implementations
in entity subclasses, so accessing them via the derived type is the
intended usage pattern. Skip the issue when the static member's owner
is a Panache entity base class.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title USER-2405 Fix S3252 false positive for Quarkus Panache entity static methods SONARJAVA-6711 USER-2405 Fix S3252 false positive for Quarkus Panache entity static methods Aug 3, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

SONARJAVA-6711

@gitar-bot

gitar-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Fixes S3252 false positives for Quarkus Panache entity static methods by skipping checks on Panache entity base classes. Consider narrowing the isPanacheEntityBase scope so it doesn't suppress warnings for user-defined static members.

💡 Quality: Panache suppression broader than bytecode-generated methods

Reply with Gitar … to ask about this finding.

isPanacheEntityBase(staticType) suppresses S3252 for any static member whose declaring type is a Panache entity base subtype — not only the framework-generated methods (listAll/count/etc.). A user-declared static method inherited from a Panache-derived class and accessed via a further subclass would also be silently skipped, introducing a false negative. This is acceptable for the fix but consider narrowing to the known Panache base classes themselves (e.g. checking the exact owner FQN) if tighter scoping is desired.

🤖 Prompt for agents
Code Review: Fixes S3252 false positives for Quarkus Panache entity static methods by skipping checks on Panache entity base classes. Consider narrowing the isPanacheEntityBase scope so it doesn't suppress warnings for user-defined static members.

1. 💡 Quality: Panache suppression broader than bytecode-generated methods

   isPanacheEntityBase(staticType) suppresses S3252 for any static member whose declaring type is a Panache entity base subtype — not only the framework-generated methods (listAll/count/etc.). A user-declared static method inherited from a Panache-derived class and accessed via a further subclass would also be silently skipped, introducing a false negative. This is acceptable for the fix but consider narrowing to the known Panache base classes themselves (e.g. checking the exact owner FQN) if tighter scoping is desired.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqube-next

sonarqube-next Bot commented Aug 4, 2026

Copy link
Copy Markdown

@romainbrenguier
romainbrenguier marked this pull request as ready for review August 4, 2026 09:05
@romainbrenguier
romainbrenguier merged commit eef908e into master Aug 4, 2026
31 of 32 checks passed
@romainbrenguier
romainbrenguier deleted the romain/user-2405 branch August 4, 2026 12:44
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