@@ -59,6 +59,7 @@ public class OptionBuilder {
5959 */
6060 private OptionBuilder ()
6161 {
62+ // hide the constructor
6263 }
6364
6465 /**
@@ -82,12 +83,12 @@ private static void reset()
8283 /**
8384 * The next Option created will have the following long option value.
8485 *
85- * @param longopt the long option value
86+ * @param newLongopt the long option value
8687 * @return the OptionBuilder instance
8788 */
88- public static OptionBuilder withLongOpt (String longopt )
89+ public static OptionBuilder withLongOpt (String newLongopt )
8990 {
90- instance .longopt = longopt ;
91+ OptionBuilder .longopt = newLongopt ;
9192
9293 return instance ;
9394 }
@@ -99,7 +100,7 @@ public static OptionBuilder withLongOpt(String longopt)
99100 */
100101 public static OptionBuilder hasArg ()
101102 {
102- instance .numberOfArgs = 1 ;
103+ OptionBuilder .numberOfArgs = 1 ;
103104
104105 return instance ;
105106 }
@@ -113,7 +114,7 @@ public static OptionBuilder hasArg()
113114 */
114115 public static OptionBuilder hasArg (boolean hasArg )
115116 {
116- instance .numberOfArgs = (hasArg == true ) ? 1 : Option .UNINITIALIZED ;
117+ OptionBuilder .numberOfArgs = (hasArg == true ) ? 1 : Option .UNINITIALIZED ;
117118
118119 return instance ;
119120 }
@@ -127,7 +128,7 @@ public static OptionBuilder hasArg(boolean hasArg)
127128 */
128129 public static OptionBuilder withArgName (String name )
129130 {
130- instance .argName = name ;
131+ OptionBuilder .argName = name ;
131132
132133 return instance ;
133134 }
@@ -139,7 +140,7 @@ public static OptionBuilder withArgName(String name)
139140 */
140141 public static OptionBuilder isRequired ()
141142 {
142- instance .required = true ;
143+ OptionBuilder .required = true ;
143144
144145 return instance ;
145146 }
@@ -164,7 +165,7 @@ public static OptionBuilder isRequired()
164165 */
165166 public static OptionBuilder withValueSeparator (char sep )
166167 {
167- instance .valuesep = sep ;
168+ OptionBuilder .valuesep = sep ;
168169
169170 return instance ;
170171 }
@@ -187,7 +188,7 @@ public static OptionBuilder withValueSeparator(char sep)
187188 */
188189 public static OptionBuilder withValueSeparator ()
189190 {
190- instance .valuesep = '=' ;
191+ OptionBuilder .valuesep = '=' ;
191192
192193 return instance ;
193194 }
@@ -196,12 +197,12 @@ public static OptionBuilder withValueSeparator()
196197 * The next Option created will be required if <code>required</code>
197198 * is true.
198199 *
199- * @param required if true then the Option is required
200+ * @param newRequired if true then the Option is required
200201 * @return the OptionBuilder instance
201202 */
202- public static OptionBuilder isRequired (boolean required )
203+ public static OptionBuilder isRequired (boolean newRequired )
203204 {
204- instance .required = required ;
205+ OptionBuilder .required = newRequired ;
205206
206207 return instance ;
207208 }
@@ -213,7 +214,7 @@ public static OptionBuilder isRequired(boolean required)
213214 */
214215 public static OptionBuilder hasArgs ()
215216 {
216- instance .numberOfArgs = Option .UNLIMITED_VALUES ;
217+ OptionBuilder .numberOfArgs = Option .UNLIMITED_VALUES ;
217218
218219 return instance ;
219220 }
@@ -227,7 +228,7 @@ public static OptionBuilder hasArgs()
227228 */
228229 public static OptionBuilder hasArgs (int num )
229230 {
230- instance .numberOfArgs = num ;
231+ OptionBuilder .numberOfArgs = num ;
231232
232233 return instance ;
233234 }
@@ -239,8 +240,8 @@ public static OptionBuilder hasArgs(int num)
239240 */
240241 public static OptionBuilder hasOptionalArg ()
241242 {
242- instance .numberOfArgs = 1 ;
243- instance .optionalArg = true ;
243+ OptionBuilder .numberOfArgs = 1 ;
244+ OptionBuilder .optionalArg = true ;
244245
245246 return instance ;
246247 }
@@ -253,8 +254,8 @@ public static OptionBuilder hasOptionalArg()
253254 */
254255 public static OptionBuilder hasOptionalArgs ()
255256 {
256- instance .numberOfArgs = Option .UNLIMITED_VALUES ;
257- instance .optionalArg = true ;
257+ OptionBuilder .numberOfArgs = Option .UNLIMITED_VALUES ;
258+ OptionBuilder .optionalArg = true ;
258259
259260 return instance ;
260261 }
@@ -269,8 +270,8 @@ public static OptionBuilder hasOptionalArgs()
269270 */
270271 public static OptionBuilder hasOptionalArgs (int numArgs )
271272 {
272- instance .numberOfArgs = numArgs ;
273- instance .optionalArg = true ;
273+ OptionBuilder .numberOfArgs = numArgs ;
274+ OptionBuilder .optionalArg = true ;
274275
275276 return instance ;
276277 }
@@ -279,25 +280,25 @@ public static OptionBuilder hasOptionalArgs(int numArgs)
279280 * The next Option created will have a value that will be an instance
280281 * of <code>type</code>.
281282 *
282- * @param type the type of the Options argument value
283+ * @param newType the type of the Options argument value
283284 * @return the OptionBuilder instance
284285 */
285- public static OptionBuilder withType (Object type )
286+ public static OptionBuilder withType (Object newType )
286287 {
287- instance .type = type ;
288+ OptionBuilder .type = newType ;
288289
289290 return instance ;
290291 }
291292
292293 /**
293294 * The next Option created will have the specified description
294295 *
295- * @param description a description of the Option's purpose
296+ * @param newDescription a description of the Option's purpose
296297 * @return the OptionBuilder instance
297298 */
298- public static OptionBuilder withDescription (String description )
299+ public static OptionBuilder withDescription (String newDescription )
299300 {
300- instance .description = description ;
301+ OptionBuilder .description = newDescription ;
301302
302303 return instance ;
303304 }
@@ -363,7 +364,7 @@ public static Option create(String opt)
363364
364365
365366 // reset the OptionBuilder properties
366- instance .reset ();
367+ OptionBuilder .reset ();
367368
368369 // return the Option instance
369370 return option ;
0 commit comments