@@ -63,7 +63,7 @@ protected CommandLine()
6363 * @return true if set, false if not
6464 * @since 1.5
6565 */
66- public boolean hasOption (Option opt )
66+ public boolean hasOption (final Option opt )
6767 {
6868 return options .contains (opt );
6969 }
@@ -74,7 +74,7 @@ public boolean hasOption(Option opt)
7474 * @param opt Short name of the option
7575 * @return true if set, false if not
7676 */
77- public boolean hasOption (String opt )
77+ public boolean hasOption (final String opt )
7878 {
7979 return hasOption (resolveOption (opt ));
8080 }
@@ -85,7 +85,7 @@ public boolean hasOption(String opt)
8585 * @param opt character name of the option
8686 * @return true if set, false if not
8787 */
88- public boolean hasOption (char opt )
88+ public boolean hasOption (final char opt )
8989 {
9090 return hasOption (String .valueOf (opt ));
9191 }
@@ -98,7 +98,7 @@ public boolean hasOption(char opt)
9898 * @deprecated due to System.err message. Instead use getParsedOptionValue(String)
9999 */
100100 @ Deprecated
101- public Object getOptionObject (String opt )
101+ public Object getOptionObject (final String opt )
102102 {
103103 try
104104 {
@@ -120,7 +120,7 @@ public Object getOptionObject(String opt)
120120 * @see PatternOptionBuilder
121121 * @since 1.5
122122 */
123- public Object getParsedOptionValue (Option option ) throws ParseException
123+ public Object getParsedOptionValue (final Option option ) throws ParseException
124124 {
125125 if (option == null )
126126 {
@@ -143,7 +143,7 @@ public Object getParsedOptionValue(Option option) throws ParseException
143143 * @see PatternOptionBuilder
144144 * @since 1.2
145145 */
146- public Object getParsedOptionValue (String opt ) throws ParseException
146+ public Object getParsedOptionValue (final String opt ) throws ParseException
147147 {
148148 return getParsedOptionValue (resolveOption (opt ));
149149 }
@@ -157,7 +157,7 @@ public Object getParsedOptionValue(String opt) throws ParseException
157157 * @see PatternOptionBuilder
158158 * @since 1.5
159159 */
160- public Object getParsedOptionValue (char opt ) throws ParseException
160+ public Object getParsedOptionValue (final char opt ) throws ParseException
161161 {
162162 return getParsedOptionValue (String .valueOf (opt ));
163163 }
@@ -169,7 +169,7 @@ public Object getParsedOptionValue(char opt) throws ParseException
169169 * @param opt the name of the option
170170 * @return the type of opt
171171 */
172- public Object getOptionObject (char opt )
172+ public Object getOptionObject (final char opt )
173173 {
174174 return getOptionObject (String .valueOf (opt ));
175175 }
@@ -182,7 +182,7 @@ public Object getOptionObject(char opt)
182182 * otherwise null.
183183 * @since 1.5
184184 */
185- public String getOptionValue (Option option )
185+ public String getOptionValue (final Option option )
186186 {
187187 if (option == null )
188188 {
@@ -199,7 +199,7 @@ public String getOptionValue(Option option)
199199 * @return Value of the argument if option is set, and has an argument,
200200 * otherwise null.
201201 */
202- public String getOptionValue (String opt )
202+ public String getOptionValue (final String opt )
203203 {
204204 return getOptionValue (resolveOption (opt ));
205205 }
@@ -211,7 +211,7 @@ public String getOptionValue(String opt)
211211 * @return Value of the argument if option is set, and has an argument,
212212 * otherwise null.
213213 */
214- public String getOptionValue (char opt )
214+ public String getOptionValue (final char opt )
215215 {
216216 return getOptionValue (String .valueOf (opt ));
217217 }
@@ -224,7 +224,7 @@ public String getOptionValue(char opt)
224224 * otherwise null.
225225 * @since 1.5
226226 */
227- public String [] getOptionValues (Option option )
227+ public String [] getOptionValues (final Option option )
228228 {
229229 final List <String > values = new ArrayList <String >();
230230
@@ -246,7 +246,7 @@ public String[] getOptionValues(Option option)
246246 * @return Values of the argument if option is set, and has an argument,
247247 * otherwise null.
248248 */
249- public String [] getOptionValues (String opt )
249+ public String [] getOptionValues (final String opt )
250250 {
251251 return getOptionValues (resolveOption (opt ));
252252 }
@@ -283,7 +283,7 @@ private Option resolveOption(String opt)
283283 * @return Values of the argument if option is set, and has an argument,
284284 * otherwise null.
285285 */
286- public String [] getOptionValues (char opt )
286+ public String [] getOptionValues (final char opt )
287287 {
288288 return getOptionValues (String .valueOf (opt ));
289289 }
@@ -298,7 +298,7 @@ public String[] getOptionValues(char opt)
298298 * otherwise <code>defaultValue</code>.
299299 * @since 1.5
300300 */
301- public String getOptionValue (Option option , String defaultValue )
301+ public String getOptionValue (final Option option , final String defaultValue )
302302 {
303303 final String answer = getOptionValue (option );
304304 return (answer != null ) ? answer : defaultValue ;
@@ -313,7 +313,7 @@ public String getOptionValue(Option option, String defaultValue)
313313 * @return Value of the argument if option is set, and has an argument,
314314 * otherwise <code>defaultValue</code>.
315315 */
316- public String getOptionValue (String opt , String defaultValue )
316+ public String getOptionValue (final String opt , final String defaultValue )
317317 {
318318 return getOptionValue (resolveOption (opt ), defaultValue );
319319 }
@@ -327,7 +327,7 @@ public String getOptionValue(String opt, String defaultValue)
327327 * @return Value of the argument if option is set, and has an argument,
328328 * otherwise <code>defaultValue</code>.
329329 */
330- public String getOptionValue (char opt , String defaultValue )
330+ public String getOptionValue (final char opt , final String defaultValue )
331331 {
332332 return getOptionValue (String .valueOf (opt ), defaultValue );
333333 }
@@ -345,7 +345,7 @@ public String getOptionValue(char opt, String defaultValue)
345345 * even if the option doesn't exists
346346 * @since 1.5
347347 */
348- public Properties getOptionProperties (Option option )
348+ public Properties getOptionProperties (final Option option )
349349 {
350350 final Properties props = new Properties ();
351351
@@ -383,7 +383,7 @@ else if (values.size() == 1)
383383 * even if the option doesn't exists
384384 * @since 1.2
385385 */
386- public Properties getOptionProperties (String opt )
386+ public Properties getOptionProperties (final String opt )
387387 {
388388 final Properties props = new Properties ();
389389
@@ -459,7 +459,7 @@ public String toString() {
459459 *
460460 * @param arg the unrecognized option/argument.
461461 */
462- protected void addArg (String arg )
462+ protected void addArg (final String arg )
463463 {
464464 args .add (arg );
465465 }
@@ -469,7 +469,7 @@ protected void addArg(String arg)
469469 *
470470 * @param opt the processed option
471471 */
472- protected void addOption (Option opt )
472+ protected void addOption (final Option opt )
473473 {
474474 options .add (opt );
475475 }
@@ -521,7 +521,7 @@ public static final class Builder
521521 *
522522 * @return this Builder instance for method chaining.
523523 */
524- public Builder addOption (Option opt )
524+ public Builder addOption (final Option opt )
525525 {
526526 commandLine .addOption (opt );
527527 return this ;
@@ -534,7 +534,7 @@ public Builder addOption(Option opt)
534534 *
535535 * @return this Builder instance for method chaining.
536536 */
537- public Builder addArg (String arg )
537+ public Builder addArg (final String arg )
538538 {
539539 commandLine .addArg (arg );
540540 return this ;
0 commit comments