From cd3df938a06c577dd25f3f12e3af030b04763ef6 Mon Sep 17 00:00:00 2001 From: timis1 <12120641+timis1@users.noreply.github.com> Date: Mon, 20 Feb 2023 21:14:46 +0200 Subject: [PATCH] JAVA-18132 Upgrade custom-pmd module to JDK 11 (#13500) Co-authored-by: timis1 --- custom-pmd/pom.xml | 8 ++++---- .../com/baeldung/pmd/UnitTestNamingConventionRule.java | 3 ++- pom.xml | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/custom-pmd/pom.xml b/custom-pmd/pom.xml index 550f96de33..38a5e30404 100644 --- a/custom-pmd/pom.xml +++ b/custom-pmd/pom.xml @@ -44,10 +44,10 @@ - 3.7.0 - 6.0.1 - 1.8 - 1.8 + 3.10.0 + 6.53.0 + 11 + 11 \ No newline at end of file diff --git a/custom-pmd/src/main/java/com/baeldung/pmd/UnitTestNamingConventionRule.java b/custom-pmd/src/main/java/com/baeldung/pmd/UnitTestNamingConventionRule.java index e30164ac4f..a652bd1bfa 100644 --- a/custom-pmd/src/main/java/com/baeldung/pmd/UnitTestNamingConventionRule.java +++ b/custom-pmd/src/main/java/com/baeldung/pmd/UnitTestNamingConventionRule.java @@ -18,8 +18,9 @@ public class UnitTestNamingConventionRule extends AbstractJavaRule { "UnitTest", "jmhTest"); + @Override public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { - String className = node.getImage(); + String className = node.getSimpleName(); Objects.requireNonNull(className); if (className.endsWith("SpringContextTest")) { diff --git a/pom.xml b/pom.xml index d9519fa219..33ea7a7c5f 100644 --- a/pom.xml +++ b/pom.xml @@ -340,7 +340,6 @@ core-groovy-modules core-java-modules couchbase - custom-pmd drools @@ -609,7 +608,6 @@ core-groovy-modules core-java-modules couchbase - custom-pmd drools @@ -922,6 +920,7 @@ core-java-modules/core-java-networking-3 core-java-modules/core-java-strings core-java-modules/core-java-httpclient + custom-pmd spring-core-6 data-structures ddd-contexts @@ -1131,6 +1130,7 @@ core-java-modules/core-java-networking-3 core-java-modules/core-java-strings core-java-modules/core-java-httpclient + custom-pmd spring-core-6 data-structures ddd-contexts