spotbugs: suppress 6 design-intentional cast/CT findings#7639
Open
Vest wants to merge 1 commit into
Open
Conversation
Add method/constructor-level @SuppressFBWarnings with one-line justifications for casts and constructor-throws that are intentional by design. - BC_UNCONFIRMED_CAST @ ConcretePersistentTransitionChoice.setChoiceActor: API contract documents @throws ClassCastException for non-PersistentChoiceActor; the cast is the contract. - BC_UNCONFIRMED_CAST @ FactGrouping.process: Only CDOMObject can have facts (per in-code comment); type system can't express this constraint as PCGenScoped is the wider interface. - BC_UNCONFIRMED_CAST_OF_RETURN_VALUE @ LevelInfoFacet.get: Facet's own cache; getComponentSet() always returns ArrayList<PCLevelInfo>. - BC_UNCONFIRMED_CAST_OF_RETURN_VALUE @ UnencumberedArmorFacet.getBestLoad: Facet's own cache; getComponentMap() always returns TreeMap<Load, Set<Object>>. - BC_UNCONFIRMED_CAST_OF_RETURN_VALUE @ UnencumberedLoadFacet.getBestLoad: Facet's own cache; getComponentMap() always returns TreeMap<Load, Set<Object>>. - CT_CONSTRUCTOR_THROW @ AbstractReferenceManufacturer: Abstract class; ManufacturableFactory is required and Objects.requireNonNull is the lightest defense against an unusable instance.
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.
Add method/constructor-level
@SuppressFBWarningswith one-line justifications for casts and constructor-throws that are intentional by design.Suppressions
ConcretePersistentTransitionChoice.setChoiceActor@throws ClassCastExceptionfor non-PersistentChoiceActor; the cast is the contractFactGrouping.processLevelInfoFacet.getgetComponentSet()always returnsArrayList<PCLevelInfo>UnencumberedArmorFacet.getBestLoadgetComponentMap()always returnsTreeMap<Load, Set<Object>>UnencumberedLoadFacet.getBestLoadgetComponentMap()always returnsTreeMap<Load, Set<Object>>AbstractReferenceManufacturerconstructorObjects.requireNonNullis the lightest defense against an unusable instanceSpotBugs delta (XML-verified)
Validation
./gradlew compileJava-> BUILD SUCCESSFUL./gradlew :test --tests "pcgen.cdom.*"-> 2355 tests, 0 failures