Details
Description
Implementation of RSPEC-1905 does not cover correctly cast when done inside method invocation arguments, and constructor call. The following case is not raising any issue, while it should:
import java.util.Collection; import java.util.List; import static java.util.Collections.emptyList; class C { void foo(List<String> p) { Collection<String> v1 = emptyList(); List<String> v2 = emptyList(); foo((List<String>) v1); // Compliant - cast needed foo((List<String>) v2); // Compliant - FN case not properly handled - would be the same with NEW_CLASS_TREE } }
Attachments
Issue Links
- relates to
-
RSPEC-1905 Redundant casts should not be used
- Active