You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2006/01/03 22:52:51 UTC

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

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

Modified: myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java
URL: http://svn.apache.org/viewcvs/myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java?rev=365751&r1=365750&r2=365751&view=diff
==============================================================================
--- myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java (original)
+++ myfaces/examples/trunk/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCountryList.java Tue Jan  3 13:52:40 2006
@@ -102,12 +102,12 @@
 
     public SimpleCountryList()
     {
-        _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new BigDecimal(123), createCities(new String[]{"Wien","Graz","Linz","Salzburg"})));
-        _countries.add(new SimpleCountry(2, "AZERBAIJAN", "AZ", new BigDecimal(535), createCities(new String[]{"Baku","Sumgait","Qabala","Agdam"})));
-        _countries.add(new SimpleCountry(3, "BAHAMAS", "BS", new BigDecimal(1345623), createCities(new String[]{"Nassau","Alice Town","Church Grove","West End"})));
-        _countries.add(new SimpleCountry(4, "BAHRAIN", "BH", new BigDecimal(346), createCities(new String[]{"Bahrain"})));
-        _countries.add(new SimpleCountry(5, "BANGLADESH", "BD", new BigDecimal(456), createCities(new String[]{"Chittagong","Chandpur","Bogra","Feni"})));
-        _countries.add(new SimpleCountry(6, "BARBADOS", "BB", new BigDecimal(45645), createCities(new String[]{"Grantley Adams"})));
+        _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new BigDecimal((long)123), createCities(new String[]{"Wien","Graz","Linz","Salzburg"})));
+        _countries.add(new SimpleCountry(2, "AZERBAIJAN", "AZ", new BigDecimal((long)535), createCities(new String[]{"Baku","Sumgait","Qabala","Agdam"})));
+        _countries.add(new SimpleCountry(3, "BAHAMAS", "BS", new BigDecimal((long)1345623), createCities(new String[]{"Nassau","Alice Town","Church Grove","West End"})));
+        _countries.add(new SimpleCountry(4, "BAHRAIN", "BH", new BigDecimal((long)346), createCities(new String[]{"Bahrain"})));
+        _countries.add(new SimpleCountry(5, "BANGLADESH", "BD", new BigDecimal((long)456), createCities(new String[]{"Chittagong","Chandpur","Bogra","Feni"})));
+        _countries.add(new SimpleCountry(6, "BARBADOS", "BB", new BigDecimal((long)45645), createCities(new String[]{"Grantley Adams"})));
     }
 
     /**



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
> 
> 


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

Posted by Simon Kitching <sk...@obsidium.com>.
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