incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r495631 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/BaseConverter.java
Date Fri, 12 Jan 2007 16:30:19 GMT
Author: matzew
Date: Fri Jan 12 08:30:18 2007
New Revision: 495631

URL: http://svn.apache.org/viewvc?view=rev&rev=495631
Log:
applied patch for ADFFACES-336 (convertNumber component does not work with a target type of
BigDecimal)

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

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/BaseConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/BaseConverter.java?view=diff&rev=495631&r1=495630&r2=495631
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/BaseConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/BaseConverter.java
Fri Jan 12 08:30:18 2007
@@ -15,6 +15,7 @@
 */
 package org.apache.myfaces.trinidadinternal.convert;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
@@ -57,6 +58,9 @@
       return new Long(num.longValue());
     if ((targetType == Short.class) || (targetType == Short.TYPE))
       return new Short(num.shortValue());
+    if (targetType == BigDecimal.class)
+      return new BigDecimal(num.doubleValue());
+    
     
     throw new IllegalArgumentException("Unsupported conversion from:"+
       source.getClass() + " to:"+targetType);
@@ -77,13 +81,14 @@
     }
     else if (Number.class.isAssignableFrom(sourceType))
     {
-      list.ensureCapacity(12);
+      list.ensureCapacity(13);
       list.add(Byte.class);
       list.add(Double.class);
       list.add(Float.class);
       list.add(Integer.class);
       list.add(Long.class);
       list.add(Short.class);
+      list.add(BigDecimal.class);      
       list.add(Byte.TYPE);
       list.add(Double.TYPE);
       list.add(Float.TYPE); // bug 4891181



Mime
View raw message