RenderedImageMapOutputFormat readBestCoverage(..) parametercopying is creating 
an oversized array
-------------------------------------------------------------------------------------------------

                 Key: GEOS-4388
                 URL: http://jira.codehaus.org/browse/GEOS-4388
             Project: GeoServer
          Issue Type: Bug
          Components: WMS
    Affects Versions: 2.1-RC1
            Reporter: Fredrik Holmqvist
            Assignee: Andrea Aime


The current code adds length extra items that are all null in the parameter 
copying:

{code}
  // add the correct read geometry to the supplied
  // params since we did not find anything
  final int size =length+(!foundGG&&!foundInterpolation?2:1);
  GeneralParameterValue[] readParams2 = new GeneralParameterValue[length + 
size];
  System.arraycopy(readParams, 0, readParams2, 0, length);
  if(!foundGG)
      readParams2[length] = readGG;
  if(!foundInterpolation)
      readParams2[length-(foundGG?0:-1)] = readInterpolation;
  coverage = (GridCoverage2D) reader.read(readParams2);
{code}
Problems:
 * size is already length + 'no of extra items', don't allocate length + size 
when declaring readParams2
 * why use substract '-1' when just adding '1' would be much cleaner when 
inserting readInterpolation?

-- 
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

        

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to