[
https://issues.apache.org/jira/browse/CLI-235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13604314#comment-13604314
]
Thomas Neidhart commented on CLI-235:
-------------------------------------
Please take a look at CLI-224, which added a new way to build options.
It is already integrated in the trunk, if you want to provide feedback.
> OptionBuilder wrong design
> --------------------------
>
> Key: CLI-235
> URL: https://issues.apache.org/jira/browse/CLI-235
> Project: Commons CLI
> Issue Type: Bug
> Components: Options definition
> Affects Versions: 1.2
> Reporter: Sergey B.
> Priority: Minor
> Labels: OptionBuilder
>
> 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:
> {code:java}
> OptionBuilder optionBuilder = OptionBuilder.newInstance();
> options.add(optionBuilder.withDescription().hasArg().create());
> options.add(optionBuilder.withDescription().hasArg().create());
> options.add(optionBuilder.withDescription().hasArg().create());
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira