You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2023/05/23 13:00:30 UTC

[maven-surefire] branch master updated: [MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) (#641)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/master by this push:
     new 2d739c24f [MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) (#641)
2d739c24f is described below

commit 2d739c24ff2c0842bb4e6c32ee9461ee2f6778ea
Author: Tim te Beek <ti...@gmail.com>
AuthorDate: Tue May 23 15:00:24 2023 +0200

    [MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) (#641)
    
    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 <te...@moderne.io>
---
 .../maven/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 a62d15bb0..27812808f 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 org.codehaus.plexus.interpolation.RegexBasedInterpolator;
 
 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 @@ public abstract class AbstractSurefireReportMojo extends AbstractMavenReport {
 
         if (linkXRef) {
             String relativePath = PathTool.getRelativePath(getOutputDirectory(), xrefLocation.getAbsolutePath());
-            if (isEmpty(relativePath)) {
+            if (relativePath == null || relativePath.isEmpty()) {
                 relativePath = ".";
             }
             relativePath = relativePath + "/" + xrefLocation.getName();