Thank's guys for the responses. > However, I don't think there were many other property accessors > at the time and probably not finding any property accessor the > code ended up returning null anyways? Not sure...
Hmm.. that could be it. Anyway, I raised a bug for this and assigned to myself: http://jira.codehaus.org/browse/GEOT-2976. The behaviour corrupts not only the null-containing feature, but the next features as well (since the accessor is cached and reused). It also prevents us from using isNull() function, since the XPathPropertyAccessor never returns null. Regards Rini -----Original Message----- From: Andrea Aime [mailto:[email protected]] Sent: Wednesday, 10 March 2010 11:55 PM To: Justin Deoliveira Cc: Angreani, Rini (CESRE, Kensington); [email protected] Subject: Re: [Geotools-devel] question about SimpleFeaturePropertyAccessor Justin Deoliveira ha scritto: > Hi Rini, > > I see your point. And off the top of my head I can't think of any > specific reason for that behavior. That said I would be a little weary > of changing it as I am guessing it was done for some reason that is > escaping me at the moment. > > I am open to changing it but I think we would want to do a good set of > regression testing if we do. svn blame points at me for that line of code with a rather unhelpful commit log: ----------------------------------------------------------------------- r27215 | aaime | 2007-09-29 18:57:30 +0200 (sab, 29 set 2007) | 1 line Yay, filter switched and test passing ----------------------------------------------------------------------- However the date is telling a lot: that day we were doing the code sprint at Refractions Research after FOSS4G 2007, which is when we switched the code base to the new model. Lots of search and replace without much thinking, and the line of code before my modification was: if ( object instanceof Feature ) { return ((Feature) object).getAttribute( xpath ) != null; } It seems to me the meaning was maintained, as the old Feature class was a pure simple feature. However, I don't think there were many other property accessors at the time and probably not finding any property accessor the code ended up returning null anyways? Not sure... Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
