From 60aaa1ab36886632a683bf7170aea60e175a2f02 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Mon, 22 May 2023 15:28:26 +0000 Subject: [PATCH] [MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) Last batch of is(Not)Empty for https://issues.apache.org/jira/browse/MNG-6829 These are the smallest change sets, hence why I opened more at the same time. After this we can target the next most often used method from the StringUtils classes. Use this link to re-run the recipe: https://public.moderne.io/recipes/org.openrewrite.java.migrate.apache.commons.lang.IsNotEmptyToJdk?organizationId=QXBhY2hlIE1hdmVu Co-authored-by: Moderne --- .../plugins/surefire/report/AbstractSurefireReportMojo.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java index a62d15bb0b..27812808f6 100644 --- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java +++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java @@ -49,7 +49,6 @@ import static java.util.Collections.addAll; import static org.apache.maven.plugins.surefire.report.SurefireReportParser.hasReportFiles; -import static org.apache.maven.shared.utils.StringUtils.isEmpty; /** * Abstract base class for reporting test results using Surefire. @@ -272,7 +271,7 @@ private String determineXrefLocation() { if (linkXRef) { String relativePath = PathTool.getRelativePath(getOutputDirectory(), xrefLocation.getAbsolutePath()); - if (isEmpty(relativePath)) { + if (relativePath == null || relativePath.isEmpty()) { relativePath = "."; } relativePath = relativePath + "/" + xrefLocation.getName();