Fix binary-incompatible getMemberSet() return type and AddonClassLoader recursive update#2836
Merged
tastybento merged 2 commits intodevelopfrom Mar 9, 2026
Conversation
…bility Commit d244c40 changed getMemberSet() overloads from ImmutableSet<UUID> to Set<UUID> to satisfy SonarCloud S4738. This is a binary-incompatible API change: addons compiled against any prior BentoBox version will throw NoSuchMethodError at runtime because the JVM encodes the return type in the method descriptor. Reverts to ImmutableSet<UUID> with @SuppressWarnings("java:S4738") and a comment explaining the rationale. Also stubs the two newly-typed overloads in CommonTestSetup (Mockito no longer auto-stubs ImmutableSet with an empty set) and adds missing itc command mocks to IslandTeamInviteGUITest so the testBackButtonClick_notInviteCmd_closesInventory test passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ConcurrentHashMap.computeIfAbsent() throws IllegalStateException when a nested call tries to compute another entry while an outer computation is in progress. This happened because super.findClass() triggers loading of dependent classes, which re-enter findClass() and call computeIfAbsent() on the same map. Replace computeIfAbsent with an explicit get → compute → put pattern that does not hold the map's internal lock during class loading, eliminating the recursive update. Guava ImmutableSet and similar classes with cross-addon dependencies were causing DimensionalTrees (and likely other addons) to fail on load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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.



Summary
ImmutableSet<UUID>return type onIsland.getMemberSet()overloads — a prior commit changed these toSet<UUID>to satisfy SonarCloud S4738, but this is a binary-incompatible API change: addons compiled against any prior BentoBox version will throwNoSuchMethodErrorat runtime because the JVM encodes the return type in the method descriptor. Reverted toImmutableSet<UUID>with@SuppressWarnings("java:S4738")and an explanatory comment.IllegalStateException: Recursive updateinAddonClassLoader—computeIfAbsent()onConcurrentHashMapthrows when class loading re-entersfindClass()for dependent classes. Replaced with an explicitget → compute → putpattern that does not hold the map's lock during class loading. This was causing DimensionalTrees (and likely other addons with cross-addon class dependencies) to fail on load.IslandTeamInviteGUITest.testBackButtonClick_notInviteCmd_closesInventory— added missing command mocks (kickCommand,setOwnerCommand,leaveCommand,acceptCommand) needed when the back button builds anIslandTeamGUI; also stubbed the newly-typedgetMemberSet(int)/getMemberSet(int, boolean)overloads inCommonTestSetupsince Mockito no longer auto-stubsImmutableSetwith an empty collection.Test plan
./gradlew buildpasses (2188 tests, 0 failures)javapconfirmsgetMemberSetdescriptors are()Lcom/google/common/collect/ImmutableSet;(binary-compatible with all prior addon JARs)IllegalStateException: Recursive updateon startup🤖 Generated with Claude Code