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. Cheers Andrea -- ------------------------------------------------------- Ing. Andrea Aime GeoSolutions S.A.S. Tech lead Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.youtube.com/user/GeoSolutionsIT http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ------------------------------------------------------- ------------------------------------------------------------------------------ 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