From d692f718eec82e858fb2d820a70e49df162ea289 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Mon, 22 May 2023 15:28:44 +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/plugin/docck/AbstractCheckDocumentationMojo.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java b/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java index f826ed6..02324f4 100644 --- a/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java +++ b/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java @@ -218,13 +218,13 @@ private void setupProxy( HttpClientBuilder httpClientBuilder ) int proxyPort = settingsProxy.getPort(); - if ( StringUtils.isNotEmpty( proxyHost ) ) + if ( proxyHost != null && !proxyHost.isEmpty() ) { httpClientBuilder.setProxy( new HttpHost( proxyHost, proxyPort ) ); getLog().info( "Using proxy [" + proxyHost + "] at port [" + proxyPort + "]." ); - if ( StringUtils.isNotEmpty( proxyUsername ) ) + if ( proxyUsername != null && !proxyUsername.isEmpty() ) { getLog().info( "Using proxy user [" + proxyUsername + "]." ); @@ -434,7 +434,7 @@ private void checkProjectLicenses( MavenProject project, DocumentationReporter r else { String url = license.getUrl(); - if ( StringUtils.isEmpty( url ) ) + if ( url == null || url.isEmpty() ) { reporter.error( "pom.xml is missing the // tag for the license \'" + license.getName() + "\'." );