Keep the existing parameter value when a set-parameter supplies none - #386
Open
arpitjain099 wants to merge 1 commit into
Open
arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
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.
Committer Notes
handleSetParameterassignsparam.setValues(new LinkedList<>(setParameter.getValues()))unconditionally, so aset-parameterthat adjusts only a label, usage, constraint or guideline replaces the parameter's inherited values with an empty list. Every other field in that method goes throughModifyPhaseUtils.mergeormergeItem, and both return the original when the profile side is null or empty.The reference resolver keeps the original. In
oscal-profile-resolve-modify.xsltheparamtemplate selects(value, select, $settings/(value,select))[last()], which falls back to the catalog's ownvaluewhen theset-parametercarries none. As it stands, a profile that only renames a parameter drops that parameter's value from the resolved catalog, and the value then goes missing from anything generated downstream.The added test resolves a one-control catalog whose parameter has a value, through a profile whose
set-parametersets only a label, and checks both the new label and the retained value. Without the source change it fails withexpected: <[catalog value]> but was: <[]>. The existingmodify-addsexample does not catch this because its parameter has no value to lose.ProfileResolutionTestspasses locally on JDK 11: 21 run, 0 failures, with the one pre-existing skip.All Submissions:
Changes to Core Features: