camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject svn commit: r707928 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
Date Sun, 26 Oct 2008 01:38:40 GMT
Author: janstey
Date: Sat Oct 25 18:38:39 2008
New Revision: 707928

URL: http://svn.apache.org/viewvc?rev=707928&view=rev
Log:
Fix case where type conversion is required in bean method selection

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java?rev=707928&r1=707927&r2=707928&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
Sat Oct 25 18:38:39 2008
@@ -35,6 +35,7 @@
 import org.apache.camel.Header;
 import org.apache.camel.Headers;
 import org.apache.camel.Message;
+import org.apache.camel.NoTypeConversionAvailableException;
 import org.apache.camel.OutHeaders;
 import org.apache.camel.Properties;
 import org.apache.camel.Property;
@@ -332,15 +333,21 @@
                 Object newBody = null;
                 MethodInfo matched = null;
                 for (MethodInfo methodInfo : operationList) {
-                    Object value = convertToType(exchange, methodInfo.getBodyParameterType(),
body);
-                    if (value != null) {
-                        if (newBody != null) {
-                            throw new AmbiguousMethodCallException(exchange, Arrays.asList(matched,
-                                                                                        
  methodInfo));
-                        } else {
-                            newBody = value;
-                            matched = methodInfo;
+                    Object value = null;
+                    try {
+                        value = convertToType(exchange, methodInfo.getBodyParameterType(),
body);
+                        if (value != null) {
+                            if (newBody != null) {
+                                throw new AmbiguousMethodCallException(exchange, Arrays.asList(matched,
+                                                                                        
      methodInfo));
+                            } else {
+                                newBody = value;
+                                matched = methodInfo;
+                            }
                         }
+                    } catch (NoTypeConversionAvailableException e) {
+                        // we can safely ignore this exception as we want a behaviour similar
to
+                        // that if convertToType return null
                     }
                 }
                 if (matched != null) {



Mime
View raw message