Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@benzonico
Copy link
Contributor

@benzonico benzonico commented Nov 16, 2025

SONARJAVA-5867

Part of

benzonico and others added 2 commits November 16, 2025 08:47
…and parameters

The rule was incorrectly raising issues on fields and parameters annotated
with @nonnull (from various packages like org.jspecify.annotations.NonNull
or edu.umd.cs.findbugs.annotations.NonNull). Since @nonnull indicates the
value cannot be null, requesting a default null value doesn't make sense.

Fixed by checking the NullabilityType and only raising issues when the
annotation is actually nullable (WEAK_NULLABLE or STRONG_NULLABLE), not
when it's NON_NULL, UNKNOWN, or NO_ANNOTATION.

Prefer not raising an issue when nullability type is unknown.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title Fix/sonarjava 5866 s6816 nonnull parameter fp SONARJAVA-5867 Fix/sonarjava 5866 s6816 nonnull parameter fp Nov 16, 2025
@sonarqube-next
Copy link

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