From c93f4cad9b87d7987b65daaa023c56b31223cae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 28 Jan 2023 14:15:18 -0300 Subject: [PATCH] Revamp MissingStaticMethodInNonInstantiatableClass - Somewhat simplify the XPath - Make it more robust: - private static methods are not ok - Check actual return statement types rather than the method signature, as inheritance may muddy the waters - We don't need the methods from the nested class to be public, just not private - Same applies to the nested class itself --- .../resources/category/java/errorprone.xml | 82 +++++++++---------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index 326207ef35..b6889d8454 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -2351,52 +2351,44 @@ See the property `annotations`.