From aad8e93a2f71ed5daa53c892e24eb63ea06a8418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 15 Nov 2024 16:13:44 -0300 Subject: [PATCH] Add test case ensuring we don't incur in FNs --- .../bestpractices/xml/UnusedPrivateMethod.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml index 5f38fdcf2e..12b92436d9 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml @@ -2297,4 +2297,20 @@ public class ObtainViaTest { ]]> + + UnusedPrivateMethod #5083 - method reference without target type (3) + 2 + s) { + s.forEach(this::foo); // Not being able to resolve UnresolvedType and AnotherUnresolvedType means we can't tell which foo is being used hereā€¦ + } +} + ]]> + +