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 dc9af47  Use final.
dc9af47 is described below

commit dc9af47ef6149c7895ffcac9ede4d33fb37dfd3b
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Oct 3 17:28:30 2021 -0400

    Use final.
---
 .../apache/commons/cli/UnrecognizedOptionException.java | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/cli/UnrecognizedOptionException.java 
b/src/main/java/org/apache/commons/cli/UnrecognizedOptionException.java
index 49df554..fbb0657 100644
--- a/src/main/java/org/apache/commons/cli/UnrecognizedOptionException.java
+++ b/src/main/java/org/apache/commons/cli/UnrecognizedOptionException.java
@@ -18,40 +18,41 @@
 package org.apache.commons.cli;
 
 /**
- * Exception thrown during parsing signalling an unrecognized option was seen.
+ * Thrown during parsing signaling an unrecognized option.
  */
 public class UnrecognizedOptionException extends ParseException {
+
     /**
      * This exception {@code serialVersionUID}.
      */
     private static final long serialVersionUID = -252504690284625623L;
 
-    /** The unrecognized option */
-    private String option;
+    /** The unrecognized option. */
+    private final String option;
 
     /**
-     * Construct a new <code>UnrecognizedArgumentException</code> with the 
specified detail message.
+     * Constructs a new <code>UnrecognizedArgumentException</code> with the 
specified detail message.
      *
      * @param message the detail message
      */
     public UnrecognizedOptionException(final String message) {
-        super(message);
+        this(message, null);
     }
 
     /**
-     * Construct a new <code>UnrecognizedArgumentException</code> with the 
specified option and detail message.
+     * Constructs a new <code>UnrecognizedArgumentException</code> with the 
specified option and detail message.
      *
      * @param message the detail message
      * @param option the unrecognized option
      * @since 1.2
      */
     public UnrecognizedOptionException(final String message, final String 
option) {
-        this(message);
+        super(message);
         this.option = option;
     }
 
     /**
-     * Returns the unrecognized option.
+     * Gets the unrecognized option.
      *
      * @return the related option
      * @since 1.2

Reply via email to