camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/4] camel git commit: Camel catalog - Validate incapable parsing errors
Date Thu, 07 Jan 2016 20:26:20 GMT
Camel catalog - Validate incapable parsing errors


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f8cbb289
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f8cbb289
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f8cbb289

Branch: refs/heads/camel-2.16.x
Commit: f8cbb28934b44604c0e648e0f78e65364ec268b9
Parents: 9e8fc4a
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jan 7 21:25:30 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jan 7 21:26:10 2016 +0100

----------------------------------------------------------------------
 .../camel/catalog/DefaultCamelCatalog.java      | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f8cbb289/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
index 735d88d..1e97a1f 100644
--- a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
+++ b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
@@ -745,19 +745,18 @@ public class DefaultCamelCatalog implements CamelCatalog {
         boolean lenientProperties;
         String scheme;
 
-        // skip uris that may start with a placeholder
-        if (uri.startsWith("{{")) {
-            result.addIncapable(uri);
-            return result;
-        }
-
         try {
             // parse the uri
             URI u = normalizeUri(uri);
             scheme = u.getScheme();
             String json = componentJSonSchema(scheme);
             if (json == null) {
-                result.addUnknownComponent(scheme);
+                // if the uri starts with a placeholder then we are also incapable of parsing
it as we wasn't able to resolve the component name
+                if (uri.startsWith("{{")) {
+                    result.addIncapable(uri);
+                } else if (scheme != null) {
+                    result.addUnknownComponent(scheme);
+                }
                 return result;
             }
 
@@ -768,7 +767,13 @@ public class DefaultCamelCatalog implements CamelCatalog {
             rows = JSonSchemaHelper.parseJsonSchema("properties", json, true);
             properties = endpointProperties(uri);
         } catch (URISyntaxException e) {
-            result.addSyntaxError(e.getMessage());
+            if (uri.startsWith("{{")) {
+                // if the uri starts with a placeholder then we are also incapable of parsing
it as we wasn't able to resolve the component name
+                result.addIncapable(uri);
+            } else {
+                result.addSyntaxError(e.getMessage());
+            }
+
             return result;
         }
 


Mime
View raw message