davsclaus commented on code in PR #22932:
URL: https://github.com/apache/camel/pull/22932#discussion_r3186809147
##########
core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java:
##########
@@ -314,7 +314,10 @@ private static <T> void doFindTypeInNodes(
if (type.isInstance(node)) {
found.add(type.cast(node));
}
- doFindTypeInNodes(node.getChildren(), type, found, current + 1,
maxDeep);
+ // structural nodes (non-ProcessorDefinition children like
WhenDefinition, OtherwiseDefinition)
+ // are transparent for depth counting — they don't consume a
maxDeep level
+ int childLevel = node instanceof ProcessorDefinition ? current + 1
: current;
+ doFindTypeInNodes(node.getChildren(), type, found, childLevel,
maxDeep);
Review Comment:
maxDeep is never checked such as if (current > maxDeep) { break ... } like
the old code did.
--
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]