Enable environment property replacement anywhere #554
Merged
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 draft PR is a possible implementation of what's discussed in #546.
When an element is instantiated via
QFactory.instantiate
the element is passed to the addedreplaceEnvProperties
method, which replaces all environment properties recursively on its children and its attributes.If an element has the
verbatim
attribute set totrue
it will not process it or its children, I'm inclined to think this should be the correct behavior because it also acts as a performance hint to not recursively process its children. However, one may expect to override the parent's option in a child, so this is debatable. This also simplifies the code, by not having to track changes in the attribute down the line in the recursion.It may be necessary to remark that the
verbatim
option does not apply to theConfiguration
elements or other classes that callEnvironment.getProperty
on its own. This may sound obvious, but some may get confused about that.