markap14 commented on a change in pull request #5072:
URL: https://github.com/apache/nifi/pull/5072#discussion_r685270947
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/flow/AbstractFlowManager.java
##########
@@ -432,6 +435,9 @@ public ParameterContext createParameterContext(final String
id, final String nam
parameterContext.setParameters(parameters);
if (parameterContexts != null && !parameterContexts.isEmpty()) {
+ if (!isCalledFromMethod(PARAMETER_CONTEXT_RESOLUTION_METHOD)) {
Review comment:
I like that we've moved away from the brittle requirement that we need
to call a separate method after creating parameter contexts. This approach, I
think, is less brittle but still is a bit brittle. It would be easy to update
the code in a way that the `withParameterContextResolution` may call some other
method that then calls `createParameterContext`, etc.
What do you think about, instead of checking the call stack, instead just
update the `withParameterContextResolution` method to set a Thread Local
variable, and then check the Thread Local variable here to know whether or not
it's done within the param context resolution?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]