Repository: camel
Updated Branches:
  refs/heads/camel-2.13.x 4ab33e84a -> 1de6f2bf7
  refs/heads/camel-2.14.x 6fca142dd -> d04e648b9
  refs/heads/master 8906357b9 -> 0eb1545bd


CAMEL-8226 Deprecated feature dataSourceRef not working correctly

If you try to create more than one of endpoint from SqlComponent with 
specifying dataSourceRef option, it doesn't remove dataSourceRef option from 
URL on 2nd attempt as dataSource object is already populated on 1st attempt, 
causes org.apache.camel.ResolveEndpointFailedException


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

Branch: refs/heads/master
Commit: baf9120cf88aac5f8167dc94f6e16e406bab13a8
Parents: 8906357
Author: Tomohisa Igarashi <tm.igara...@gmail.com>
Authored: Tue Feb 10 16:45:36 2015 +0900
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Tue Feb 10 09:04:14 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/sql/SqlComponent.java  | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/baf9120c/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java
----------------------------------------------------------------------
diff --git 
a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java
 
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java
index 1f62fdd..14ad063 100755
--- 
a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java
+++ 
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java
@@ -51,9 +51,8 @@ public class SqlComponent extends UriEndpointComponent {
         }
 
         //TODO cmueller: remove the 'dataSourceRef' lookup in Camel 3.0
-        if (dataSource == null) {
-            String dataSourceRef = getAndRemoveParameter(parameters, 
"dataSourceRef", String.class);
-            if (dataSourceRef != null) {
+        String dataSourceRef = getAndRemoveParameter(parameters, 
"dataSourceRef", String.class);
+        if (dataSource == null && dataSourceRef != null) {
                 dataSource = 
CamelContextHelper.mandatoryLookup(getCamelContext(), dataSourceRef, 
DataSource.class);
             }
         }

Reply via email to