NullPointerException on WrappingProjectionHandler when rewrapping all the 
clones into a single geometry
-------------------------------------------------------------------------------------------------------

                 Key: GEOT-2988
                 URL: http://jira.codehaus.org/browse/GEOT-2988
             Project: GeoTools
          Issue Type: Bug
          Components: core render
    Affects Versions: 2.5.8
            Reporter: Alessio Fabiani
            Assignee: Andrea Aime
            Priority: Critical


The postProcess method of the WrappingProjectionHandler performs a check in 
order to rewrap all the clones into a single geometry.

The code below is a snippet of the algorithm:

        // rewrap all the clones into a single geometry
        if (Point.class.equals(geomType)) {
            Point[] points = (Point[]) geoms.toArray(new Point[geoms.size()]);
            return geometry.getFactory().createMultiPoint(points);
        } else if (LineString.class.isAssignableFrom(geomType)) {
            LineString[] lines = (LineString[]) geoms.toArray(new 
LineString[geoms.size()]);
            return geometry.getFactory().createMultiLineString(lines);
        } else if (Polygon.class.equals(geomType)) {
            Polygon[] polys = (Polygon[]) geoms.toArray(new 
Polygon[geoms.size()]);
            return geometry.getFactory().createMultiPolygon(polys);
        } else {
            return geometry.getFactory().createGeometryCollection(
                    (Geometry[]) geoms.toArray(new Geometry[geoms.size()]));
        }

On the above code there is no check for geomType == null thus causing the 
method to throw Null Pointer Exceptions in such cases.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
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
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to