Andrea Aime wrote:
> Hi,
>
> I've been looking a little more in our converters usage and I believe I'm 
> finding quite a few issues.
>
> The first one is due to the following converters behaviour.
> The following snippet:
> System.out.println(Converters.convert("1002.5", Integer.class));
> System.out.println(Converters.convert("1002.0", Long.class));
> results in the following output:
> 1002
> 0
>   
I would like to see the following returned:
1003 (round up)
1002

That is I would like to get the same result when evaluating a 
ff.literal( 1002.5 ) and a ff.literal( "1002.5" ) to a Integer.
> That is, make a conversion when it makes sense, but do not try to force a 
> square peg in a round hole. Opinions?
>   
You are close to my understand but not quite in a agreement. I am trying 
to treat Literal expressions as "untyped" - ie try and make sure that 
"1", "1.0", 1.0f, 1.0 are all treated *exactly* same. By extension I 
want code not to have to notice if the literal started out life as 
ff.literal( new Date() ) or ff.literal( "2008-4-5" ) ... it should not 
matter.
> Long story short, is it ok if I try to fix the converters to avoid this silly 
> outputs?
>   
Please,
Jody

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to