This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-2.23.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit 008a293840d2d2858ebd21872136b11a3e880ec2 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sun Dec 30 11:09:48 2018 +0100 CAMEL-12974: XML DSL tree parser should skip when/otherwise to parse similar like the Java DSL does --- .../org/apache/camel/parser/helper/CamelXmlTreeParserHelper.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelXmlTreeParserHelper.java b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelXmlTreeParserHelper.java index 23c291b..ca24642 100644 --- a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelXmlTreeParserHelper.java +++ b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelXmlTreeParserHelper.java @@ -75,11 +75,13 @@ public final class CamelXmlTreeParserHelper { boolean isRoute = "route".equals(name) || "from".equals(name); // must be an eip model that has either input or output as we only want to track processors (also accept from) boolean isEip = camelCatalog.findModelNames().contains(name) && (hasInput(name) || hasOutput(name)); + // skip when/otherwise (as we do this in Java DSL) + boolean isWhenOrOtherwise = "when".equals(name) || "otherwise".equals(name); // only include if its a known Camel model (dont include languages) if (isRoute || isEip) { - // skip route as we just keep from - if (!"route".equals(name)) { + // skip route as we just keep from (and also skip when/otherwise) + if (!"route".equals(name) && !isWhenOrOtherwise) { String lineNumber = (String) node.getUserData(XmlLineNumberParser.LINE_NUMBER); String lineNumberEnd = (String) node.getUserData(XmlLineNumberParser.LINE_NUMBER_END); newNode = nodeFactory.newNode(parent, name);