camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r997315 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
Date Wed, 15 Sep 2010 12:56:53 GMT
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()) {



Mime
View raw message