Author: davsclaus
Date: Sat Apr 21 09:25:40 2012
New Revision: 1328622
URL: http://svn.apache.org/viewvc?rev=1328622&view=rev
Log:
CAMEL-5172: Fixed and improved TypeConverter to fail faster by throwing
TypeConversionException to the caller. Use the new tryConvertTo API for the old
behavior. This would also be more in line what people would expect that
exceptions to be propated back as is to the caller.
Modified:
camel/branches/camel-2.8.x/ (props changed)
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1326525
Merged /camel/branches/camel-2.9.x:r1327579
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=1328622&r1=1328621&r2=1328622&view=diff
==============================================================================
---
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
(original)
+++
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
Sat Apr 21 09:25:40 2012
@@ -148,7 +148,7 @@ public final class ObjectHelper {
// prefer to coerce to the right hand side at first
if (rightValue instanceof Comparable) {
- Object value = converter.convertTo(rightValue.getClass(),
leftValue);
+ Object value = converter.tryConvertTo(rightValue.getClass(),
leftValue);
if (value != null) {
return ((Comparable) rightValue).compareTo(value) * -1;
}
@@ -156,7 +156,7 @@ public final class ObjectHelper {
// then fallback to the left hand side
if (leftValue instanceof Comparable) {
- Object value = converter.convertTo(leftValue.getClass(),
rightValue);
+ Object value = converter.tryConvertTo(leftValue.getClass(),
rightValue);
if (value != null) {
return ((Comparable) leftValue).compareTo(value);
}