On Tue, Feb 11, 2014 at 11:01 PM, Jody Garnett <[email protected]>wrote:
> Wow you certainly find the epic bugs.
>
I'm a lucky guy :-p
>
> Reading your patch you you use converter to "cast" the objects to the same
> type:
>
> Object other = expLit.evaluate(null, this.literal.getClass());
> return other != null && other.equals(this.literal);
>
> I would feel more comfortable adding an extra fallback if this cast does
> not work. Casting both to String (since that is how Filter being an XML
> spec plays the game):
>
> Object other = expLit.evaluate(null, this.literal.getClass());
> if( other != null ){
> return other.equals(this.literal);
> else {
> String str1 = this.evaulate( null, String.class );
> String str2 = expLit.evaulate( null, String.class );
> return str1 != null && str2 != null && str1.equals(str2);
> }
>
Good call, added it. I also make it test the conversion the other way (from
this object, to the class of the other literal)
as converters might only work one way:
https://github.com/aaime/geotools/blob/geot-4698/modules/library/main/src/main/java/org/geotools/filter/LiteralExpressionImpl.java#L249
Cheers
Andrea
--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel