fix: drop redundant synchronized on CheckXtextTestUtil.getInstance() (SpotBugs 4.10)#1414
Merged
joaodinissf merged 1 commit intoJun 15, 2026
Conversation
SpotBugs 4.10 (USO_UNSAFE_STATIC_METHOD_SYNCHRONIZATION / USO_UNSAFE_METHOD_SYNCHRONIZATION) flags getInstance() for synchronizing on the class's intrinsic lock, which is exposed to untrusted code. The synchronized keyword is redundant here: getInstance() only delegates to an initialize-on-demand InstanceHolder, which is already thread-safe via JVM class-initialization semantics. Removing it resolves the finding without any behavioural change. This unblocks the SpotBugs 4.9.8 -> 4.10.2 bump (dsldevkit#1410): the finding was masked in that PR's first run by the --fail-at-end cascade-skip behind the upstream findings fixed in dsldevkit#1411. A full-reactor spotbugs:check with -Dspotbugs.version=4.10.2 now reports zero bugs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
rubenporras
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SpotBugs 4.10 flags
CheckXtextTestUtil.getInstance()withUSO_UNSAFE_STATIC_METHOD_SYNCHRONIZATION/USO_UNSAFE_METHOD_SYNCHRONIZATION— it synchronizes on the class's intrinsic lock, which is exposed to untrusted code.The
synchronizedkeyword is redundant:getInstance()only delegates to an initialize-on-demandInstanceHolder, which is already thread-safe via JVM class-initialization semantics. Removing it resolves the finding with no behavioural change.This unblocks the SpotBugs 4.9.8 → 4.10.2 bump (#1410): the finding was masked in that PR's first run by the
--fail-at-endcascade-skip behind the upstream findings fixed in #1411. Verified locally with a full-reactorspotbugs:check -Dspotbugs.version=4.10.2→ BUILD SUCCESS, zero bugs.🤖 Generated with Claude Code