Program: 94408
Project: 94408
Buggy source:
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") @GET @Produces("String_Node_Str") @Path("String_Node_Str") public Response getImage(@PathParam("String_Node_Str") String imgName,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String format,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String bbox,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int width,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int height,@QueryParam("String_Node_Str") String colorScaleName,@QueryParam("String_Node_Str") String colorScale,@QueryParam("String_Node_Str") Double min,@QueryParam("String_Node_Str") Double max,@QueryParam("String_Node_Str") String srs,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int zoomLevel){
  String error;
  try {
    String[] bBoxValues=bbox.split("String_Node_Str");
    if (bBoxValues.length != 4) {
      return Response.status(Status.BAD_REQUEST).entity("String_Node_Str").build();
    }
    double minX=Double.valueOf(bBoxValues[0]);
    double minY=Double.valueOf(bBoxValues[1]);
    double maxX=Double.valueOf(bBoxValues[2]);
    double maxY=Double.valueOf(bBoxValues[3]);
    Bounds bounds=new Bounds(minX,minY,maxX,maxY);
    bounds=RequestUtils.reprojectBounds(bounds,srs);
    ColorScale cs=null;
    try {
      if (colorScaleName != null) {
        if (colorScale != null) {
          return Response.status(Status.BAD_REQUEST).entity("String_Node_Str").build();
        }
        cs=service.getColorScaleFromName(colorScaleName);
      }
 else       if (colorScale != null) {
        cs=service.getColorScaleFromJSON(colorScale);
      }
    }
 catch (    Exception e) {
      return Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build();
    }
    if (zoomLevel != -1) {
      MrsPyramid pyramid=service.getPyramid(imgName,SecurityUtils.getProviderProperties());
      if (pyramid == null) {
        return Response.status(Status.NOT_FOUND).entity(imgName + "String_Node_Str").build();
      }
      if (pyramid.getMetadata().getName(zoomLevel) == null) {
        return Response.status(Status.BAD_REQUEST).entity("String_Node_Str").build();
      }
    }
    if (!format.equals(KML_INPUT_FORMAT)) {
      MrsPyramid pyramid=service.getPyramid(imgName,SecurityUtils.getProviderProperties());
      if (pyramid == null) {
        return Response.status(Status.NOT_FOUND).entity(imgName + "String_Node_Str").build();
      }
      if (!bounds.toEnvelope().intersects(pyramid.getBounds().toEnvelope())) {
        log.debug("String_Node_Str");
        byte imageData[]=service.getEmptyTile(width,height,format);
        String type=service.getContentType(format);
        return Response.ok(imageData).header("String_Node_Str",type).build();
      }
      ImageRenderer renderer;
      try {
        renderer=service.getImageRenderer(format);
      }
 catch (      IllegalArgumentException e) {
        if (e.getMessage().toUpperCase().contains("String_Node_Str")) {
          return Response.status(Status.BAD_REQUEST).entity("String_Node_Str" + format).build();
        }
        throw e;
      }
      Raster result=renderer.renderImage(imgName,bounds,width,height,SecurityUtils.getProviderProperties(),srs);
      if (!(renderer instanceof TiffImageRenderer)) {
        log.debug("String_Node_Str" + imgName + "String_Node_Str");
        double[] overrideExtrema=renderer.getExtrema();
        if (min != null)         overrideExtrema[0]=min;
        if (max != null)         overrideExtrema[1]=max;
        result=service.applyColorScaleToImage(format,result,cs,renderer,overrideExtrema);
        log.debug("String_Node_Str" + imgName);
      }
      return service.getImageResponseWriter(format).write(result,imgName,bounds).build();
    }
 else {
      return service.renderKml(imgName,bounds,width,height,cs,zoomLevel,SecurityUtils.getProviderProperties());
    }
  }
 catch (  FileNotFoundException fnfe) {
    return Response.status(Status.NOT_FOUND).entity(fnfe.getMessage()).build();
  }
catch (  Exception e) {
    error=e.getMessage();
    log.error("String_Node_Str" + e.getMessage(),e);
  }
  return Response.serverError().entity(error).build();
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") @GET @Produces("String_Node_Str") @Path("String_Node_Str") public Response getImage(@PathParam("String_Node_Str") String imgName,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String format,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String bbox,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int width,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int height,@QueryParam("String_Node_Str") String colorScaleName,@QueryParam("String_Node_Str") String colorScale,@QueryParam("String_Node_Str") Double min,@QueryParam("String_Node_Str") Double max,@QueryParam("String_Node_Str") String srs,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int zoomLevel){
  String error;
  try {
    String[] bBoxValues=bbox.split("String_Node_Str");
    if (bBoxValues.length != 4) {
      return Response.status(Status.BAD_REQUEST).entity("String_Node_Str").build();
    }
    double minX=Double.valueOf(bBoxValues[0]);
    double minY=Double.valueOf(bBoxValues[1]);
    double maxX=Double.valueOf(bBoxValues[2]);
    double maxY=Double.valueOf(bBoxValues[3]);
    Bounds bounds=new Bounds(minX,minY,maxX,maxY);
    ColorScale cs=null;
    try {
      if (colorScaleName != null) {
        if (colorScale != null) {
          return Response.status(Status.BAD_REQUEST).entity("String_Node_Str").build();
        }
        cs=service.getColorScaleFromName(colorScaleName);
      }
 else       if (colorScale != null) {
        cs=service.getColorScaleFromJSON(colorScale);
      }
    }
 catch (    Exception e) {
      return Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build();
    }
    if (zoomLevel != -1) {
      MrsPyramid pyramid=service.getPyramid(imgName,SecurityUtils.getProviderProperties());
      if (pyramid == null) {
        return Response.status(Status.NOT_FOUND).entity(imgName + "String_Node_Str").build();
      }
      if (pyramid.getMetadata().getName(zoomLevel) == null) {
        return Response.status(Status.BAD_REQUEST).entity("String_Node_Str").build();
      }
    }
    if (!format.equals(KML_INPUT_FORMAT)) {
      MrsPyramid pyramid=service.getPyramid(imgName,SecurityUtils.getProviderProperties());
      if (pyramid == null) {
        return Response.status(Status.NOT_FOUND).entity(imgName + "String_Node_Str").build();
      }
      if (!bounds.toEnvelope().intersects(pyramid.getBounds().toEnvelope())) {
        log.debug("String_Node_Str");
        byte imageData[]=service.getEmptyTile(width,height,format);
        String type=service.getContentType(format);
        return Response.ok(imageData).header("String_Node_Str",type).build();
      }
      ImageRenderer renderer;
      try {
        renderer=service.getImageRenderer(format);
      }
 catch (      IllegalArgumentException e) {
        if (e.getMessage().toUpperCase().contains("String_Node_Str")) {
          return Response.status(Status.BAD_REQUEST).entity("String_Node_Str" + format).build();
        }
        throw e;
      }
      Raster result=renderer.renderImage(imgName,bounds,width,height,SecurityUtils.getProviderProperties(),srs);
      if (!(renderer instanceof TiffImageRenderer)) {
        log.debug("String_Node_Str" + imgName + "String_Node_Str");
        double[] overrideExtrema=renderer.getExtrema();
        if (min != null)         overrideExtrema[0]=min;
        if (max != null)         overrideExtrema[1]=max;
        result=service.applyColorScaleToImage(format,result,cs,renderer,overrideExtrema);
        log.debug("String_Node_Str" + imgName);
      }
      return service.getImageResponseWriter(format).write(result,imgName,bounds).build();
    }
 else {
      return service.renderKml(imgName,bounds,width,height,cs,zoomLevel,SecurityUtils.getProviderProperties());
    }
  }
 catch (  FileNotFoundException fnfe) {
    return Response.status(Status.NOT_FOUND).entity(fnfe.getMessage()).build();
  }
catch (  Exception e) {
    error=e.getMessage();
    log.error("String_Node_Str" + e.getMessage(),e);
  }
  return Response.serverError().entity(error).build();
}