2020import java .io .BufferedReader ;
2121import java .io .IOException ;
2222import java .io .PrintWriter ;
23+ import java .io .Serializable ;
2324import java .io .StringReader ;
2425import java .util .ArrayList ;
2526import java .util .Arrays ;
@@ -364,6 +365,7 @@ public String getArgName()
364365 * Comparator used to sort the options when they output in help text.
365366 * Defaults to case-insensitive alphabetical sorting by option key.
366367 *
368+ * @return the {@link Comparator} currently in use to sort the options
367369 * @since 1.2
368370 */
369371 public Comparator <Option > getOptionComparator ()
@@ -375,6 +377,7 @@ public Comparator<Option> getOptionComparator()
375377 * Set the comparator used to sort the options when they output in help text.
376378 * Passing in a null comparator will keep the options in the order they were declared.
377379 *
380+ * @param comparator the {@link Comparator} to use for sorting the options
378381 * @since 1.2
379382 */
380383 public void setOptionComparator (Comparator <Option > comparator )
@@ -465,7 +468,7 @@ public void printHelp(int width, String cmdLineSyntax, String header, Options op
465468 *
466469 * @param width the number of characters to be displayed on each line
467470 * @param cmdLineSyntax the syntax for this application
468- * @param header the banner to display at the begining of the help
471+ * @param header the banner to display at the beginning of the help
469472 * @param options the Options instance
470473 * @param footer the banner to display at the end of the help
471474 * @param autoUsage whether to print an automatically generated
@@ -487,7 +490,7 @@ public void printHelp(int width, String cmdLineSyntax, String header,
487490 * @param pw the writer to which the help will be written
488491 * @param width the number of characters to be displayed on each line
489492 * @param cmdLineSyntax the syntax for this application
490- * @param header the banner to display at the begining of the help
493+ * @param header the banner to display at the beginning of the help
491494 * @param options the Options instance
492495 * @param leftPad the number of characters of padding to be prefixed
493496 * to each line
@@ -1053,8 +1056,11 @@ protected String rtrim(String s)
10531056 * This class implements the <code>Comparator</code> interface
10541057 * for comparing Options.
10551058 */
1056- private static class OptionComparator implements Comparator <Option >
1059+ private static class OptionComparator implements Comparator <Option >, Serializable
10571060 {
1061+ /** The serial version UID. */
1062+ private static final long serialVersionUID = 5305467873966684014L ;
1063+
10581064 /**
10591065 * Compares its two arguments for order. Returns a negative
10601066 * integer, zero, or a positive integer as the first argument
0 commit comments