Refactor command argument checks and enhance null safety in various c…#2807
Merged
tastybento merged 2 commits intodevelopfrom Mar 1, 2026
Merged
Refactor command argument checks and enhance null safety in various c…#2807tastybento merged 2 commits intodevelopfrom
tastybento merged 2 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors several utility, command, and panel classes to simplify logic, remove unused code/imports, and strengthen nullability contracts (notably via JDT @NonNull and Java 21 SequencedCollection APIs) across the BentoBox codebase.
Changes:
- Replace manual “last element” indexing with Java 21
getFirst/getLast/removeLastin placeholder grouping and navigation. - Add/adjust
@NonNullannotations and implement value-basedequals/hashCodefor expiring collection wrappers. - Simplify a few boolean checks and remove unused imports/modifiers.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/world/bentobox/bentobox/util/Util.java | Removes unused import. |
| src/main/java/world/bentobox/bentobox/util/PlaceholderGrouper.java | Uses getFirst/getLast for sorted index bounds. |
| src/main/java/world/bentobox/bentobox/util/ExpiringSet.java | Adds @NonNull type-use annotations; refines equals. |
| src/main/java/world/bentobox/bentobox/util/ExpiringMap.java | Adds @NonNull annotations; adds equals/hashCode. |
| src/main/java/world/bentobox/bentobox/panels/PlaceholderListPanel.java | Uses removeLast/getLast for navigation path handling. |
| src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java | Removes unused import. |
| src/main/java/world/bentobox/bentobox/managers/island/IslandGrid.java | Simplifies overlap check boolean logic. |
| src/main/java/world/bentobox/bentobox/managers/IslandDeletionManager.java | Removes unused list used during startup deletion scan. |
| src/main/java/world/bentobox/bentobox/lists/Flags.java | Removes redundant final from static method. |
| src/main/java/world/bentobox/bentobox/hooks/placeholders/PlaceholderAPIHook.java | Removes unused import. |
| src/main/java/world/bentobox/bentobox/hooks/OraxenHook.java | Simplifies plugin presence check. |
| src/main/java/world/bentobox/bentobox/commands/BentoBoxRankCommand.java | Simplifies tab-complete branching conditions. |
| src/main/java/world/bentobox/bentobox/blueprints/dataobjects/BlueprintTrialSpawner.java | Adds @NonNull to loot table map accessors; adjusts toString. |
| src/main/java/world/bentobox/bentobox/blueprints/Blueprint.java | Removes fallback initialization in getName(). |
| src/main/java/world/bentobox/bentobox/api/panels/reader/PanelTemplateRecord.java | Marks toString() as @NonNull. |
| src/main/java/world/bentobox/bentobox/api/configuration/ConfigObject.java | Removes unused import. |
| src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java | Adds array type-use nullability annotations for args. |
| src/main/java/world/bentobox/bentobox/api/addons/exceptions/InvalidAddonFormatException.java | Adds suppression annotation for printStackTrace(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/world/bentobox/bentobox/blueprints/Blueprint.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.




…lasses