Program: 94365
Project: 94365
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public int run(CommandLine line,Configuration conf,ProviderProperties providerProperties) throws ParseException {
  log.info("String_Node_Str");
  try {
    if (line.hasOption("String_Node_Str") && (line.hasOption("String_Node_Str") || line.hasOption("String_Node_Str") || line.hasOption("String_Node_Str")|| line.hasOption("String_Node_Str"))) {
      throw new ParseException("String_Node_Str");
    }
    if (line.hasOption("String_Node_Str") && line.hasOption("String_Node_Str")) {
      throw new ParseException("String_Node_Str");
    }
    if (line.hasOption("String_Node_Str")) {
      LoggingUtils.setDefaultLogLevel(LoggingUtils.INFO);
    }
    if (line.hasOption("String_Node_Str")) {
      LoggingUtils.setDefaultLogLevel(LoggingUtils.DEBUG);
    }
    if (line.hasOption("String_Node_Str")) {
      System.out.println("String_Node_Str");
      HadoopUtils.setupLocalRunner(conf);
    }
    String outputbase=line.getOptionValue("String_Node_Str");
    if (line.hasOption("String_Node_Str")) {
      maxTiles=Integer.parseInt(line.getOptionValue("String_Node_Str"));
    }
    useRand=line.hasOption("String_Node_Str");
    boolean all=line.hasOption("String_Node_Str");
    boolean singleImage=line.hasOption("String_Node_Str");
    mosaicTiles=line.hasOption("String_Node_Str");
    if (mosaicTiles) {
      mosaicTileCount=Integer.parseInt(line.getOptionValue("String_Node_Str"));
    }
    useBounds=line.hasOption("String_Node_Str");
    if (useBounds) {
      final String boundsOption=line.getOptionValue("String_Node_Str");
      bounds=parseBounds(boundsOption);
    }
    if (line.hasOption("String_Node_Str")) {
      colorscale=ColorScaleManager.fromName(line.getOptionValue("String_Node_Str"));
    }
    if (line.hasOption("String_Node_Str")) {
      maxSizeInKb=SparkUtils.humantokb(line.getOptionValue("String_Node_Str"));
    }
    boolean useTileSet=line.hasOption("String_Node_Str");
    if (useTileSet) {
      tileset=new HashSet<Long>();
      final String tileIdOption=line.getOptionValue("String_Node_Str");
      final String[] tileIds=tileIdOption.split("String_Node_Str");
      for (      final String tileId : tileIds) {
        tileset.add(Long.valueOf(tileId));
      }
    }
    int zoomlevel=-1;
    if (line.hasOption("String_Node_Str")) {
      zoomlevel=Integer.parseInt(line.getOptionValue("String_Node_Str"));
    }
    String format="String_Node_Str";
    if (line.hasOption("String_Node_Str")) {
      format=line.getOptionValue("String_Node_Str");
    }
    useTMS=line.hasOption("String_Node_Str");
    if (maxSizeInKb > 0 && !singleImage) {
      throw new ParseException("String_Node_Str");
    }
    for (    final String arg : line.getArgs()) {
      MrsPyramid imagePyramid;
      MrsPyramid pyramid=null;
      String pyramidName="String_Node_Str";
      try {
        MrsImageDataProvider dp=DataProviderFactory.getMrsImageDataProvider(arg,DataProviderFactory.AccessMode.READ,providerProperties);
        imagePyramid=MrsPyramid.open(dp);
        pyramidName=dp.getSimpleResourceName();
        pyramid=imagePyramid;
      }
 catch (      IOException e) {
        imagePyramid=null;
      }
      if (imagePyramid == null) {
        throw new ParseException("String_Node_Str");
      }
      MrsPyramidMetadata meta=pyramid.getMetadata();
      ColorScaleApplier applier=null;
      if (colorscale != null || !"String_Node_Str".equalsIgnoreCase(format)) {
switch (format) {
case "String_Node_Str":
case "String_Node_Str":
          applier=new JpegColorScaleApplier();
        break;
case "String_Node_Str":
case "String_Node_Str":
default :
      applier=new PngColorScaleApplier();
    break;
}
}
if (maxSizeInKb > 0) {
MrGeoRaster raster=pyramid.getHighestResImage().getRaster();
int bytesPerPixelPerBand=(applier != null) ? applier.getBytesPerPixelPerBand() : raster.bytesPerPixel();
int bands=(applier != null) ? applier.getBands(raster) : 1;
Bounds b=(useBounds) ? bounds : pyramid.getBounds();
int maxZoom=pyramid.getMaximumLevel();
zoomlevel=RasterUtils.getMaxPixelsForSize(maxSizeInKb,b,bytesPerPixelPerBand,bands,meta.getTilesize()).getZoom();
zoomlevel=Math.min(zoomlevel,maxZoom);
System.out.println("String_Node_Str" + zoomlevel);
}
 else if (zoomlevel <= 0) {
zoomlevel=pyramid.getMaximumLevel();
}
int end=zoomlevel;
if (all) {
end=1;
}
while (zoomlevel >= end) {
if (!useTileSet && line.hasOption("String_Node_Str")) {
  tileset=new HashSet<Long>();
  final String pointsOption=line.getOptionValue("String_Node_Str");
  final String[] points=pointsOption.split("String_Node_Str");
  if (points.length % 2 != 0) {
    throw new IOException("String_Node_Str");
  }
  for (int i=0; i < points.length; i+=2) {
    double lon=Double.valueOf(points[i].trim());
    double lat=Double.valueOf(points[i + 1].trim());
    Tile pointTile=TMSUtils.latLonToTile(lat,lon,zoomlevel,pyramid.getTileSize());
    tileset.add(Long.valueOf(TMSUtils.tileid(pointTile.getTx(),pointTile.getTy(),zoomlevel)));
  }
}
MrsImage image=imagePyramid.getImage(zoomlevel);
try {
  final Set<Long> tiles=calculateTiles(pyramid,zoomlevel);
  int tilesize=imagePyramid.getTileSize();
  if (singleImage) {
    String ob=outputbase;
    if (all) {
      ob+="String_Node_Str" + zoomlevel;
    }
    saveMultipleTiles(ob,pyramidName,format,image,applier,ArrayUtils.toPrimitive(tiles.toArray(new Long[tiles.size()])),providerProperties);
  }
 else   if (mosaicTiles && mosaicTileCount > 0) {
    if (!outputbase.contains(X) || !outputbase.contains(Y) || !outputbase.contains(LAT)|| !outputbase.contains(LON)) {
      outputbase=outputbase + "String_Node_Str";
    }
    for (    final Long tileid : tiles) {
      final Tile t=TMSUtils.tileid(tileid,zoomlevel);
      final Set<Long> tilesToMosaic=new HashSet<>();
      final LongRectangle tileBounds=pyramid.getTileBounds(zoomlevel);
      for (long ty1=t.ty; ((ty1 < (t.ty + mosaicTileCount)) && (ty1 <= tileBounds.getMaxY())); ty1++) {
        for (long tx1=t.tx; ((tx1 < (t.tx + mosaicTileCount)) && (tx1 <= tileBounds.getMaxX())); tx1++) {
          tilesToMosaic.add(TMSUtils.tileid(tx1,ty1,zoomlevel));
        }
      }
      saveMultipleTiles(outputbase,pyramidName,format,image,applier,ArrayUtils.toPrimitive(tilesToMosaic.toArray(new Long[tilesToMosaic.size()])),providerProperties);
    }
  }
 else {
    for (    final Long tileid : tiles) {
      saveSingleTile(outputbase,pyramidName,image,applier,format,tileid,zoomlevel,tilesize,providerProperties);
    }
  }
}
  finally {
  if (image != null) {
    image.close();
  }
}
zoomlevel--;
}
}
return 0;
}
 catch (ColorScale.ColorScaleException|IOException e) {
log.error("String_Node_Str",e);
}
return -1;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public int run(CommandLine line,Configuration conf,ProviderProperties providerProperties) throws ParseException {
  log.info("String_Node_Str");
  try {
    if (line.hasOption("String_Node_Str") && (line.hasOption("String_Node_Str") || line.hasOption("String_Node_Str") || line.hasOption("String_Node_Str")|| line.hasOption("String_Node_Str"))) {
      throw new ParseException("String_Node_Str");
    }
    if (line.hasOption("String_Node_Str") && line.hasOption("String_Node_Str")) {
      throw new ParseException("String_Node_Str");
    }
    if (line.hasOption("String_Node_Str")) {
      LoggingUtils.setDefaultLogLevel(LoggingUtils.INFO);
    }
    if (line.hasOption("String_Node_Str")) {
      LoggingUtils.setDefaultLogLevel(LoggingUtils.DEBUG);
    }
    if (line.hasOption("String_Node_Str")) {
      System.out.println("String_Node_Str");
      HadoopUtils.setupLocalRunner(conf);
    }
    String outputbase=line.getOptionValue("String_Node_Str");
    if (line.hasOption("String_Node_Str")) {
      maxTiles=Integer.parseInt(line.getOptionValue("String_Node_Str"));
    }
    useRand=line.hasOption("String_Node_Str");
    boolean all=line.hasOption("String_Node_Str");
    boolean singleImage=line.hasOption("String_Node_Str");
    mosaicTiles=line.hasOption("String_Node_Str");
    if (mosaicTiles) {
      mosaicTileCount=Integer.parseInt(line.getOptionValue("String_Node_Str"));
    }
    useBounds=line.hasOption("String_Node_Str");
    if (useBounds) {
      final String boundsOption=line.getOptionValue("String_Node_Str");
      bounds=parseBounds(boundsOption);
    }
    if (line.hasOption("String_Node_Str")) {
      colorscale=ColorScaleManager.fromName(line.getOptionValue("String_Node_Str"));
    }
    if (line.hasOption("String_Node_Str")) {
      maxSizeInKb=SparkUtils.humantokb(line.getOptionValue("String_Node_Str"));
    }
    boolean useTileSet=line.hasOption("String_Node_Str");
    if (useTileSet) {
      tileset=new HashSet<Long>();
      final String tileIdOption=line.getOptionValue("String_Node_Str");
      final String[] tileIds=tileIdOption.split("String_Node_Str");
      for (      final String tileId : tileIds) {
        tileset.add(Long.valueOf(tileId));
      }
    }
    int zoomlevel=-1;
    if (line.hasOption("String_Node_Str")) {
      zoomlevel=Integer.parseInt(line.getOptionValue("String_Node_Str"));
    }
    String format="String_Node_Str";
    if (line.hasOption("String_Node_Str")) {
      format=line.getOptionValue("String_Node_Str");
    }
    useTMS=line.hasOption("String_Node_Str");
    if (maxSizeInKb > 0 && !singleImage) {
      throw new ParseException("String_Node_Str");
    }
    for (    final String arg : line.getArgs()) {
      MrsPyramid imagePyramid;
      MrsPyramid pyramid=null;
      String pyramidName="String_Node_Str";
      try {
        MrsImageDataProvider dp=DataProviderFactory.getMrsImageDataProvider(arg,DataProviderFactory.AccessMode.READ,providerProperties);
        imagePyramid=MrsPyramid.open(dp);
        pyramidName=dp.getSimpleResourceName();
        pyramid=imagePyramid;
      }
 catch (      IOException e) {
        imagePyramid=null;
      }
      if (imagePyramid == null) {
        throw new ParseException("String_Node_Str");
      }
      MrsPyramidMetadata meta=pyramid.getMetadata();
      ColorScaleApplier applier=null;
      if (colorscale != null || !"String_Node_Str".equalsIgnoreCase(format)) {
switch (format) {
case "String_Node_Str":
case "String_Node_Str":
          applier=new JpegColorScaleApplier();
        break;
case "String_Node_Str":
case "String_Node_Str":
default :
      applier=new PngColorScaleApplier();
    break;
}
}
if (maxSizeInKb > 0) {
MrGeoRaster rasterForAnyTile=pyramid.getHighestResImage().getAnyTile();
int bytesPerPixelPerBand=(applier != null) ? applier.getBytesPerPixelPerBand() : rasterForAnyTile.bytesPerPixel();
int bands=(applier != null) ? applier.getBands(pyramid.getMetadata().getBands()) : 1;
Bounds b=(useBounds) ? bounds : pyramid.getBounds();
int maxZoom=pyramid.getMaximumLevel();
zoomlevel=RasterUtils.getMaxPixelsForSize(maxSizeInKb,b,bytesPerPixelPerBand,bands,meta.getTilesize()).getZoom();
zoomlevel=Math.min(zoomlevel,maxZoom);
System.out.println("String_Node_Str" + zoomlevel);
}
 else if (zoomlevel <= 0) {
zoomlevel=pyramid.getMaximumLevel();
}
int end=zoomlevel;
if (all) {
end=1;
}
while (zoomlevel >= end) {
if (!useTileSet && line.hasOption("String_Node_Str")) {
  tileset=new HashSet<Long>();
  final String pointsOption=line.getOptionValue("String_Node_Str");
  final String[] points=pointsOption.split("String_Node_Str");
  if (points.length % 2 != 0) {
    throw new IOException("String_Node_Str");
  }
  for (int i=0; i < points.length; i+=2) {
    double lon=Double.valueOf(points[i].trim());
    double lat=Double.valueOf(points[i + 1].trim());
    Tile pointTile=TMSUtils.latLonToTile(lat,lon,zoomlevel,pyramid.getTileSize());
    tileset.add(Long.valueOf(TMSUtils.tileid(pointTile.getTx(),pointTile.getTy(),zoomlevel)));
  }
}
MrsImage image=imagePyramid.getImage(zoomlevel);
try {
  final Set<Long> tiles=calculateTiles(pyramid,zoomlevel);
  int tilesize=imagePyramid.getTileSize();
  if (singleImage) {
    String ob=outputbase;
    if (all) {
      ob+="String_Node_Str" + zoomlevel;
    }
    saveMultipleTiles(ob,pyramidName,format,image,applier,ArrayUtils.toPrimitive(tiles.toArray(new Long[tiles.size()])),providerProperties);
  }
 else   if (mosaicTiles && mosaicTileCount > 0) {
    if (!outputbase.contains(X) || !outputbase.contains(Y) || !outputbase.contains(LAT)|| !outputbase.contains(LON)) {
      outputbase=outputbase + "String_Node_Str";
    }
    for (    final Long tileid : tiles) {
      final Tile t=TMSUtils.tileid(tileid,zoomlevel);
      final Set<Long> tilesToMosaic=new HashSet<>();
      final LongRectangle tileBounds=pyramid.getTileBounds(zoomlevel);
      for (long ty1=t.ty; ((ty1 < (t.ty + mosaicTileCount)) && (ty1 <= tileBounds.getMaxY())); ty1++) {
        for (long tx1=t.tx; ((tx1 < (t.tx + mosaicTileCount)) && (tx1 <= tileBounds.getMaxX())); tx1++) {
          tilesToMosaic.add(TMSUtils.tileid(tx1,ty1,zoomlevel));
        }
      }
      saveMultipleTiles(outputbase,pyramidName,format,image,applier,ArrayUtils.toPrimitive(tilesToMosaic.toArray(new Long[tilesToMosaic.size()])),providerProperties);
    }
  }
 else {
    for (    final Long tileid : tiles) {
      saveSingleTile(outputbase,pyramidName,image,applier,format,tileid,zoomlevel,tilesize,providerProperties);
    }
  }
}
  finally {
  if (image != null) {
    image.close();
  }
}
zoomlevel--;
}
}
return 0;
}
 catch (ColorScale.ColorScaleException|IOException e) {
log.error("String_Node_Str",e);
}
return -1;
}