Add test case ensuring we don't incur in FNs

This commit is contained in:
Juan Martín Sotuyo Dodero 2024-11-15 16:13:44 -03:00
parent b264fa14e1
commit aad8e93a2f

View File

@ -2297,4 +2297,20 @@ public class ObtainViaTest {
]]></code> ]]></code>
</test-code> </test-code>
<test-code>
<description>UnusedPrivateMethod #5083 - method reference without target type (3)</description>
<expected-problems>2</expected-problems>
<code><![CDATA[
import java.util.Set;
public class Foo {
private void foo(AnotherUnresolvedType baz) {}
private void foo(UnresolvedType baz) {}
public void bar(Set<UnresolvedType> s) {
s.forEach(this::foo); // Not being able to resolve UnresolvedType and AnotherUnresolvedType means we can't tell which foo is being used here…
}
}
]]></code>
</test-code>
</test-data> </test-data>