camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r940925 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
Date Tue, 04 May 2010 16:02:38 GMT
Author: davsclaus
Date: Tue May  4 16:02:38 2010
New Revision: 940925

URL: http://svn.apache.org/viewvc?rev=940925&view=rev
Log:
Added more code comments to default type converter about can promote / cannot promote.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java?rev=940925&r1=940924&r2=940925&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
Tue May  4 16:02:38 2010
@@ -64,10 +64,15 @@ public class DefaultTypeConverter extend
 
         // add to string first as it will then be last in the last as to string can nearly
         // always convert something to a string so we want it only as the last resort
+        // ToStringTypeConverter should NOT allow to be promoted
         addFallbackTypeConverter(new ToStringTypeConverter(), false);
+        // enum is okay to be promoted
         addFallbackTypeConverter(new EnumTypeConverter(), true);
+        // arrays is okay to be promoted
         addFallbackTypeConverter(new ArrayTypeConverter(), true);
-        addFallbackTypeConverter(new PropertyEditorTypeConverter(), true);
+        // do not assume property editor as it has a String converter
+        addFallbackTypeConverter(new PropertyEditorTypeConverter(), false);
+        // and future should also not allowed to be promoted
         addFallbackTypeConverter(new FutureTypeConverter(this), false);
     }
 
@@ -194,9 +199,7 @@ public class DefaultTypeConverter extend
             }
         }
 
-        // TODO: check before if its type/value is primitive/wrapper combo which we can convert
asap then
-
-        // primitives
+        // not found with that type then if it was a primitive type then try again with the
wrapper type
         if (type.isPrimitive()) {
             Class primitiveType = ObjectHelper.convertPrimitiveTypeToWrapperType(type);
             if (primitiveType != type) {



Mime
View raw message