Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
[MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) (#3
Browse files Browse the repository at this point in the history
)

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 <team@moderne.io>
  • Loading branch information
timtebeek and TeamModerne committed May 23, 2023
1 parent 4f66af7 commit 4663f8d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "]." );

Expand Down Expand Up @@ -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 <licenses>/<license>/<url> tag for the license \'"
+ license.getName() + "\'." );
Expand Down

0 comments on commit 4663f8d

Please sign in to comment.