On Fri, 2011-05-06 at 21:00 +0200, Andrea Aime wrote:
> On Fri, May 6, 2011 at 3:26 PM, Gabriel Roldán <grol...@opengeo.org> wrote:
> > Hi all,
> >
> > sorry for the cross-posting.
> >
> > I wonder what you think of explaining
> > org.geotools.data.DataUtilities.defaultValue that
> > AbstractGridCoverage2DReader and GeneralParameterValue are valid
> > arguments to that function and hence it should return null instead of
> > throwing IllegalArgumentException.
> >
> > Thing is that everytime geoserver renders a coverage two
> > IllegalArgumentException are thrown per request, comming from:
> >
> > wms.GetMap.run->geotools.resources.coverage.FeatureUtilities.wrapGridCoverageReader->SimpleFeatureTypeBuilder.add(String,
> >  
> > class)->AttributeTypeBuilder.setBinding(Class)->geotools.data.DataUtilities.defaultValue(Class),
> >  for arguments:
> >     * org.opengis.parameter.GeneralParameterValue
> >     * org.geotools.coverage.grid.io.AbstractGridCoverage2DReader
> >
> > It's not like it's really a big deal, and the profiler doesn't really
> > points to it as a performance problem, but since those two arguments are
> > so commonly used I think it'd be better for the method to know that than
> > having thousands of exceptions thrown?
> 
> I don't have a strong opinion on this one, as you said it does not seem
> like a big deal performance wise.
> Having DataUtilies.defaultValue() return null might be indeed acceptable,
> not sure if there is anything in the code depending on its current
> behavior.
I'm not proposing to change the behaviour of DataUtilities.defaultValue
(which is throwning a IAE upon an unknown type), but to just make it
know those are two possible values for which the default value is null?

Nonetheless, just wondering. Not a big deal.
> 
> Cheers
> Andrea
> 

-- 
Gabriel Roldan
grol...@opengeo.org
Expert service straight from the developers


------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to