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-plugin-tools.git

commit 09f7b97d428fb65b34a6367cf180f4981b289a57
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Tue Nov 17 03:48:46 2026 +0000

    Replace remaining StringUtils and Commons calls with the JDK
---
 .../maven/plugin/plugin/report/GoalRenderer.java   | 15 +++----
 .../plugin/report/PluginOverviewRenderer.java      |  5 +--
 .../scanner/DefaultMojoAnnotationsScanner.java     |  4 +-
 .../maven/tools/plugin/javadoc/JavadocSite.java    |  6 ++-
 .../generator/PluginDescriptorFilesGenerator.java  | 49 ++++++++++++++--------
 5 files changed, 48 insertions(+), 31 deletions(-)

diff --git 
a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java
 
b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java
index f1c41a6e..46752d6b 100644
--- 
a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java
+++ 
b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java
@@ -87,10 +87,10 @@ public class GoalRenderer extends 
AbstractPluginReportRenderer {
         renderDescription("fullname", descriptor.getPluginDescriptor().getId() 
+ ":" + descriptor.getGoal(), false);
 
         String context = "goal " + descriptor.getGoal();
-        if (StringUtils.isNotEmpty(descriptor.getDeprecated())) {
+        if (descriptor.getDeprecated() != null && 
!descriptor.getDeprecated().isEmpty()) {
             renderDescription("deprecated", 
getXhtmlWithValidatedLinks(descriptor.getDeprecated(), context), true);
         }
-        if (StringUtils.isNotEmpty(descriptor.getDescription())) {
+        if (descriptor.getDescription() != null && 
!descriptor.getDescription().isEmpty()) {
             renderDescription("description", 
getXhtmlWithValidatedLinks(descriptor.getDescription(), context), true);
         } else {
             renderDescription("description", getI18nString("nodescription"), 
false);
@@ -268,7 +268,7 @@ public class GoalRenderer extends 
AbstractPluginReportRenderer {
         String description;
         String context = "Parameter " + parameter.getName() + " in goal " + 
descriptor.getGoal();
         renderDeprecatedParameterDescription(parameter.getDeprecated(), 
context);
-        if (StringUtils.isNotEmpty(parameter.getDescription())) {
+        if (parameter.getDescription() != null && 
!parameter.getDescription().isEmpty()) {
             description = 
getXhtmlWithValidatedLinks(parameter.getDescription(), context);
         } else {
             description = getI18nString("nodescription");
@@ -297,7 +297,8 @@ public class GoalRenderer extends 
AbstractPluginReportRenderer {
             String context = "Parameter " + parameter.getName() + " in goal " 
+ descriptor.getGoal();
             renderDeprecatedParameterDescription(parameter.getDeprecated(), 
context);
             sink.division();
-            if (StringUtils.isNotEmpty(parameter.getDescription())) {
+            if (parameter.getDescription() != null
+                    && !parameter.getDescription().isEmpty()) {
                 
sink.rawText(getXhtmlWithValidatedLinks(parameter.getDescription(), context));
             } else {
                 sink.text(getI18nString("nodescription"));
@@ -308,7 +309,7 @@ public class GoalRenderer extends 
AbstractPluginReportRenderer {
             Map.Entry<String, Optional<String>> typeAndLink = 
getLinkedType(parameter, false);
             renderDetail(getI18nString("parameter.type"), 
typeAndLink.getKey(), typeAndLink.getValue());
 
-            if (StringUtils.isNotEmpty(parameter.getSince())) {
+            if (parameter.getSince() != null && 
!parameter.getSince().isEmpty()) {
                 renderDetail(getI18nString("parameter.since"), 
parameter.getSince());
             }
 
@@ -341,7 +342,7 @@ public class GoalRenderer extends 
AbstractPluginReportRenderer {
     }
 
     private void renderDeprecatedParameterDescription(String deprecated, 
String context) {
-        if (StringUtils.isNotEmpty(deprecated)) {
+        if (deprecated != null && !deprecated.isEmpty()) {
             String deprecatedXhtml = getXhtmlWithValidatedLinks(deprecated, 
context);
             sink.division();
             sink.inline(InlineSemantics.strong());
@@ -355,7 +356,7 @@ public class GoalRenderer extends 
AbstractPluginReportRenderer {
     }
 
     private void renderTableCellDetail(String nameKey, String value) {
-        if (StringUtils.isNotEmpty(value)) {
+        if (value != null && !value.isEmpty()) {
             sink.lineBreak();
             sink.inline(InlineSemantics.strong());
             sink.text(getI18nString(nameKey));
diff --git 
a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
 
b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
index 10adb0e3..1654999e 100644
--- 
a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
+++ 
b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.maven.doxia.markup.Markup;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
@@ -144,7 +143,7 @@ class PluginOverviewRenderer extends 
AbstractPluginReportRenderer {
             }
 
             sink.tableCell();
-            if (StringUtils.isNotEmpty(mojo.getDeprecated())) {
+            if (mojo.getDeprecated() != null && 
!mojo.getDeprecated().isEmpty()) {
                 sink.division();
                 sink.inline(InlineSemantics.strong());
                 sink.text(getI18nString("goal.deprecated"));
@@ -157,7 +156,7 @@ class PluginOverviewRenderer extends 
AbstractPluginReportRenderer {
             }
 
             String description;
-            if (StringUtils.isNotEmpty(mojo.getDescription())) {
+            if (mojo.getDescription() != null && 
!mojo.getDescription().isEmpty()) {
                 description = mojo.getDescription();
             } else {
                 description = getI18nString("goal.nodescription");
diff --git 
a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java
 
b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java
index e9d8dca3..03288ff4 100644
--- 
a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java
+++ 
b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java
@@ -53,7 +53,6 @@ import 
org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors.Mojo
 import 
org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors.MojoFieldVisitor;
 import 
org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors.MojoParameterVisitor;
 import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.reflection.Reflector;
 import org.codehaus.plexus.util.reflection.ReflectorException;
 import org.objectweb.asm.ClassReader;
@@ -396,7 +395,8 @@ public class DefaultMojoAnnotationsScanner implements 
MojoAnnotationsScanner {
                         }
                     }
 
-                    if 
(StringUtils.isEmpty(componentAnnotationContent.getRoleClassName())) {
+                    if (componentAnnotationContent.getRoleClassName() == null
+                            || 
componentAnnotationContent.getRoleClassName().isEmpty()) {
                         
componentAnnotationContent.setRoleClassName(mojoComponentVisitor.getClassName());
                     }
                 }
diff --git 
a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/javadoc/JavadocSite.java
 
b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/javadoc/JavadocSite.java
index 3c72e65e..356b5e98 100644
--- 
a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/javadoc/JavadocSite.java
+++ 
b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/javadoc/JavadocSite.java
@@ -506,12 +506,14 @@ class JavadocSite {
         if (settings != null && settings.getActiveProxy() != null) {
             Proxy activeProxy = settings.getActiveProxy();
 
-            if (StringUtils.isNotEmpty(activeProxy.getHost())
+            if ((activeProxy.getHost() != null && 
!activeProxy.getHost().isEmpty())
                     && (url == null || 
!isNonProxyHost(activeProxy.getNonProxyHosts(), url.getHost()))) {
                 HttpHost proxy = new HttpHost(activeProxy.getHost(), 
activeProxy.getPort());
                 builder.setProxy(proxy);
 
-                if (StringUtils.isNotEmpty(activeProxy.getUsername()) && 
activeProxy.getPassword() != null) {
+                if ((activeProxy.getUsername() != null
+                                && !activeProxy.getUsername().isEmpty())
+                        && activeProxy.getPassword() != null) {
                     Credentials credentials =
                             new 
UsernamePasswordCredentials(activeProxy.getUsername(), 
activeProxy.getPassword());
 
diff --git 
a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGenerator.java
 
b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGenerator.java
index bf3a6483..6a48de0b 100644
--- 
a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGenerator.java
+++ 
b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGenerator.java
@@ -258,7 +258,8 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
         //
         // 
----------------------------------------------------------------------
 
-        if 
(StringUtils.isNotEmpty(mojoDescriptor.getDependencyResolutionRequired())) {
+        if (mojoDescriptor.getDependencyResolutionRequired() != null
+                && 
!mojoDescriptor.getDependencyResolutionRequired().isEmpty()) {
             GeneratorUtils.element(
                     w,
                     isV4 ? "dependencyResolution" : 
"requiresDependencyResolution",
@@ -312,7 +313,7 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
         //
         // 
----------------------------------------------------------------------
 
-        if (StringUtils.isNotEmpty(mojoDescriptor.getPhase())) {
+        if (mojoDescriptor.getPhase() != null && 
!mojoDescriptor.getPhase().isEmpty()) {
             GeneratorUtils.element(w, "phase", mojoDescriptor.getPhase());
         }
 
@@ -320,15 +321,18 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
         //
         // 
----------------------------------------------------------------------
 
-        if (StringUtils.isNotEmpty(mojoDescriptor.getExecutePhase())) {
+        if (mojoDescriptor.getExecutePhase() != null
+                && !mojoDescriptor.getExecutePhase().isEmpty()) {
             GeneratorUtils.element(w, "executePhase", 
mojoDescriptor.getExecutePhase());
         }
 
-        if (StringUtils.isNotEmpty(mojoDescriptor.getExecuteGoal())) {
+        if (mojoDescriptor.getExecuteGoal() != null
+                && !mojoDescriptor.getExecuteGoal().isEmpty()) {
             GeneratorUtils.element(w, "executeGoal", 
mojoDescriptor.getExecuteGoal());
         }
 
-        if (StringUtils.isNotEmpty(mojoDescriptor.getExecuteLifecycle())) {
+        if (mojoDescriptor.getExecuteLifecycle() != null
+                && !mojoDescriptor.getExecuteLifecycle().isEmpty()) {
             GeneratorUtils.element(w, "executeLifecycle", 
mojoDescriptor.getExecuteLifecycle());
         }
 
@@ -378,7 +382,8 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
         //
         // 
----------------------------------------------------------------------
 
-        if (StringUtils.isNotEmpty(mojoDescriptor.getComponentConfigurator())) 
{
+        if (mojoDescriptor.getComponentConfigurator() != null
+                && !mojoDescriptor.getComponentConfigurator().isEmpty()) {
             w.startElement("configurator");
             w.writeText(mojoDescriptor.getComponentConfigurator());
             w.endElement();
@@ -388,7 +393,9 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
         //
         // 
----------------------------------------------------------------------
 
-        if (!isV4 && 
StringUtils.isNotEmpty(mojoDescriptor.getComponentComposer())) {
+        if (!isV4
+                && (mojoDescriptor.getComponentComposer() != null
+                        && !mojoDescriptor.getComponentComposer().isEmpty())) {
             w.startElement("composer");
             w.writeText(mojoDescriptor.getComponentComposer());
             w.endElement();
@@ -422,7 +429,7 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
         if (mojoDescriptor.getSince() != null) {
             w.startElement("since");
 
-            if (StringUtils.isEmpty(mojoDescriptor.getSince())) {
+            if (mojoDescriptor.getSince() == null || 
mojoDescriptor.getSince().isEmpty()) {
                 w.writeText("No version given");
             } else {
                 w.writeText(mojoDescriptor.getSince());
@@ -438,7 +445,8 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
         if (mojoDescriptor.getDeprecated() != null) {
             w.startElement("deprecated");
 
-            if (StringUtils.isEmpty(mojoDescriptor.getDeprecated())) {
+            if (mojoDescriptor.getDeprecated() == null
+                    || mojoDescriptor.getDeprecated().isEmpty()) {
                 w.writeText("No reason given");
             } else {
                 w.writeText(getTextValue(type, containsXhtmlTextValues, 
mojoDescriptor.getDeprecated()));
@@ -521,7 +529,7 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
                     if (parameter.getSince() != null) {
                         w.startElement("since");
 
-                        if (StringUtils.isEmpty(parameter.getSince())) {
+                        if (parameter.getSince() == null || 
parameter.getSince().isEmpty()) {
                             w.writeText("No version given");
                         } else {
                             w.writeText(parameter.getSince());
@@ -531,7 +539,8 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
                     }
 
                     if (parameter.getDeprecated() != null) {
-                        if (StringUtils.isEmpty(parameter.getDeprecated())) {
+                        if (parameter.getDeprecated() == null
+                                || parameter.getDeprecated().isEmpty()) {
                             GeneratorUtils.element(w, "deprecated", "No reason 
given");
                         } else {
                             GeneratorUtils.element(
@@ -553,15 +562,19 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
                             w, "description", getTextValue(type, 
containsXhtmlTextValues, parameter.getDescription()));
 
                     if (isV4) {
-                        if (StringUtils.isNotEmpty(parameter.getExpression())) 
{
+                        if (parameter.getExpression() != null
+                                && !parameter.getExpression().isEmpty()) {
                             GeneratorUtils.element(w, "expression", 
parameter.getExpression());
                         }
-                        if 
(StringUtils.isNotEmpty(parameter.getDefaultValue())) {
+                        if (parameter.getDefaultValue() != null
+                                && !parameter.getDefaultValue().isEmpty()) {
                             GeneratorUtils.element(w, "defaultValue", 
parameter.getDefaultValue());
                         }
                     } else {
-                        if (StringUtils.isNotEmpty(parameter.getDefaultValue())
-                                || 
StringUtils.isNotEmpty(parameter.getExpression())) {
+                        if ((parameter.getDefaultValue() != null
+                                        && 
!parameter.getDefaultValue().isEmpty())
+                                || (parameter.getExpression() != null
+                                        && 
!parameter.getExpression().isEmpty())) {
                             configuration.add(parameter);
                         }
                     }
@@ -598,7 +611,8 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
                     w.addAttribute("default-value", 
parameter.getDefaultValue());
                 }
 
-                if (StringUtils.isNotEmpty(parameter.getExpression())) {
+                if (parameter.getExpression() != null
+                        && !parameter.getExpression().isEmpty()) {
                     w.writeText(parameter.getExpression());
                 }
 
@@ -623,7 +637,8 @@ public class PluginDescriptorFilesGenerator implements 
Generator {
 
                 GeneratorUtils.element(w, "role", requirement.getRole());
 
-                if (StringUtils.isNotEmpty(requirement.getRoleHint())) {
+                if (requirement.getRoleHint() != null
+                        && !requirement.getRoleHint().isEmpty()) {
                     GeneratorUtils.element(w, "role-hint", 
requirement.getRoleHint());
                 }
 

Reply via email to