You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Simon Kitching <sk...@obsidium.com> on 2006/01/03 23:09:29 UTC

Re: svn commit: r365751 - /myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java

werpu@apache.org wrote:
> Author: werpu
> Date: Tue Jan  3 13:52:40 2006
> New Revision: 365751
> 
> URL: http://svn.apache.org/viewcvs?rev=365751&view=rev
> Log:
> fixed a bug, which caused the jdk 1.4 to fail on the 
> BigDecimal constructors
> 
> Modified:
>     myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java
> 
> -        _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new BigDecimal(123), createCities(new String[]{"Wien","Graz","Linz","Salzburg"})));
> +        _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new BigDecimal((long)123), createCities(new String[]{"Wien","Graz","Linz","Salzburg"})));

Wouldn't it be better to use this?
   new BigDecimal(123L)

This will definitely store the constant in the class as a LONG type. The 
"(long)123" syntax might store the constant as an int, then perform the 
typecast at runtime.

Of course it's a pretty minor point...

Cheers,

Simon


Re: svn commit: r365751 - /myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java

Posted by Werner Punz <we...@gmx.at>.
done


Werner Punz wrote:
> Yes you are right... I will change it immediately
> 
> 
> Simon Kitching wrote:
> 
>> werpu@apache.org wrote:
>>
>>> Author: werpu
>>> Date: Tue Jan  3 13:52:40 2006
>>> New Revision: 365751
>>>
>>> URL: http://svn.apache.org/viewcvs?rev=365751&view=rev
>>> Log:
>>> fixed a bug, which caused the jdk 1.4 to fail on the BigDecimal 
>>> constructors
>>>
>>> Modified:
>>>     
>>> myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java 
>>>
>>>
>>> -        _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new 
>>> BigDecimal(123), createCities(new 
>>> String[]{"Wien","Graz","Linz","Salzburg"})));
>>> +        _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new 
>>> BigDecimal((long)123), createCities(new 
>>> String[]{"Wien","Graz","Linz","Salzburg"})));
>>
>>
>>
>> Wouldn't it be better to use this?
>>   new BigDecimal(123L)
>>
>> This will definitely store the constant in the class as a LONG type. 
>> The "(long)123" syntax might store the constant as an int, then 
>> perform the typecast at runtime.
>>
>> Of course it's a pretty minor point...
>>
>> Cheers,
>>
>> Simon
>>
>>
> 
> 


Re: svn commit: r365751 - /myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java

Posted by Werner Punz <we...@gmx.at>.
Yes you are right... I will change it immediately


Simon Kitching wrote:
> werpu@apache.org wrote:
> 
>> Author: werpu
>> Date: Tue Jan  3 13:52:40 2006
>> New Revision: 365751
>>
>> URL: http://svn.apache.org/viewcvs?rev=365751&view=rev
>> Log:
>> fixed a bug, which caused the jdk 1.4 to fail on the BigDecimal 
>> constructors
>>
>> Modified:
>>     
>> myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java 
>>
>>
>> -        _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new 
>> BigDecimal(123), createCities(new 
>> String[]{"Wien","Graz","Linz","Salzburg"})));
>> +        _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new 
>> BigDecimal((long)123), createCities(new 
>> String[]{"Wien","Graz","Linz","Salzburg"})));
> 
> 
> Wouldn't it be better to use this?
>   new BigDecimal(123L)
> 
> This will definitely store the constant in the class as a LONG type. The 
> "(long)123" syntax might store the constant as an int, then perform the 
> typecast at runtime.
> 
> Of course it's a pretty minor point...
> 
> Cheers,
> 
> Simon
> 
>