Hmm I'm just not sure your extra code is needed.  There is already a 
converter to convert from Strings to Numbers - what I really need is to 
ensure that doubles are not converted to integers.

I wonder if we just need to call the convert function with Number 
instead of double/integer etc.  This will convert strings if necessary. 
  I'm thinking of this (passes all of the test cases you provided 
previously):

Object o =  Converters.convert(v2, (v1 instanceof Number) ? Number.class
: v1.getClass());

instead of

Object o =  Converters.convert(v2, v1.getClass());


Emily



Jody Garnett wrote:
>> This doesn't seem to be the case in this test case.  In the eval function of
>> BinaryComparisonAbstract class it seems that the literals "1" and "1.5" in
>> my case is actually showing up as Integer and Double respectively; that is
>> why my instanceOf Number check works out.  It would not work out if there
>> were actually strings.
> 
> And the approach I proposed; that would help out of they were actually
> strings right?
> 
> I wonder if we could make a "converter" for Number; and ask the
> comparison to try and convert things to a Number first (your earlier
> patch was a request to try a numeric conversion first; and only if
> that fails do a string based comparison).
> 
> We actually do not do a string based comparison; we try and use
> Comparable (so enumerated types can be good values etc...).
> 
> 
> Jody


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to