Sure thing. I'm on to it now.

Thanks for the feedback.

Brett

Sent from my iPad

On 23/07/2013, at 8:34 PM, "Daniele Romagnoli" 
<daniele.romagn...@geo-solutions.it<mailto:daniele.romagn...@geo-solutions.it>> 
wrote:



On Sat, Jul 20, 2013 at 2:58 PM, Andrea Aime 
<andrea.a...@geo-solutions.it<mailto:andrea.a...@geo-solutions.it>> wrote:
On Fri, Jul 19, 2013 at 2:23 AM, Brett Walker 
<brett.wal...@geometryit.com<mailto:brett.wal...@geometryit.com>> wrote:
Just a bit more regarding this.

I’m more interested in why a TreeSet was used for Objects that don’t implement 
Comparable when a HashSet could have done.  This implementation detail is not 
immediately obvious.

By the looks of it I'm pretty sure your patch will break the netcdf reader once 
we stumble against real world data.
Readers have two well known dimensions, time and elevation, if you look at 
those, the treesets are already setting
up the proper comparator.

And then there are the "additional domains", which are extra dimension found in 
the NetCDF/Grib that can be
String, numbers, dates, that is, normally, comparables, for which the existing 
code should work, and your patched
version will surely fail.

The real question imho is why are we getting a range as an additional 
dimension... it's not impossible, but seems
a bit unlikely, I'll check the build and see why we are getting them in.


Generally speaking, the comparator for those two treeset of Object there should 
take care first of the case Comparable
against Comparable, and then try to do comparisons of date and number ranges as 
a fallback.
If the contents of the set are mixed type is most certainly an error, that 
should throw an exception.

I agree with Andrea on this:
In case we are putting mixed types in the set (DateRange as 1st object and 
NumberRange as 2nd, or viceversa) I would throw an exception instead of 
allowing them returning -1 or +1.
Could you update it this way?

Cheers,
Daniele


Anyways, this is my opinion after a cursory look, let me give it a spin with 
Java 7 and see

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<tel:%2B39%200584%20962313>
fax: +39 0584 1660272<tel:%2B39%200584%201660272>
mob: +39  339 8844549<tel:%2B39%20%C2%A0339%208844549>

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to