You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "timtebeek (via GitHub)" <gi...@apache.org> on 2023/05/10 11:29:19 UTC

[GitHub] [maven-archetype] timtebeek opened a new pull request, #146: [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

timtebeek opened a new pull request, #146:
URL: https://github.com/apache/maven-archetype/pull/146

   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-archetype] elharo merged pull request #146: [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo merged PR #146:
URL: https://github.com/apache/maven-archetype/pull/146


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-archetype] timtebeek commented on a diff in pull request #146: [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

Posted by "timtebeek (via GitHub)" <gi...@apache.org>.
timtebeek commented on code in PR #146:
URL: https://github.com/apache/maven-archetype/pull/146#discussion_r1193122378


##########
maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/creation/DefaultArchetypeCreationConfigurator.java:
##########
@@ -144,7 +144,7 @@ public Properties configureArchetypeCreation( MavenProject project, Boolean inte
                         getLogger().debug( "Asking for project's package" );
                         archetypeConfiguration.setProperty(
                                                             Constants.PACKAGE,
-                                                            archetypeCreationQueryer.getPackage( StringUtils.isEmpty( resolvedPackage ) ? archetypeConfiguration.getDefaultValue( Constants.PACKAGE )
+                                                            archetypeCreationQueryer.getPackage( (resolvedPackage == null || resolvedPackage.isEmpty()) ? archetypeConfiguration.getDefaultValue( Constants.PACKAGE )

Review Comment:
   ```suggestion
                                                               archetypeCreationQueryer.getPackage( ( resolvedPackage == null || resolvedPackage.isEmpty() ) ? archetypeConfiguration.getDefaultValue( Constants.PACKAGE )
   ```



##########
maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/DefaultArchetypeGenerationConfigurator.java:
##########
@@ -210,7 +210,7 @@ else if ( archetypeArtifactManager.isOldArchetype( ad.getGroupId(), ad.getArtifa
                         {
                             String defaultValue = archetypeConfiguration.getDefaultValue( requiredProperty );
 
-                            if ( Constants.PACKAGE.equals( requiredProperty ) && StringUtils.isEmpty( defaultValue ) )
+                            if ( Constants.PACKAGE.equals( requiredProperty ) && (defaultValue == null || defaultValue.isEmpty()) )

Review Comment:
   ```suggestion
                               if ( Constants.PACKAGE.equals( requiredProperty ) && ( defaultValue == null || defaultValue.isEmpty() ) )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-archetype] timtebeek commented on a diff in pull request #146: [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

Posted by "timtebeek (via GitHub)" <gi...@apache.org>.
timtebeek commented on code in PR #146:
URL: https://github.com/apache/maven-archetype/pull/146#discussion_r1193122274


##########
archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java:
##########
@@ -569,7 +569,7 @@ private void processFilesetModule( final String rootArtifactId, final String art
             processFilesetModule( rootArtifactId, moduleArtifactId,
                                   archetypeResources, new File( moduleOutputDirectoryFile, Constants.ARCHETYPE_POM ),
                                   archetypeZipFile,
-                                  ( StringUtils.isEmpty( moduleOffset ) ? "" : ( moduleOffset + "/" ) )
+                                  ( (moduleOffset == null || moduleOffset.isEmpty()) ? "" : ( moduleOffset + "/" ) )

Review Comment:
   ```suggestion
                                     ( ( moduleOffset == null || moduleOffset.isEmpty() ) ? "" : ( moduleOffset + "/" ) )
   ```



##########
archetype-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java:
##########
@@ -415,7 +414,7 @@ static boolean matchesLayout( String repoLayout, String mirrorLayout )
         boolean result = false;
 
         // simple checks first to short circuit processing below.
-        if ( StringUtils.isEmpty( mirrorLayout ) || WILDCARD.equals( mirrorLayout ) )
+        if ( (mirrorLayout == null || mirrorLayout.isEmpty()) || WILDCARD.equals( mirrorLayout ) )

Review Comment:
   ```suggestion
           if ( ( mirrorLayout == null || mirrorLayout.isEmpty() ) || WILDCARD.equals( mirrorLayout ) )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-archetype] timtebeek commented on a diff in pull request #146: [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

Posted by "timtebeek (via GitHub)" <gi...@apache.org>.
timtebeek commented on code in PR #146:
URL: https://github.com/apache/maven-archetype/pull/146#discussion_r1193122169


##########
archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java:
##########
@@ -323,12 +323,12 @@ private int copyFiles( String directory, List<String> fileSetResources, boolean
 
     private String getEncoding( String archetypeEncoding )
     {
-        return StringUtils.isEmpty( archetypeEncoding ) ? "UTF-8" : archetypeEncoding;
+        return (archetypeEncoding == null || archetypeEncoding.isEmpty()) ? "UTF-8" : archetypeEncoding;

Review Comment:
   ```suggestion
           return ( archetypeEncoding == null || archetypeEncoding.isEmpty() ) ? "UTF-8" : archetypeEncoding;
   ```



##########
archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java:
##########
@@ -323,12 +323,12 @@ private int copyFiles( String directory, List<String> fileSetResources, boolean
 
     private String getEncoding( String archetypeEncoding )
     {
-        return StringUtils.isEmpty( archetypeEncoding ) ? "UTF-8" : archetypeEncoding;
+        return (archetypeEncoding == null || archetypeEncoding.isEmpty()) ? "UTF-8" : archetypeEncoding;
     }
 
     private String getOffsetSeparator( String moduleOffset )
     {
-        return StringUtils.isEmpty( moduleOffset ) ? "/" : ( "/" + moduleOffset + "/" );
+        return (moduleOffset == null || moduleOffset.isEmpty()) ? "/" : ( "/" + moduleOffset + "/" );

Review Comment:
   ```suggestion
           return ( moduleOffset == null || moduleOffset.isEmpty() ) ? "/" : ( "/" + moduleOffset + "/" );
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-archetype] timtebeek commented on a diff in pull request #146: [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

Posted by "timtebeek (via GitHub)" <gi...@apache.org>.
timtebeek commented on code in PR #146:
URL: https://github.com/apache/maven-archetype/pull/146#discussion_r1193122130


##########
archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeFilesResolver.java:
##########
@@ -71,7 +71,7 @@ public List<String> getFilteredFiles( List<String> files, String filtered )
     public List<String> filterFiles( String moduleOffset, FileSet fileSet, List<String> archetypeResources )
     {
         ListScanner scanner = new ListScanner();
-        scanner.setBasedir( ( StringUtils.isEmpty( moduleOffset ) ? "" : ( moduleOffset + File.separatorChar ) )
+        scanner.setBasedir( ( (moduleOffset == null || moduleOffset.isEmpty()) ? "" : ( moduleOffset + File.separatorChar ) )

Review Comment:
   ```suggestion
           scanner.setBasedir( ( ( moduleOffset == null || moduleOffset.isEmpty() ) ? "" : ( moduleOffset + File.separatorChar ) )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-archetype] timtebeek commented on a diff in pull request #146: [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

Posted by "timtebeek (via GitHub)" <gi...@apache.org>.
timtebeek commented on code in PR #146:
URL: https://github.com/apache/maven-archetype/pull/146#discussion_r1193122329


##########
maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java:
##########
@@ -329,7 +329,7 @@ public void execute()
             }
 
             String errors = errorWriter.toString();
-            if ( !StringUtils.isEmpty( errors ) )
+            if ( !(errors == null || errors.isEmpty()) )

Review Comment:
   ```suggestion
               if ( !( errors == null || errors.isEmpty() ) )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org