commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karel Vervaeke (JIRA)" <>
Subject [jira] [Commented] (CLI-209) OptionBuilder is not thread-safe
Date Mon, 20 Aug 2012 11:28:38 GMT


Karel Vervaeke commented on CLI-209:

I would mark this 'wont fix', since OptionBuilder still is not, by any definition threadsafe.
CLI-224 seems to be a duplicate. Perhaps you could keep this one closed (won't fix in 1.x
line) and keep the other one open for 2.0.

Two hypothetical use cases for making CLI thread safe:
* A container where multiple users enter commands simultaneously, and where the parsing of
the command happens in the container).
* A program designed to execute multiple commands in parallel: The commands are read from
configuration files, and for each line a parallel process is started to parse and execute
the command.
> OptionBuilder is not thread-safe
> --------------------------------
>                 Key: CLI-209
>                 URL:
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.0, 1.1, 1.2
>            Reporter: Thomas Herre
>            Priority: Minor
>             Fix For: 1.3
> Class OptionBuilder is not thread-safe.
> It uses one OptionBuilder instance without synchronizing access to it.
> If more than one thread uses OptionBuilder, that can result in invalid Options (suppose
a scheduler component).
> Don't know if this should be fixed. At least the Javadoc should mention the fact that
the class is not thread-safe.
> As a workaround, use constructor of class Option.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message