Author: ningjiang
Date: Thu Dec 15 08:13:22 2011
New Revision: 1214651

URL: http://svn.apache.org/viewvc?rev=1214651&view=rev
Log:
Merged revisions 1214648 via svnmerge from 
https://svn.apache.org/repos/asf/camel/branches/camel-2.8.x

................
  r1214648 | ningjiang | 2011-12-15 15:55:58 +0800 (Thu, 15 Dec 2011) | 9 lines
  
  Merged revisions 1214639 via svnmerge from 
  https://svn.apache.org/repos/asf/camel/trunk
  
  ........
    r1214639 | ningjiang | 2011-12-15 15:10:05 +0800 (Thu, 15 Dec 2011) | 1 line
    
    CAMEL-4781 Improving NoTypeConversionAvailableException message with cause
  ........
................

Modified:
    camel/branches/camel-2.7.x/   (props changed)
    
camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java

Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 15 08:13:22 2011
@@ -1,2 +1,2 @@
-/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814,1213201,1213531,1214058
-/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811,1213197,1213219,1213526
+/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814,1213201,1213531,1214058,1214648
+/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811,1213197,1213219,1213526,1214639

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

Modified: 
camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java?rev=1214651&r1=1214650&r2=1214651&view=diff
==============================================================================
--- 
camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
 (original)
+++ 
camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
 Thu Dec 15 08:13:22 2011
@@ -34,8 +34,9 @@ public class NoTypeConversionAvailableEx
     }
 
     public NoTypeConversionAvailableException(Object value, Class<?> type, 
Throwable cause) {
-        this(value, type);
-        initCause(cause);
+        super(createMessage(value, type, cause), cause);
+        this.value = value;
+        this.type = type;
     }
 
     /**
@@ -71,4 +72,13 @@ public class NoTypeConversionAvailableEx
         return "No type converter available to convert from type: " + (value 
!= null ? value.getClass().getCanonicalName() : null)
               + " to the required type: " + type.getCanonicalName() + " with 
value " + value;
     }
+    
+    /**
+     * Returns an error message for no type converter available with the cause.
+     */
+    public static String createMessage(Object value, Class<?> type, Throwable 
cause) {
+        return "Converting Exception when converting from type: "
+               + (value != null ? value.getClass().getCanonicalName() : null) 
+ " to the required type: "
+               + type.getCanonicalName() + " with value " + value + ", which 
is caused by " + cause;
+    }
 }


Reply via email to