You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2018/12/30 10:15:25 UTC

[camel] branch camel-2.23.x updated (45b89b5 -> 008a293)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch camel-2.23.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 45b89b5  CAMEL-13008: Odata-connector assumes '/' at end of URI
     new e3afd58  CAMEL-12974: Polished
     new 03e8ccc  Fixed rest-dsl parser typo in attribute
     new 008a293  CAMEL-12974: XML DSL tree parser should skip when/otherwise to parse similar like the Java DSL does

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/parser/helper/CamelJavaRestDslParserHelper.java    | 2 +-
 .../org/apache/camel/parser/helper/CamelXmlTreeParserHelper.java    | 6 ++++--
 .../java/org/apache/camel/parser/helper/RouteCoverageHelper.java    | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)


[camel] 01/03: CAMEL-12974: Polished

Posted by da...@apache.org.
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 e3afd58ed0dc6ed19c604ba963f970afaf951c68
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Dec 30 10:59:44 2018 +0100

    CAMEL-12974: Polished
---
 .../java/org/apache/camel/parser/helper/RouteCoverageHelper.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/RouteCoverageHelper.java b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/RouteCoverageHelper.java
index 109a2a5..387f713 100644
--- a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/RouteCoverageHelper.java
+++ b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/RouteCoverageHelper.java
@@ -83,7 +83,7 @@ public final class RouteCoverageHelper {
     }
 
     public static Map<String, List<CoverageData>> parseDumpRouteCoverageByClassAndTestMethod(String directory) throws Exception {
-        Map<String, List<CoverageData>> answer = new LinkedHashMap();
+        Map<String, List<CoverageData>> answer = new LinkedHashMap<>();
 
         File[] files = new File(directory).listFiles(f -> f.getName().endsWith(".xml"));
         if (files == null) {
@@ -138,10 +138,10 @@ public final class RouteCoverageHelper {
 
         // only calculate for elements within the route or children of policy/transaction
         if (!"route".equals(key) && !"policy".equals(key) && !"transacted".equals(key)) {
-            Integer count = 0;
+            int count = 0;
             Node total = node.getAttributes().getNamedItem("exchangesTotal");
             if (total != null) {
-                count = Integer.valueOf(total.getNodeValue());
+                count = Integer.parseInt(total.getNodeValue());
             }
             CoverageData holder = data.size() > counter.get() ? data.get(counter.get()) : null;
             if (holder != null && holder.getNode().equals(key)) {


[camel] 02/03: Fixed rest-dsl parser typo in attribute

Posted by da...@apache.org.
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 03e8ccca521d354fdc7570190dbba6eed716ddf3
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Dec 30 11:00:36 2018 +0100

    Fixed rest-dsl parser typo in attribute
---
 .../org/apache/camel/parser/helper/CamelJavaRestDslParserHelper.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaRestDslParserHelper.java b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaRestDslParserHelper.java
index 8c3018f..08558e6 100644
--- a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaRestDslParserHelper.java
+++ b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/CamelJavaRestDslParserHelper.java
@@ -358,7 +358,7 @@ public final class CamelJavaRestDslParserHelper {
             verb.setDescription(extractValueFromFirstArgument(clazz, block, mi));
         } else  if ("bindingMode".equals(name)) {
             verb.setBindingMode(extractValueFromFirstArgument(clazz, block, mi));
-        } else  if ("skipBindingOnErrorcode".equals(name)) {
+        } else  if ("skipBindingOnErrorCode".equals(name)) {
             verb.setSkipBindingOnErrorCode(extractValueFromFirstArgument(clazz, block, mi));
         } else  if ("clientRequestValidation".equals(name)) {
             verb.setClientRequestValidation(extractValueFromFirstArgument(clazz, block, mi));


[camel] 03/03: CAMEL-12974: XML DSL tree parser should skip when/otherwise to parse similar like the Java DSL does

Posted by da...@apache.org.
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 <cl...@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);