Fix #575: Scope IParametersValidator to Object-Specific Parameters#595
Open
arturobernalg wants to merge 1 commit intocbeust:masterfrom
Open
Fix #575: Scope IParametersValidator to Object-Specific Parameters#595arturobernalg wants to merge 1 commit intocbeust:masterfrom
arturobernalg wants to merge 1 commit intocbeust:masterfrom
Conversation
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.
Collaborator
|
@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. |
Collaborator
|
@arturobernalg Kindly asking you to fix your code. Thanks. |
4dbceb5 to
a1d8505
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #575, where an
IParametersValidatoron a@ParametersDelegateobject 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.