You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2009/02/26 08:27:49 UTC

svn commit: r748049 - /myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java

Author: matzew
Date: Thu Feb 26 07:27:49 2009
New Revision: 748049

URL: http://svn.apache.org/viewvc?rev=748049&view=rev
Log:
TRINIDAD-1407 - DateTimeConverter doesn't convert correctly as per the expectedDataType

Thanks to Agam Dass for the patch

Modified:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?rev=748049&r1=748048&r2=748049&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java Thu Feb 26 07:27:49 2009
@@ -120,7 +120,14 @@
     ValueExpression expression = component.getValueExpression("value");
     if (expression != null)
     {
-      Class<?> expectedType = expression.getType(context.getELContext());
+      Class<?> expectedType = expression.getExpectedType();  
+           
+      // If the expectedType is Object ask for the type which may be more specific
+      if(expectedType == Object.class) 
+      {
+        expectedType = expression.getType(context.getELContext());
+      } 
+        
       // Sometimes the type might be null, if it cannot be determined:
       if ((expectedType != null)
           && (!expectedType.isAssignableFrom(value.getClass())))