Skip to content

Conversation

arturobernalg
Copy link
Contributor

This PR fixes issue #575, where an IParametersValidator on a @ParametersDelegate object incorrectly saw all parameters, including those from the top-level object (e.g., --argtop alongside --arg1 and --arg2). The fix scopes validators to their respective object’s parameters, improving intuitiveness and enabling easier mutex group implementation, as noted by @ekpdt.

Changed the storage and application of IParametersValidator instances from a global Set to a Map keyed by object, ensuring validators only see their own object's parameters. This resolves the bug where validators on a @ParametersDelegate saw top-level parameters (e.g., --argtop), making mutex group implementation more intuitive. Updated addDescription and validateOptions accordingly.
@mkarg
Copy link
Collaborator

mkarg commented Mar 15, 2025

@arturobernalg Thank you for your contribution. Unfortunately build fails in your code. https://github.com/cbeust/jcommander/actions/runs/13505241219/job/38819806044?pr=595#step:5:53. Kindly asking for a fix. Thanks.

@mkarg
Copy link
Collaborator

mkarg commented Aug 10, 2025

@arturobernalg Kindly asking you to fix your code. Thanks.

@mkarg mkarg force-pushed the master branch 2 times, most recently from 4dbceb5 to a1d8505 Compare October 5, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants