Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
1.2
-
None
Description
OptionBuilder uses static variables to do its work. That's why it is not thread safe.
More than that, static builder methods doesn't conform to Java good style of accessing static members. Such members belong to the class and must be accessed in static way.
Consider creating new builder-like class like that:
OptionBuilder optionBuilder = OptionBuilder.newInstance(); options.add(optionBuilder.withDescription().hasArg().create()); options.add(optionBuilder.withDescription().hasArg().create()); options.add(optionBuilder.withDescription().hasArg().create());
Attachments
Issue Links
- duplicates
-
CLI-224 OptionBuilder only has static methods, yet many return an OptionBuilder instance
- Closed