This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-cli.git


The following commit(s) were added to refs/heads/master by this push:
     new 3485401  Add PMD check to default Maven goal
3485401 is described below

commit 3485401b8879dec78e07f5dc88b7b6b762a4225e
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat May 11 13:46:06 2024 -0400

    Add PMD check to default Maven goal
---
 pom.xml                                               | 2 +-
 src/changes/changes.xml                               | 1 +
 src/main/java/org/apache/commons/cli/CommandLine.java | 4 +---
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index ee62ec8..909ed58 100644
--- a/pom.xml
+++ b/pom.xml
@@ -94,7 +94,7 @@
     <commons.jacoco.complexityRatio>0.94</commons.jacoco.complexityRatio>
   </properties>
   <build>
-    <defaultGoal>clean verify apache-rat:check japicmp:cmp checkstyle:check 
spotbugs:check javadoc:javadoc</defaultGoal>
+    <defaultGoal>clean verify apache-rat:check japicmp:cmp checkstyle:check 
spotbugs:check pmd:check javadoc:javadoc</defaultGoal>
     <pluginManagement>
       <plugins>
         <plugin>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 47b3833..e021867 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -25,6 +25,7 @@
     <release version="1.8.0" date="YYYY-MM-DD" description="This release 
contains new features and bug fixes and requires Java 8 or above.">
       <!-- ADD -->
       <action type="add" issue="CLI-332" dev="ggregory" due-to="Claude Warren, 
Gary Gregory">Add optional HelpFormatter Function to document Deprecated 
options #271.</action>
+      <action type="add" dev="ggregory" due-to="Gary Gregory">Add PMD check to 
default Maven goal.</action>
       <!-- FIX -->
       <action type="fix" issue="CLI-331" dev="ggregory" due-to="Claude Warren, 
Gary Gregory">Handle reporting of deprecated options when parameters are not 
String type. #270.</action>
       <action type="fix" dev="ggregory" due-to="Claude Warren, Gary 
Gregory">Avoid throwing NullPointerException when calling CommandLineParser 
will null array elements.</action>
diff --git a/src/main/java/org/apache/commons/cli/CommandLine.java 
b/src/main/java/org/apache/commons/cli/CommandLine.java
index 1b49398..c5f4dfc 100644
--- a/src/main/java/org/apache/commons/cli/CommandLine.java
+++ b/src/main/java/org/apache/commons/cli/CommandLine.java
@@ -17,8 +17,6 @@
 
 package org.apache.commons.cli;
 
-import static org.apache.commons.cli.Util.EMPTY_STRING_ARRAY;
-
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -414,7 +412,7 @@ public class CommandLine implements Serializable {
                 values.addAll(processedOption.getValuesList());
             }
         }
-        return values.isEmpty() ? null : values.toArray(EMPTY_STRING_ARRAY);
+        return values.isEmpty() ? null : 
values.toArray(Util.EMPTY_STRING_ARRAY);
     }
 
     /**

Reply via email to