Skip to content

Commit f40882e

Browse files
[MNG-6829] Replace StringUtils#isEmpty(String) and #isNotEmpty(String) (#97)
Continuation of https://issues.apache.org/jira/browse/MNG-6829 Review requested of @elharo 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 <[email protected]>
1 parent 047e8c8 commit f40882e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ private String getBottomText()
332332
*/
333333
private void copyRequiredResources( String dir )
334334
{
335-
if ( StringUtils.isNotEmpty( stylesheet ) )
335+
if ( stylesheet != null && !stylesheet.isEmpty() )
336336
{
337337
File stylesheetFile = new File( stylesheet );
338338
File destStylesheetFile = new File( dir, "stylesheet.css" );
@@ -493,7 +493,7 @@ protected void executeReport( Locale locale )
493493
private String getTemplateDir()
494494
{
495495
// Check if overridden
496-
if ( StringUtils.isEmpty( templateDir ) )
496+
if ( templateDir == null || templateDir.isEmpty() )
497497
{
498498
if ( javadocTemplatesVersion.isAtLeast( "1.8" ) )
499499
{
@@ -524,7 +524,7 @@ private void setJavadocTemplatesVersion()
524524
{
525525
JavaVersion javaVersion = JavaVersion.JAVA_SPECIFICATION_VERSION;
526526

527-
if ( StringUtils.isNotEmpty( javadocVersion ) )
527+
if ( javadocVersion != null && !javadocVersion.isEmpty() )
528528
{
529529
javadocTemplatesVersion = JavaVersion.parse( javadocVersion );
530530
}
@@ -592,7 +592,7 @@ private Path getJavadocLocation()
592592
// Special case: using the site:stage goal
593593
String stagingDirectory = System.getProperty( "stagingDirectory" );
594594

595-
if ( StringUtils.isNotEmpty( stagingDirectory ) )
595+
if ( stagingDirectory != null && !stagingDirectory.isEmpty() )
596596
{
597597
String javadocDestDir = getJavadocDir().getName();
598598
boolean javadocAggregate = JxrReportUtil.isJavadocAggregated( project );

maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReportUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected static String getMavenJavadocPluginBasicOption( MavenProject project,
134134
}
135135

136136
String attribute = pluginConf.getAttribute( optionName );
137-
if ( StringUtils.isNotEmpty( attribute ) )
137+
if ( attribute != null && !attribute.isEmpty() )
138138
{
139139
return attribute;
140140
}

0 commit comments

Comments
 (0)