camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/4] camel git commit: Camel catalog - Fixed endpoint properties parser.
Date Fri, 08 Jan 2016 12:44:09 GMT
Camel catalog - Fixed endpoint properties parser.


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

Branch: refs/heads/master
Commit: 6a9c07cad2c9fa7a0148b7405778beaf2af3d1a5
Parents: e5b6e37
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Jan 8 13:35:47 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Jan 8 13:35:47 2016 +0100

----------------------------------------------------------------------
 .../component/netty/http/NettyHttpConfiguration.java   |  2 +-
 .../component/netty4/http/NettyHttpConfiguration.java  |  2 +-
 .../org/apache/camel/catalog/DefaultCamelCatalog.java  | 13 ++++++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6a9c07ca/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
index 641f16f..05999d3 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
@@ -40,7 +40,7 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     private String host;
     @UriPath
     private int port;
-    @UriPath @Metadata(required = "true")
+    @UriPath
     private String path;
     @UriParam(label = "consumer,advanced")
     private boolean urlDecodeHeaders;

http://git-wip-us.apache.org/repos/asf/camel/blob/6a9c07ca/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
index d9bbbbb..9f6c9bb 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
@@ -39,7 +39,7 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     private String host;
     @UriPath
     private int port;
-    @UriPath @Metadata(required = "true")
+    @UriPath
     private String path;
     @UriParam(label = "consumer,advanced")
     private boolean urlDecodeHeaders;

http://git-wip-us.apache.org/repos/asf/camel/blob/6a9c07ca/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 14a4d50..ae955d6 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
@@ -1102,7 +1102,18 @@ public class DefaultCamelCatalog implements CamelCatalog {
             } else {
                 // we have a little problem as we do not not have all options
                 if (!required) {
-                    String value = defaultValue;
+                    String value = null;
+
+                    boolean last = i == word.size() - 1;
+                    if (last) {
+                        // if its the last value then use it instead of the default value
+                        value = it.hasNext() ? it.next() : null;
+                        if (value != null) {
+                            options.put(key, value);
+                        } else {
+                            value = defaultValue;
+                        }
+                    }
                     if (value != null) {
                         options.put(key, value);
                         defaultValueAdded = true;


Mime
View raw message