Skip to content

Fix the two open Sonar reliability issues - #3141

Merged
tastybento merged 1 commit into
developfrom
fix/sonar-reliability
Nov 23, 2026
Merged

tastybento merged 1 commit into
developfrom
fix/sonar-reliability

Conversation

@tastybento

Copy link
Copy Markdown
Member

SonarQube Cloud rates BentoBox's reliability C because of two open issues. This fixes both.

  • Null pointer report in Island#getRank (blocker, javabugs:S2259). The team panel compared the viewer with a member through User#equals, whose null check led Sonar to assume the member could be null when its rank is read next. The member is never null there, so this was a false alarm, but comparing UUIDs in a small isViewer helper removes the path Sonar followed.
  • Slow regex in ItemStackTypeAdapter (medium, java:S8786). The pattern that finds an item's id: or type: key matched trailing whitespace after a lazy quantifier, which can backtrack. The pattern now takes the rest of the line and the caller trims it, as it already did. A new test covers a key with trailing whitespace.

The item adapter and team panel tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe

The team panel compared the viewer with a member through User#equals,
which led Sonar to report a possible null member in Island#getRank.
Compare UUIDs instead. The item key pattern matched trailing whitespace
after a lazy quantifier and could backtrack; the caller already trims.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe
@sonarqubecloud

Copy link
Copy Markdown

@tastybento
tastybento merged commit 5b9c842 into develop Nov 23, 2026
3 checks passed
@tastybento
tastybento deleted the fix/sonar-reliability branch November 24, 2026 01:18
@tastybento tastybento mentioned this pull request Nov 24, 2026
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