refactor: Resolving unchecked-cast warnings in ContractVerifier #6173
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.
#4924
Not entirely sure if this is an acceptable fix because I don't feel too good about using
SuppressWarnings
here (and we generally seem to be against doing that as seen in #4925), but the unchecked cast issue here was caused by(Collection<CtElement>) attributeOfParent...
and(Map<String, ?>) attributeOfParent
.I wasn't sure how to go about fixing these, since they weren't really related to returning
this
orsuper.clone()
and a quick Google search wasn't helpful either (giving suggestions such as this)-- so I'm more than open to alternative ways of fixing this, if there are any!Before
These 2 Warnings appeared when running
mvn compile
after a cleanAfter
Those 2 warnings are gone! :)
@SirYwell would appreciate your thoughts on this, since I believe you've been involved with the effort in clearing out unchecked-cast warnings before 😅