[MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) (#79)
* [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 <team@moderne.io>
* Checkstyle
---------
Co-authored-by: Moderne <team@moderne.io>
diff --git a/src/main/java/org/apache/maven/shared/verifier/Verifier.java b/src/main/java/org/apache/maven/shared/verifier/Verifier.java
index 752fdc8..3c2b68e 100644
--- a/src/main/java/org/apache/maven/shared/verifier/Verifier.java
+++ b/src/main/java/org/apache/maven/shared/verifier/Verifier.java
@@ -425,7 +425,7 @@
{
File file = new File( getBasedir(), filename );
- if ( StringUtils.isNotEmpty( encoding ) )
+ if ( encoding != null && !encoding.isEmpty() )
{
return Files.newBufferedReader( file.toPath(), Charset.forName( encoding ) );
}
@@ -1396,7 +1396,7 @@
{
if ( embeddedLauncher == null )
{
- if ( StringUtils.isEmpty( mavenHome ) )
+ if ( mavenHome == null || mavenHome.isEmpty() )
{
embeddedLauncher = Embedded3xLauncher.createFromClasspath();
}
@@ -1761,7 +1761,7 @@
*/
public void setLogFileName( String logFileName )
{
- if ( StringUtils.isEmpty( logFileName ) )
+ if ( logFileName == null || logFileName.isEmpty() )
{
throw new IllegalArgumentException( "log file name unspecified" );
}
@@ -1861,7 +1861,7 @@
private void setForkMode()
{
- if ( StringUtils.isEmpty( mavenHome ) && StringUtils.isEmpty( forkMode ) )
+ if ( ( mavenHome == null || mavenHome.isEmpty() ) && ( forkMode == null || forkMode.isEmpty() ) )
{
forkMode = "auto";
}