Copilot commented on code in PR #2011:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2011#discussion_r2294139931
##########
libminifi/src/core/flow/StructuredConfiguration.cpp:
##########
@@ -922,7 +922,14 @@ void StructuredConfiguration::parsePropertiesNode(const
Node& properties_node, c
for (const auto& property_node : properties_node) {
const auto propertyName = property_node.first.getString().value();
const Node propertyValueNode = property_node.second;
- parsePropertyNodeElement(propertyName, propertyValueNode, component,
parameter_context);
+ const bool is_controller_service_node =
dynamic_cast<core::controller::ControllerServiceNode*>(&component) != nullptr;
+ const bool is_linked_services = propertyName == "Linked Services";
+ // We currently propagate properties to the ControllerServiceNode wrapper
and to the actual ControllerService.
+ // This could cause false positive warnings because the Node should only
handle the linked services while implementation should contain everything else
+ // We should probably remove the nodes and handle the linked services
concept inside the impls
+ if (is_controller_service_node == is_linked_services) {
Review Comment:
The condition `is_controller_service_node == is_linked_services` uses
boolean equality which creates unclear logic. Consider using explicit
conditions like `(is_controller_service_node && is_linked_services) ||
(!is_controller_service_node && !is_linked_services)` or add a comment
explaining when this condition evaluates to true.
```suggestion
// Only parse the property if both are true or both are false (i.e., not
mixing controller service node and linked services)
if ((is_controller_service_node && is_linked_services) ||
(!is_controller_service_node && !is_linked_services)) {
```
--
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]