gnodet-bot commented on code in PR #27153:
URL: https://github.com/apache/camel/pull/27153#discussion_r4148362073
##########
core/camel-java-io/src/main/java/org/apache/camel/java/in/JavaChainParser.java:
##########
@@ -360,6 +374,41 @@ private void statements(int end, List<Node> out,
Map<String, Node> constants) {
}
}
+ /** The local variables holding a route (or a part of one) in the builder
being read. */
+ private final Set<String> routeLocals = new HashSet<>();
Review Comment:
💡 `routeLocals` is an instance field that is never cleared between builder
bodies (lines 182-189 of `read()`). In a file with two inner `RouteBuilder`
classes, a local name like `route` from the first `configure()` would leak into
the parsing of the second. The replayer handles this correctly
(`locals.clear()` on its side), so the practical impact is negligible — the
parser would treat `route.x()` as a chain in the second builder, the replayer
wouldn't find `route` in `locals`, and it would fall through to normal
resolution (ultimately reported as Unknown). Still, clearing `routeLocals` at
the start of each builder body in `read()` would match the replayer's hygiene.
--
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]