[ 
https://issues.apache.org/jira/browse/WICKET-3385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993867#comment-12993867
 ] 

Martin Grigorov commented on WICKET-3385:
-----------------------------------------

You know that Java (and Scala) use type erasure and this 'C' is lost at runtime.
Give it a try locally and see what happens.
ConvertersTest will show you all class casts.

> org.apache.wicket.util.convert.converter.BigDecimalConverter parse method 
> returns BigDecimal
> --------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3385
>                 URL: https://issues.apache.org/jira/browse/WICKET-3385
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-RC1
>         Environment: all
>            Reporter: Richard Emberson
>            Assignee: Martin Grigorov
>            Priority: Trivial
>
> if
> BigDecimalConverter parametrizes AbstractDecimalConverter with BigDecimal
> then
> AbstractDecimalConverter parametrizes  AbstractNumberConverter with BigDecimal
> and then
> AbstractNumberConverter parametrizes  AbstractConverter with BigDecimal
> which means that AbstractNumberConverter parse method returns a BigDecimal
> so that in BigDecimalConverter convertToObject method
> the line:
>  final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, 
> locale);
> should be:
>  final BigDecimal bigDecimal = parse(value, -Double.MAX_VALUE, 
> Double.MAX_VALUE, locale);
> and all the code that follows that line can be replaced with:
>  return bigDecimal;

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to