You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xbean-scm@geronimo.apache.org by ke...@apache.org on 2007/09/07 15:10:34 UTC

svn commit: r573567 - /geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/propertyeditor/AbstractConverter.java

Author: kevan
Date: Fri Sep  7 06:10:33 2007
New Revision: 573567

URL: http://svn.apache.org/viewvc?rev=573567&view=rev
Log:
XBEAN-93 remove strict type checking from AbstractConverter. Spec doesn't mandate type checking and some setters expect no type checking to occur

Modified:
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/propertyeditor/AbstractConverter.java

Modified: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/propertyeditor/AbstractConverter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/propertyeditor/AbstractConverter.java?rev=573567&r1=573566&r2=573567&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/propertyeditor/AbstractConverter.java (original)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/propertyeditor/AbstractConverter.java Fri Sep  7 06:10:33 2007
@@ -60,12 +60,7 @@
     }
 
     public final void setValue(Object value) {
-        if (value == null) {
-            super.setValue(null);
-        }
-        if (!type.isInstance(value)) {
-            throw new PropertyEditorException("Value is not an instance of " + type.getSimpleName());
-        }
+        // Don't validate the type. Type validation is not required by spec and some setters (e.g. Spring) expect this.
         super.setValue(value);
     }
 
@@ -73,9 +68,7 @@
         if (value == null) {
             return null;
         }
-        if (!type.isInstance(value)) {
-            throw new PropertyEditorException("Value is not an instance of " + type.getSimpleName() + ": " + value.getClass().getName());
-        }
+        // Don't validate the type. Type validation is not required by spec and some setters (e.g. Spring) expect this.
         return toStringImpl(value);
     }