From 429ad5b9fcd3e700f8ce6d3f42cc135a740e20ba Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 24 May 2023 13:08:09 +0200 Subject: [PATCH] [MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) (#58) 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 --- .../java/org/apache/maven/plugins/install/InstallFileMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java b/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java index 86d87af9..a2cc7028 100644 --- a/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java +++ b/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java @@ -218,7 +218,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { ArtifactType artifactType = repositorySystemSession.getArtifactTypeRegistry().get(packaging); if (artifactType != null - && StringUtils.isEmpty(classifier) + && (classifier == null || classifier.isEmpty()) && !StringUtils.isEmpty(artifactType.getClassifier())) { classifier = artifactType.getClassifier(); }