You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/03/03 15:58:42 UTC

(commons-cli) branch master updated: [CLI-327] Fix for expected textual date values. #244

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 fd309f3  [CLI-327] Fix for expected textual date values. #244
fd309f3 is described below

commit fd309f30d8c014a490247c267deb5cd9859052c0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Mar 3 10:58:38 2024 -0500

    [CLI-327] Fix for expected textual date values. #244
---
 src/changes/changes.xml                                            | 1 +
 src/test/java/org/apache/commons/cli/ConverterTests.java           | 4 ++--
 src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ec03d22..9b62ee1 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -28,6 +28,7 @@
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Avoid NullPointerException in Util.stripLeadingAndTrailingQuotes(String).</action>
       <action type="fix" issue="CLI-320" dev="ggregory" due-to="Paul King, Claude Warren">Awkward behavior of Option.builder() for multiple optional args.</action>
       <action type="fix" issue="CLI-325" dev="ggregory" due-to="Claude Warren">Properties from multiple arguments with value separator. #237.</action>
+      <action type="fix" issue="CLI-327" dev="ggregory" due-to="Claude Warren, Gary Gregory">Fix for expected textual date values. #244.</action>
       <!-- ADD -->
       <action type="add" issue="CLI-321" dev="ggregory" due-to="Claude Warren, Gary Gregory">Add and use a Converter interface and implementations without using BeanUtils #216.</action>
       <action type="add" dev="ggregory" due-to="Gary Gregory">Add Maven property project.build.outputTimestamp for build reproducibility.</action>
diff --git a/src/test/java/org/apache/commons/cli/ConverterTests.java b/src/test/java/org/apache/commons/cli/ConverterTests.java
index 8b00ab4..7f3a7c2 100644
--- a/src/test/java/org/apache/commons/cli/ConverterTests.java
+++ b/src/test/java/org/apache/commons/cli/ConverterTests.java
@@ -84,8 +84,8 @@ public class ConverterTests {
          * time zone.
          */
         final Date expected = new Date(1023400137000L);
-        DateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
-        String formatted = dateFormat.format(expected);
+        final DateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
+        final String formatted = dateFormat.format(expected);
         assertEquals(expected, Converter.DATE.apply(formatted));
 
         assertThrows(java.text.ParseException.class, () -> Converter.DATE.apply("Jun 06 17:48:57 EDT 2002"));
diff --git a/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java b/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java
index 56c4a7a..c080237 100644
--- a/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java
+++ b/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java
@@ -135,7 +135,7 @@ public class PatternOptionBuilderTest {
          */
         final Options options = PatternOptionBuilder.parsePattern("a:b@cde>f+n%t/m*z#");
         final Date expectedDate = new Date(1023400137000L);
-        DateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
+        final DateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
         final String[] args = {"-c", "-a", "foo", "-b", "java.util.Vector", "-e", "build.xml", "-f", "java.util.Calendar", "-n", "4.5", "-t",
             "https://commons.apache.org", "-z", dateFormat.format(expectedDate), "-m", "test*"};