Revision: 1741
          http://svn.sourceforge.net/spring-rich-c/?rev=1741&view=rev
Author:   jhoskens
Date:     2007-04-05 04:29:48 -0700 (Thu, 05 Apr 2007)

Log Message:
-----------
sourceClass can be null. Return the valuemodel when this is the case (no 
converting)

eg when accessing Map values, the value may be null which results in a null 
type.
We need to rely on the fact that the binding/user will use the correct type of 
input value.
Besides this, no primitive will ever be in a Map anyway.

Modified Paths:
--------------
    
trunk/spring-richclient/support/src/main/java/org/springframework/binding/form/support/AbstractFormModel.java

Modified: 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/form/support/AbstractFormModel.java
===================================================================
--- 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/form/support/AbstractFormModel.java
       2007-04-05 11:24:07 UTC (rev 1740)
+++ 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/form/support/AbstractFormModel.java
       2007-04-05 11:29:48 UTC (rev 1741)
@@ -320,7 +320,8 @@
         final ValueModel sourceValueModel = getValueModel(formProperty);
         Assert.notNull(sourceValueModel, "Form does not have a property called 
'" + formProperty + "'.");
         final Class sourceClass = 
ClassUtils.convertPrimitiveToWrapper(getFieldMetadata(formProperty).getPropertyType());
-        if (sourceClass == targetClass) {
+        // sourceClass can be null when using eg Map, assume that given 
targetClass is the correct one
+        if ((sourceClass == null) || (sourceClass == targetClass)) {
             return sourceValueModel;
         }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
spring-rich-c-cvs mailing list
spring-rich-c-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to