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

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


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

commit 9f821e9be13810b8938cf3ac953a24471373f956
Author: Tim te Beek <timteb...@gmail.com>
AuthorDate: Mon May 22 15:28:22 2023 +0000

    [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 <t...@moderne.io>
---
 .../apache/maven/plugin/compiler/AbstractCompilerMojo.java | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java 
b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
index ad68b4f..f975bab 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
@@ -697,7 +697,7 @@ public abstract class AbstractCompilerMojo extends 
AbstractMojo {
 
         compilerConfiguration.setImplicitOption(implicit);
 
-        if (debug && StringUtils.isNotEmpty(debuglevel)) {
+        if (debug && (debuglevel != null && !debuglevel.isEmpty())) {
             String[] split = StringUtils.split(debuglevel, ",");
             for (String aSplit : split) {
                 if (!(aSplit.equalsIgnoreCase("none")
@@ -779,7 +779,7 @@ public abstract class AbstractCompilerMojo extends 
AbstractMojo {
         compilerConfiguration.setFork(fork);
 
         if (fork) {
-            if (!StringUtils.isEmpty(meminitial)) {
+            if (!(meminitial == null || meminitial.isEmpty())) {
                 String value = getMemoryValue(meminitial);
 
                 if (value != null) {
@@ -789,7 +789,7 @@ public abstract class AbstractCompilerMojo extends 
AbstractMojo {
                 }
             }
 
-            if (!StringUtils.isEmpty(maxmem)) {
+            if (!(maxmem == null || maxmem.isEmpty())) {
                 String value = getMemoryValue(maxmem);
 
                 if (value != null) {
@@ -960,14 +960,14 @@ public abstract class AbstractCompilerMojo extends 
AbstractMojo {
                         key = "-" + key;
                     }
 
-                    if (key.startsWith("-A") && StringUtils.isNotEmpty(value)) 
{
+                    if (key.startsWith("-A") && (value != null && 
!value.isEmpty())) {
                         compilerConfiguration.addCompilerCustomArgument(key + 
"=" + value, null);
                     } else {
                         compilerConfiguration.addCompilerCustomArgument(key, 
value);
                     }
                 }
             }
-            if (!StringUtils.isEmpty(effectiveCompilerArgument)) {
+            if (!(effectiveCompilerArgument == null || 
effectiveCompilerArgument.isEmpty())) {
                 
compilerConfiguration.addCompilerCustomArgument(effectiveCompilerArgument, 
null);
             }
             if (compilerArgs != null) {
@@ -1310,7 +1310,7 @@ public abstract class AbstractCompilerMojo extends 
AbstractMojo {
     private Set<File> getCompileSources(Compiler compiler, 
CompilerConfiguration compilerConfiguration)
             throws MojoExecutionException, CompilerException {
         String inputFileEnding = 
compiler.getInputFileEnding(compilerConfiguration);
-        if (StringUtils.isEmpty(inputFileEnding)) {
+        if (inputFileEnding == null || inputFileEnding.isEmpty()) {
             // see MCOMPILER-199 GroovyEclipseCompiler doesn't set 
inputFileEnding
             // so we can presume it's all files from the source directory
             inputFileEnding = ".*";
@@ -1710,7 +1710,7 @@ public abstract class AbstractCompilerMojo extends 
AbstractMojo {
     }
 
     private boolean hasInputFileTreeChanged(DirectoryScanResult dsr) {
-        return (dsr.getFilesAdded().length > 0 || dsr.getFilesRemoved().length 
> 0);
+        return dsr.getFilesAdded().length > 0 || dsr.getFilesRemoved().length 
> 0;
     }
 
     public void setTarget(String target) {

Reply via email to