You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/09/15 14:56:53 UTC

svn commit: r997315 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java

Author: davsclaus
Date: Wed Sep 15 12:56:52 2010
New Revision: 997315

URL: http://svn.apache.org/viewvc?rev=997315&view=rev
Log:
CAMEL-3123: Improved performance of PropertyEditorTypeConverter.

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

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java?rev=997315&r1=997314&r2=997315&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java Wed Sep 15 12:56:52 2010
@@ -57,13 +57,15 @@ public class PropertyEditorTypeConverter
                 return ObjectHelper.cast(type, value);
             }
 
-            PropertyEditor editor = lookupEditor(type, value);
+            Class key = type;
+            PropertyEditor editor = lookupEditor(key);
             if (editor != null) {
                 editor.setAsText(value.toString());
                 return ObjectHelper.cast(type, editor.getValue());
             }
         } else if (type == String.class) {
-            PropertyEditor editor = lookupEditor(type, value);
+            Class key = value.getClass();
+            PropertyEditor editor = lookupEditor(key);
             if (editor != null) {
                 editor.setValue(value);
                 return ObjectHelper.cast(type, editor.getAsText());
@@ -73,7 +75,7 @@ public class PropertyEditorTypeConverter
         return null;
     }
 
-    private <T> PropertyEditor lookupEditor(Class<T> type, Object value) {
+    private PropertyEditor lookupEditor(Class type) {
         // check misses first
         if (misses.containsKey(type)) {
             if (LOG.isTraceEnabled()) {