camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1389253 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
Date Mon, 24 Sep 2012 09:04:20 GMT
Author: davsclaus
Date: Mon Sep 24 09:04:19 2012
New Revision: 1389253

URL: http://svn.apache.org/viewvc?rev=1389253&view=rev
Log:
CAMEL-5644: Bean component - Should use try conversion when choosing method based on parameter
type matching.

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1389251

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java?rev=1389253&r1=1389252&r2=1389253&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
Mon Sep 24 09:04:19 2012
@@ -52,8 +52,6 @@ import org.apache.camel.util.ObjectHelpe
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.apache.camel.util.ExchangeHelper.convertToType;
-
 /**
  * Represents the metadata about a bean type created via a combination of
  * introspection and annotations together with some useful sensible defaults
@@ -571,8 +569,9 @@ public class BeanInfo {
                 if (methodInfo.getBodyParameterType().isInstance(body)) {
                     return methodInfo;
                 }
-                
-                Object value = convertToType(exchange, methodInfo.getBodyParameterType(),
body);
+
+                // we should only try to convert, as we are looking for best match
+                Object value = exchange.getContext().getTypeConverter().tryConvertTo(methodInfo.getBodyParameterType(),
exchange, body);
                 if (value != null) {
                     if (LOG.isTraceEnabled()) {
                         LOG.trace("Converted body from: {} to: {}",



Mime
View raw message