RFR [9] 8168149: Examine the behavior of jmod command-line options - repeating vs last one wins

Mandy Chung mandy.chung at oracle.com
Wed Jan 4 21:03:39 UTC 2017

> On Dec 22, 2016, at 9:11 AM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
> Most options for the jmod tool should be last one wins, to be consistent
> with the JDK tool convention, 8168149 [1]. Excludes is the only
> repeatable option.
> Given the existing usage of JOpt Simple, the most straight forward way
> to achieve the last-one-wins behaviour is to drop the
> withValuesSeparatedBy() from the OptionSpec have have the ValueConverters
> themselves do the separation, if any. That way all options can be made
> repeatable and the last element of the list of the option’s values will
> be the final one on the command line.
> http://cr.openjdk.java.net/~chegar/8168149.00/

This looks okay.

I wonder if it would be more helpful if it fails when a non-repeating option is specified more than once for a packaging tool.  Otherwise, the only way to find out if the command-line is correct is to list the content after the JMOD file is created.  OptionSpec::value throws an exception if the option is specified more than once.


More information about the jigsaw-dev mailing list