commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <james_strac...@yahoo.co.uk>
Subject Re: Posssible bug in Betwixt alpha
Date Wed, 23 Jul 2003 10:50:41 GMT
Betwixt uses BeanUtils's ConverterUtils to do type conversions. You 
could always register your own special converter object to handle the 
conversion of String -> Date. Though I would have throught this worked 
out of the box as I thought java.util.Date was supported.

Any chance you could create a little test case of a bean & some XML 
that doesn't work correctly and we can add it to the JUnit test cases & 
then fix the problem.

BTW your bean is following the Java beans property naming rules? i.e. 
one getter & one setter with the same type?


On Wednesday, July 23, 2003, at 12:01  am, Ujjwala Kulkarni wrote:

> Hi ,
>
>  
>
> I guess , when user calls method beanReader.parse(file) , the 
>  ‘update’ of class org.apache.commons.betwixt.expression.MethodUpdater 
>  gets called.
>
>  
>
> I observed that if the data types are java.util.Date , int the 
> attributes are not getting converted to the required data type and 
> hence I get the InvalidArgumentExcetion as the default attribute type 
> passed is ‘String’
>
>  
>
> If the date is java.sql.Date then there is no problem but if it is 
> java.util.Date type then I get this exception. One possible cause is 
> that these data types do not have constructors accepting String as 
> only argument.
>
>  
>
> e.g java.util.Date  has deprecated new Date(String) constructor.
>
> And the Interger can not be converted to int like  new int(String) 
>  the code
>
>  
>
> “newValue = ConvertUtils.convert( (String) newValue, valueType );”  
> will always fail to convert to int or java.util.Date.
>
>  
>
> Attaching the log file where I modified MethodUpdater and the log file 
> I got. In theMethodUpdater , I have put some statements with ‘UJ’ so 
> you will see the log has those debug statements.
>
>  
>
> Thanks
>
> Ujjwala
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org

James
-------
http://radio.weblogs.com/0112098/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message