geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r573567 - /geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/propertyeditor/AbstractConverter.java
Date Fri, 07 Sep 2007 13:10:34 GMT
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);
     }
 



Mime
View raw message