From 10c614b39740afb3a4afe79a8a12373a5a2eb81e Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Mon, 22 May 2023 15:28:27 +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 --- .../maven/reporting/AbstractMavenReportRenderer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java b/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java index 57e0245..6f50a8e 100644 --- a/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java +++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java @@ -343,7 +343,7 @@ protected void link(String href, String name) { * @see Sink#text(String) */ protected void text(String text) { - if (StringUtils.isEmpty(text)) // Take care of spaces + if (text == null || text.isEmpty()) // Take care of spaces { sink.text("-"); } else { @@ -378,7 +378,7 @@ protected void verbatimText(String text) { * @see Sink#verbatim_() */ protected void verbatimLink(String text, String href) { - if (StringUtils.isEmpty(href)) { + if (href == null || href.isEmpty()) { verbatimText(text); } else { sink.verbatim(); @@ -426,7 +426,7 @@ protected void javaScript(String jsCode) { * @see #applyPattern(String) */ public void linkPatternedText(String text) { - if (StringUtils.isEmpty(text)) { + if (text == null || text.isEmpty()) { text(text); } else { List segments = applyPattern(text); @@ -506,7 +506,7 @@ protected static String propertiesToString(Properties props) { * @return a map of text/href */ private static List applyPattern(String text) { - if (StringUtils.isEmpty(text)) { + if (text == null || text.isEmpty()) { return null; }