Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-235

OptionBuilder wrong design

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.2
    • None
    • Options definition

    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

          Activity

            People

              Unassigned Unassigned
              sergey-b Sergey B.
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: