commit | 7fe99102777df58c75afa84576ee9cb518e3353f | [log] [tgz] |
---|---|---|
author | Tim te Beek <timtebeek@gmail.com> | Tue May 23 14:58:06 2023 +0200 |
committer | GitHub <noreply@github.com> | Tue May 23 08:58:06 2023 -0400 |
tree | 99a5fa27be275f3c2227e845236d12b6bb55a990 | |
parent | 815a4734c7765c71fb0620f4a3c66c7af3e67501 [diff] |
[MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) (#159) 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>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java index 3ebce69..f08406e 100644 --- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java +++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java
@@ -158,12 +158,12 @@ { int exitCode = CommandLineUtils.executeCommandLine( cmd, out, err ); - String output = ( StringUtils.isEmpty( out.getOutput() ) ? null : '\n' + out.getOutput().trim() ); + String output = StringUtils.isEmpty( out.getOutput() ) ? null : '\n' + out.getOutput().trim(); if ( exitCode != 0 ) { - if ( StringUtils.isNotEmpty( output ) ) + if ( output != null && !output.isEmpty() ) { // Reconsider to use WARN / ERROR ? // getLog().error( output ); @@ -185,7 +185,7 @@ throw new MojoExecutionException( msg.toString() ); } - if ( StringUtils.isNotEmpty( output ) ) + if ( output != null && !output.isEmpty() ) { //getLog().info( output ); for ( String outputLine : output.split( "\n" ) )