Remove unchecked casts in TagPrefix#4559
Merged
TechLord22 merged 2 commits into1.20.1-v8.0.0from Feb 8, 2026
Merged
Conversation
gustovafing
approved these changes
Feb 7, 2026
YoungOnionMC
approved these changes
Feb 7, 2026
krossgg
reviewed
Feb 7, 2026
src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java
Outdated
Show resolved
Hide resolved
screret
pushed a commit
to screret/GregTech-Modern
that referenced
this pull request
Feb 8, 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.
What
Removes uncheck casts in TagPrefix. As a side effect, removes things being arrays when they did not need to be.
Also adds a few
filter(Objects::nonNull)calls to some of the streams which would otherwise crash.Implementation Details
Some of the streams interpreted
?as a locally captured wildcard instead of a general wildcard, so they had to be turned into for loops.Outcome
Less suppressed warnings. More straightforward code which doesn't turn things into arrays only to turn the arrays into lists right after.
How Was This Tested
Only checked compilation and tests passing.
Potential Compatibility Issues
Changes some API to use
Collection<T>instead ofT[], though I don't know how widely it is used.