Details
Description
In SONARJAVA-3468, we removed many FP with ambiguous method references.
Hovewer, we are still reporting FP when the method reference is a varargs.
static class Vargargs{ static String varargs(String... arg) { return null; } } foo((Function<String, String>) Vargargs::varargs); // Compliant, cast is mandatory foo((Supplier<String>) Vargargs::varargs); // Compliant, cast is mandatory void foo(Supplier<String> supplier) { } void foo(Function<String, String> function) { }
Attachments
Issue Links
- relates to
-
SONARJAVA-3468 FP on S1905 when casted argument is an ambiguous method reference.
-
- Closed
-
-
RSPEC-1905 Redundant casts should not be used
- Active
- links to