cbeust / jcommander

Command line parsing framework for Java
Apache License 2.0
1.96k stars 334 forks source link

Avoid duplicates on default initialization #492

Closed marcobjorge closed 1 year ago

marcobjorge commented 4 years ago

Parameters are repeatedly added to the internal state of ´JCommander´ for each alias/name and when fetching defaults values they need to be deduplicated to avoid retrieving the default value multiple times. Although with most parameter types the duplicate fetching would not be a problem (e.g. it would just override itself), with cumulative types such as Lists is actually causes the duplication of content.