nus-yam/ex-repair huggingface dataset:
Program: 94378
Project: 94378
Buggy source:
/** 
 * Returns a list of MrsImages available from all data sources. The names returned can be subsequently passed as the name parameter to getMrsImageDataProvider().
 * @return
 * @throws IOException
 */
public static String[] listImages(final ProviderProperties providerProperties) throws IOException {
  initialize(getBasicConfig());
  List<String> results=new ArrayList<String>();
  for (  final MrsImageDataProviderFactory factory : mrsImageProviderFactories.values()) {
    String[] images=factory.listImages(providerProperties);
    if (images != null && images.length > 0) {
      results.addAll(Arrays.asList(images));
    }
  }
  String[] returnValue=new String[results.size()];
  return results.toArray(returnValue);
}

Fixed version (ground truth):
/** 
 * Returns a list of MrsImages available from all data sources. The names returned can be subsequently passed as the name parameter to getMrsImageDataProvider().
 * @return
 * @throws IOException
 */
public static String[] listImages(final ProviderProperties providerProperties) throws IOException {
  Configuration conf=getBasicConfig();
  initialize(conf);
  List<String> results=new ArrayList<String>();
  for (  final MrsImageDataProviderFactory factory : mrsImageProviderFactories.values()) {
    String[] images=factory.listImages(conf,providerProperties);
    if (images != null && images.length > 0) {
      results.addAll(Arrays.asList(images));
    }
  }
  String[] returnValue=new String[results.size()];
  return results.toArray(returnValue);
}
Program: 94381
Project: 94381
Buggy source:
private RecordReader<TileIdWritable,RasterWritable> createRecordReader(final MrsPyramidInputSplit split,final TaskAttemptContext context) throws IOException {
  InputSplit initializeWithSplit;
  RecordReader<TileIdWritable,RasterWritable> recordReader=getRecordReader(split.getName(),context.getConfiguration());
  initializeWithSplit=split.getWrappedSplit();
  try {
    recordReader.initialize(initializeWithSplit,context);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
  return recordReader;
}

Fixed version (ground truth):
private RecordReader<TileIdWritable,RasterWritable> createRecordReader(final MrsPyramidInputSplit split,final TaskAttemptContext context) throws IOException {
  InputSplit initializeWithSplit;
  RecordReader<TileIdWritable,RasterWritable> recordReader=getRecordReader(split.getName(),context.getConfiguration());
  initializeWithSplit=split.getWrappedSplit();
  try {
    recordReader.initialize(initializeWithSplit,context);
  }
 catch (  InterruptedException e) {
    throw new IOException(e);
  }
  return recordReader;
}
Program: 94382
Project: 94382
Buggy source:
/** 
 * Give back an ad hoc data provider for a resource that is named by this method. Callers use this if they need to store ad hoc data, but don't care where that data resides. The caller must keep the returned provider instance for as long as they wish to access that ad hoc data.
 * @return
 */
public AdHocDataProvider createAdHocDataProvider(final ProviderProperties providerProperties) throws IOException ;

Fixed version (ground truth):
/** 
 * Give back an ad hoc data provider for a resource that is named by this method. Callers use this if they need to store ad hoc data, but don't care where that data resides. The caller must keep the returned provider instance for as long as they wish to access that ad hoc data.
 * @return
 */
public AdHocDataProvider createAdHocDataProvider(final Configuration conf,final ProviderProperties providerProperties) throws IOException ;
Program: 94383
Project: 94383
Buggy source:
/** 
 * Provider implementations should perform any needed checks within this method to determine if the other functions defined in this interface can be called reliably. For example, if the implementation requires some configuration settings in order to work properly, it can use this method to determine if those settings have been defined. Returning false from this method will prevent the provider from being called thereafter.
 * @return
 */
public boolean isValid();

Fixed version (ground truth):
/** 
 * Provider implementations should perform any needed checks within this method to determine if the other functions defined in this interface can be called reliably. For example, if the implementation requires some configuration settings in order to work properly, it can use this method to determine if those settings have been defined. Returning false from this method will prevent the provider from being called thereafter.
 * @return
 */
public boolean isValid(final Configuration conf);
Program: 94384
Project: 94384
Buggy source:
public boolean canOpen(final String name,final ProviderProperties providerProperties) throws IOException ;

Fixed version (ground truth):
public boolean canOpen(final String name,final Configuration conf,final ProviderProperties providerProperties) throws IOException ;
Program: 94385
Project: 94385
Buggy source:
public boolean exists(final String name,final ProviderProperties providerProperties) throws IOException ;

Fixed version (ground truth):
public boolean exists(final String name,final Configuration conf,final ProviderProperties providerProperties) throws IOException ;
Program: 94386
Project: 94386
Buggy source:
public boolean canWrite(final String name,final ProviderProperties providerProperties) throws IOException ;

Fixed version (ground truth):
public boolean canWrite(final String name,final Configuration conf,final ProviderProperties providerProperties) throws IOException ;
Program: 94387
Project: 94387
Buggy source:
public void delete(final String name,final ProviderProperties providerProperties) throws IOException ;

Fixed version (ground truth):
public void delete(final String name,final Configuration conf,final ProviderProperties providerProperties) throws IOException ;
Program: 94388
Project: 94388
Buggy source:
/** 
 * Creates a Reprojector from a specified code to another code. The codes take a form similar to "EPSG:4326".
 * @param codeSrc
 * @param codeDest
 * @return
 */
public static Reprojector createFromCode(String codeSrc,String codeDest){
  SpatialReference sourceSrs=new SpatialReference();
  int sourceEpsg=parseEpsgCode(codeSrc);
  sourceSrs.ImportFromEPSG(sourceEpsg);
  SpatialReference destSrs=new SpatialReference();
  int destEpsg=parseEpsgCode(codeDest);
  destSrs.ImportFromEPSG(destEpsg);
  return new Reprojector(sourceSrs,destSrs);
}

Fixed version (ground truth):
/** 
 * Creates a Reprojector from a specified code to another code. The codes take a form similar to "EPSG:4326".
 * @param codeSrc
 * @param codeDest
 * @return
 */
public static Reprojector createFromCode(String codeSrc,String codeDest){
  SpatialReference sourceSrs=new SpatialReference();
  sourceSrs.SetFromUserInput(codeSrc);
  SpatialReference destSrs=new SpatialReference();
  destSrs.SetFromUserInput(codeDest);
  return new Reprojector(sourceSrs,destSrs);
}
Program: 94389
Project: 94389
Buggy source:
/** 
 * Reprojects a bounds to Geographic
 * @param bounds the projected input bounds
 * @param epsg   the epsg string of the projected bounds crs
 * @return geographic bounds
 */
public static Bounds reprojectBounds(final Bounds bounds,final String epsg){
  if (epsg != null && !(epsg.equalsIgnoreCase("String_Node_Str"))) {
    SpatialReference src=new SpatialReference(GDALUtils.EPSG4326());
    SpatialReference dst=new SpatialReference();
    String[] code=epsg.split("String_Node_Str");
    dst.ImportFromEPSG(Integer.parseInt(code[1]));
    CoordinateTransformation tx=new CoordinateTransformation(src,dst);
    double[] c1;
    double[] c2;
    double[] c3;
    double[] c4;
    c1=tx.TransformPoint(bounds.w,bounds.s);
    c2=tx.TransformPoint(bounds.w,bounds.n);
    c3=tx.TransformPoint(bounds.e,bounds.s);
    c4=tx.TransformPoint(bounds.e,bounds.n);
    return new Bounds(Math.min(Math.min(c1[0],c2[0]),Math.min(c3[0],c4[0])),Math.min(Math.min(c1[1],c2[1]),Math.min(c3[1],c4[1])),Math.max(Math.max(c1[0],c2[0]),Math.max(c3[0],c4[0])),Math.max(Math.max(c1[1],c2[1]),Math.max(c3[1],c4[1])));
  }
 else {
    return bounds.clone();
  }
}

Fixed version (ground truth):
/** 
 * Reprojects a bounds to Geographic
 * @param bounds the projected input bounds
 * @param srs   the spatial reference of the projected bounds crs. The format is describedin http://gdal.org/java/org/gdal/osr/SpatialReference.html#SetFromUserInput(java.lang.String). Examples include "EPSG:4326" and "CRS:84".
 * @return geographic bounds
 */
public static Bounds reprojectBounds(final Bounds bounds,final String srs){
  if (srs != null && !(srs.equalsIgnoreCase("String_Node_Str"))) {
    SpatialReference src=new SpatialReference(GDALUtils.EPSG4326());
    SpatialReference dst=new SpatialReference();
    dst.SetFromUserInput(srs);
    CoordinateTransformation tx=new CoordinateTransformation(src,dst);
    double[] c1;
    double[] c2;
    double[] c3;
    double[] c4;
    c1=tx.TransformPoint(bounds.w,bounds.s);
    c2=tx.TransformPoint(bounds.w,bounds.n);
    c3=tx.TransformPoint(bounds.e,bounds.s);
    c4=tx.TransformPoint(bounds.e,bounds.n);
    return new Bounds(Math.min(Math.min(c1[0],c2[0]),Math.min(c3[0],c4[0])),Math.min(Math.min(c1[1],c2[1]),Math.min(c3[1],c4[1])),Math.max(Math.max(c1[0],c2[0]),Math.max(c3[0],c4[0])),Math.max(Math.max(c1[1],c2[1]),Math.max(c3[1],c4[1])));
  }
 else {
    return bounds.clone();
  }
}
Program: 94390
Project: 94390
Buggy source:
/** 
 * Reprojects a bounds to WGS-84
 * @param bounds the projected input bounds
 * @param epsg   the epsg string of the projected bounds crs
 * @return geographic bounds
 */
public static Bounds reprojectBoundsToWGS84(final Bounds bounds,final String epsg){
  if (epsg != null) {
    String[] code=epsg.split("String_Node_Str");
    int srcEpsg=Integer.parseInt(code[1]);
    if (srcEpsg != 4326) {
      SpatialReference src=new SpatialReference();
      src.ImportFromEPSG(srcEpsg);
      SpatialReference dst=new SpatialReference(GDALUtils.EPSG4326());
      CoordinateTransformation tx=new CoordinateTransformation(src,dst);
      double[] c1;
      double[] c2;
      double[] c3;
      double[] c4;
      c1=tx.TransformPoint(bounds.w,bounds.s);
      c2=tx.TransformPoint(bounds.w,bounds.n);
      c3=tx.TransformPoint(bounds.e,bounds.s);
      c4=tx.TransformPoint(bounds.e,bounds.n);
      return new Bounds(Math.min(Math.min(c1[0],c2[0]),Math.min(c3[0],c4[0])),Math.min(Math.min(c1[1],c2[1]),Math.min(c3[1],c4[1])),Math.max(Math.max(c1[0],c2[0]),Math.max(c3[0],c4[0])),Math.max(Math.max(c1[1],c2[1]),Math.max(c3[1],c4[1])));
    }
  }
  return bounds.clone();
}

Fixed version (ground truth):
/** 
 * Reprojects a bounds to WGS-84
 * @param bounds the projected input bounds
 * @param srs   the spatial reference of the projected bounds crs. The format isdescribed in http://gdal.org/java/org/gdal/osr/SpatialReference.html#SetFromUserInput(java.lang.String) Examples include "EPSG:4326" and "CRS:84".
 * @return geographic bounds
 */
public static Bounds reprojectBoundsToWGS84(final Bounds bounds,final String srs){
  if (srs != null) {
    SpatialReference src=new SpatialReference();
    src.SetFromUserInput(srs);
    SpatialReference dst=new SpatialReference(GDALUtils.EPSG4326());
    CoordinateTransformation tx=new CoordinateTransformation(src,dst);
    double[] c1;
    double[] c2;
    double[] c3;
    double[] c4;
    c1=tx.TransformPoint(bounds.w,bounds.s);
    c2=tx.TransformPoint(bounds.w,bounds.n);
    c3=tx.TransformPoint(bounds.e,bounds.s);
    c4=tx.TransformPoint(bounds.e,bounds.n);
    return new Bounds(Math.min(Math.min(c1[0],c2[0]),Math.min(c3[0],c4[0])),Math.min(Math.min(c1[1],c2[1]),Math.min(c3[1],c4[1])),Math.max(Math.max(c1[0],c2[0]),Math.max(c3[0],c4[0])),Math.max(Math.max(c1[1],c2[1]),Math.max(c3[1],c4[1])));
  }
  return bounds.clone();
}
Program: 94391
Project: 94391
Buggy source:
private static synchronized void initializeColorscales() throws ColorScale.ColorScaleException {
  if (colorscales == null) {
    colorscales=new HashMap<>();
    Properties props=MrGeoProperties.getInstance();
    final String colorScaleBase=HadoopUtils.getDefaultColorScalesBaseDirectory(props);
    if (colorScaleBase != null) {
      try {
        AdHocDataProvider provider=DataProviderFactory.getAdHocDataProvider(colorScaleBase,AccessMode.READ,HadoopUtils.createConfiguration());
        for (int i=0; i < provider.size(); i++) {
          if (FilenameUtils.getExtension(provider.getName(i)).toLowerCase().equals("String_Node_Str")) {
            try (InputStream fdis=provider.get(i)){
              ColorScale cs=ColorScale.loadFromXML(fdis);
              String name=FilenameUtils.getBaseName(provider.getName(i));
              colorscales.put(name,cs);
            }
           }
        }
      }
 catch (      IOException e) {
        throw new ColorScale.BadSourceException(e);
      }
    }
 else {
      throw new ColorScale.ColorScaleException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") private static synchronized void initializeColorscales() throws ColorScale.ColorScaleException {
  if (colorscales == null) {
    colorscales=new HashMap<>();
    Properties props=MrGeoProperties.getInstance();
    final String colorScaleBase=HadoopUtils.getDefaultColorScalesBaseDirectory(props);
    if (colorScaleBase != null) {
      try {
        AdHocDataProvider provider=DataProviderFactory.getAdHocDataProvider(colorScaleBase,AccessMode.READ,HadoopUtils.createConfiguration());
        for (int i=0; i < provider.size(); i++) {
          String name=provider.getName(i);
          if (name != null) {
            if (FilenameUtils.getExtension(name).toLowerCase().equals("String_Node_Str")) {
              try (InputStream fdis=provider.get(i)){
                ColorScale cs=ColorScale.loadFromXML(fdis);
                colorscales.put(FilenameUtils.getBaseName(name),cs);
              }
             }
          }
        }
      }
 catch (      IOException e) {
        throw new ColorScale.BadSourceException(e);
      }
    }
 else {
      throw new ColorScale.ColorScaleException("String_Node_Str");
    }
  }
}
Program: 94392
Project: 94392
Buggy source:
@BeforeClass public static void init() throws IOException {
  if (GEN_BASELINE_DATA_ONLY) {
    log.warn("String_Node_Str");
  }
  vectorutils=new MapOpTestVectorUtils(CostDistanceMapOpIntegrationTest.class);
  testUtils=new MapOpTestUtils(CostDistanceMapOpIntegrationTest.class);
  HadoopFileUtils.delete(testUtils.getInputHdfs());
  HadoopFileUtils.copyToHdfs(testUtils.getInputLocal(),testUtils.getInputHdfs(),TOBLER_MEDIUM);
  HadoopFileUtils.copyToHdfs(Defs.INPUT,testUtils.getInputHdfs(),ALL_ONES);
  frictionSurface=testUtils.getInputHdfs() + "String_Node_Str" + TOBLER_MEDIUM;
  HadoopFileUtils.copyToHdfs(new Path(Defs.INPUT),testUtils.getInputHdfs(),smallElevationName);
}

Fixed version (ground truth):
@BeforeClass public static void init() throws IOException {
  if (GEN_BASELINE_DATA_ONLY) {
    log.warn("String_Node_Str");
  }
  vectorutils=new MapOpTestVectorUtils(CostDistanceMapOpIntegrationTest.class);
  testUtils=new MapOpTestUtils(CostDistanceMapOpIntegrationTest.class);
  HadoopFileUtils.delete(testUtils.getInputHdfs());
  HadoopFileUtils.copyToHdfs(testUtils.getInputLocal(),testUtils.getInputHdfs(),TOBLER_MEDIUM);
  HadoopFileUtils.copyToHdfs(Defs.INPUT,testUtils.getInputHdfs(),ALL_ONES);
  frictionSurface=testUtils.getInputHdfs() + "String_Node_Str" + TOBLER_MEDIUM;
  HadoopFileUtils.copyToHdfs(new Path(Defs.INPUT),testUtils.getInputHdfs(),smallElevationName);
  smallElevation=testUtils.getInputHdfs() + "String_Node_Str" + smallElevationName;
}
Program: 94393
Project: 94393
Buggy source:
@Test @Category(IntegrationTest.class) public void directionalCostDistance() throws Exception {
  String exp="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (GEN_BASELINE_DATA_ONLY) {
    testUtils.generateBaselineTif(conf,testname.getMethodName(),exp,-9999);
  }
 else {
    testUtils.runRasterExpression(conf,testname.getMethodName(),exp);
  }
}

Fixed version (ground truth):
@Test @Category(IntegrationTest.class) public void directionalCostDistance() throws Exception {
  String exp="String_Node_Str" + "String_Node_Str" + smallElevation + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (GEN_BASELINE_DATA_ONLY) {
    testUtils.generateBaselineTif(conf,testname.getMethodName(),exp,-9999);
  }
 else {
    testUtils.runRasterExpression(conf,testname.getMethodName(),exp);
  }
}
Program: 94394
Project: 94394
Buggy source:
@Test @Category(IntegrationTest.class) public void nondirectionalCostDistance() throws Exception {
  String exp="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (GEN_BASELINE_DATA_ONLY) {
    testUtils.generateBaselineTif(conf,testname.getMethodName(),exp,-9999);
  }
 else {
    testUtils.runRasterExpression(conf,testname.getMethodName(),exp);
  }
}

Fixed version (ground truth):
@Test @Category(IntegrationTest.class) public void nondirectionalCostDistance() throws Exception {
  String exp="String_Node_Str" + "String_Node_Str" + smallElevation + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (GEN_BASELINE_DATA_ONLY) {
    testUtils.generateBaselineTif(conf,testname.getMethodName(),exp,-9999);
  }
 else {
    testUtils.runRasterExpression(conf,testname.getMethodName(),exp);
  }
}
Program: 94396
Project: 94396
Buggy source:
@Test @Category(UnitTest.class) public void scaleRasterNearestFloat() throws IOException {
  int scale;
  MrGeoRaster scaled;
  for (scale=1; scale < 15; scale++) {
    scaled=numberedFloat.scale(width * scale,height * scale,false,new double[]{Double.NaN});
    compareResult(scale,numberedFloat,scaled);
  }
  for (scale=2; scale < 8; scale++) {
    scaled=numberedFloat.scale(width / scale,height / scale,false,new double[]{Double.NaN});
    compareResult(1.0 / scale,numberedFloat,scaled);
  }
}

Fixed version (ground truth):
@Test @Category(UnitTest.class) public void scaleRasterNearestFloat() throws IOException {
  int scale;
  MrGeoRaster scaled;
  for (scale=1; scale < 15; scale++) {
    scaled=numberedFloat.scale(width * scale,height * scale,false,new double[]{Double.NaN});
    compareResult(scale,scaled);
  }
  for (scale=2; scale < 8; scale++) {
    scaled=numberedFloat.scale(width / scale,height / scale,false,new double[]{Double.NaN});
    compareResult(1.0 / scale,scaled);
  }
}
Program: 94397
Project: 94397
Buggy source:
@Test @Category(UnitTest.class) public void scaleRasterNearestInt() throws IOException {
  int scale;
  MrGeoRaster scaled;
  for (scale=1; scale < 15; scale++) {
    scaled=numberedInt.scale(width * scale,height * scale,false,new double[]{Double.NaN});
    compareResult(scale,numberedInt,scaled);
  }
  for (scale=2; scale < 8; scale++) {
    scaled=numberedInt.scale(width / scale,height / scale,false,new double[]{Double.NaN});
    compareResult(1.0 / scale,numberedInt,scaled);
  }
}

Fixed version (ground truth):
@Test @Category(UnitTest.class) public void scaleRasterNearestInt() throws IOException {
  int scale;
  MrGeoRaster scaled;
  for (scale=1; scale < 15; scale++) {
    scaled=numberedInt.scale(width * scale,height * scale,false,new double[]{Double.NaN});
    compareResult(scale,scaled);
  }
  for (scale=2; scale < 8; scale++) {
    scaled=numberedInt.scale(width / scale,height / scale,false,new double[]{Double.NaN});
    compareResult(1.0 / scale,scaled);
  }
}
Program: 94398
Project: 94398
Buggy source:
private void compareResult(double scale,MrGeoRaster orig,MrGeoRaster scaled) throws IOException {
  String name=testname.getMethodName() + String.format("String_Node_Str",scale);
  if (GEN_BASELINE_DATA_ONLY) {
    testutils.saveBaselineTif(name,scaled);
  }
 else {
    testutils.compareRasters(name,scaled);
  }
}

Fixed version (ground truth):
private void compareResult(double scale,MrGeoRaster scaled) throws IOException {
  String name=testname.getMethodName() + String.format("String_Node_Str",scale);
  if (GEN_BASELINE_DATA_ONLY) {
    testutils.saveBaselineTif(name,scaled);
  }
 else {
    testutils.compareRasters(name,scaled);
  }
}
Program: 94399
Project: 94399
Buggy source:
@Test @Category(UnitTest.class) public void scaleRasterNearestDouble() throws IOException {
  int scale;
  MrGeoRaster scaled;
  for (scale=1; scale < 15; scale++) {
    scaled=numberedDouble.scale(width * scale,height * scale,false,new double[]{Double.NaN});
    compareResult(scale,numberedDouble,scaled);
  }
  for (scale=2; scale < 8; scale+=1) {
    scaled=numberedDouble.scale(width / scale,height / scale,false,new double[]{Double.NaN});
    compareResult(1.0 / scale,numberedDouble,scaled);
  }
}

Fixed version (ground truth):
@Test @Category(UnitTest.class) public void scaleRasterNearestDouble() throws IOException {
  int scale;
  MrGeoRaster scaled;
  for (scale=1; scale < 15; scale++) {
    scaled=numberedDouble.scale(width * scale,height * scale,false,new double[]{Double.NaN});
    compareResult(scale,scaled);
  }
  for (scale=2; scale < 8; scale+=1) {
    scaled=numberedDouble.scale(width / scale,height / scale,false,new double[]{Double.NaN});
    compareResult(1.0 / scale,scaled);
  }
}
Program: 94400
Project: 94400
Buggy source:
public String getName(){
  return metadata.getName(zoomlevel);
}

Fixed version (ground truth):
public String getName(){
  return metadata.getName(getZoomlevel());
}
Program: 94405
Project: 94405
Buggy source:
private boolean saveMultipleTiles(String output,String pyramidName,String format,final MrsImage image,final long[] tiles){
  try {
    final MrsPyramidMetadata metadata=image.getMetadata();
    MrGeoRaster raster=image.getRaster(tiles);
    Bounds imageBounds=null;
    long minId=tiles[0];
    final int tilesize=image.getTilesize();
    final int zoomlevel=image.getZoomlevel();
    for (    final long lid : tiles) {
{
        minId=lid;
      }
      final Tile tile=TMSUtils.tileid(lid,zoomlevel);
      final Bounds bounds=TMSUtils.tileBounds(tile.tx,tile.ty,zoomlevel,tilesize);
      if (imageBounds == null) {
        imageBounds=bounds;
      }
 else {
        imageBounds=imageBounds.expand(bounds);
      }
    }
    if (imageBounds == null) {
      throw new MrsImageException("String_Node_Str");
    }
    String out=makeOutputName(output,pyramidName,format,minId,zoomlevel,tilesize,false);
    if (colorscale != null || !format.equals("String_Node_Str")) {
      raster=colorRaster(image,format,raster);
    }
    GDALJavaUtils.saveRaster(raster.toDataset(imageBounds,metadata.getDefaultValues()),out,null,metadata.getDefaultValue(0),format);
    System.out.println("String_Node_Str" + out);
    return true;
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
  return false;
}

Fixed version (ground truth):
private boolean saveMultipleTiles(String output,String pyramidName,String format,final MrsImage image,final long[] tiles){
  try {
    final MrsPyramidMetadata metadata=image.getMetadata();
    MrGeoRaster raster=image.getRaster(tiles);
    Bounds imageBounds=null;
    long minId=tiles[0];
    final int tilesize=image.getTilesize();
    final int zoomlevel=image.getZoomlevel();
    for (    final long lid : tiles) {
      if (minId > lid) {
        minId=lid;
      }
      final Tile tile=TMSUtils.tileid(lid,zoomlevel);
      final Bounds bounds=TMSUtils.tileBounds(tile.tx,tile.ty,zoomlevel,tilesize);
      if (imageBounds == null) {
        imageBounds=bounds;
      }
 else {
        imageBounds=imageBounds.expand(bounds);
      }
    }
    if (imageBounds == null) {
      throw new MrsImageException("String_Node_Str");
    }
    String out=makeOutputName(output,pyramidName,format,minId,zoomlevel,tilesize,false);
    if (colorscale != null || !format.equals("String_Node_Str")) {
      raster=colorRaster(image,format,raster);
    }
    GDALJavaUtils.saveRaster(raster.toDataset(imageBounds,metadata.getDefaultValues()),out,null,metadata.getDefaultValue(0),format);
    System.out.println("String_Node_Str" + out);
    return true;
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
  return false;
}
Program: 94406
Project: 94406
Buggy source:
@Test(expected=Exception.class) @Category(UnitTest.class) public void testGetColorScale_ColorScaleBaseDirNotExist() throws Exception {
  final Properties mrgeoConf=new Properties();
  @SuppressWarnings("String_Node_Str") final ColorScale cs=ColorScaleManager.fromName("String_Node_Str",mrgeoConf);
}

Fixed version (ground truth):
@Test(expected=Exception.class) @Category(UnitTest.class) public void testGetColorScale_ColorScaleBaseDirNotExist() throws Exception {
  final Properties mrgeoConf=new Properties();
  ColorScaleManager.invalidateCache();
  @SuppressWarnings("String_Node_Str") final ColorScale cs=ColorScaleManager.fromName("String_Node_Str",mrgeoConf);
}
Program: 94407
Project: 94407
Buggy source:
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") @Override public double[] getExtrema(){
  try {
    MrsImageDataProvider dp=getDataProvider();
    if (dp != null) {
      MrsPyramidMetadata metadata=dp.getMetadataReader().read();
      if (zoomLevel == -1) {
        return metadata.getExtrema(0);
      }
 else {
        return metadata.getExtrema(zoomLevel);
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") @Override public double[] getExtrema(){
  try {
    MrsImageDataProvider dp=getDataProvider();
    if (dp != null) {
      MrsPyramidMetadata metadata=dp.getMetadataReader().read();
      ImageStats stats=metadata.getStats(0);
      if (stats != null) {
        return new double[]{stats.min,stats.max};
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 94410
Project: 94410
Buggy source:
@Override public RecordWriter<WritableComparable<?>,Writable> getRecordWriter(TaskAttemptContext context) throws IOException {
  Configuration conf=context.getConfiguration();
  CompressionCodec codec=null;
  SequenceFile.CompressionType compressionType=SequenceFile.CompressionType.NONE;
  if (getCompressOutput(context)) {
    compressionType=SequenceFileOutputFormat.getOutputCompressionType(context);
    codec=getCompressionCodec(context);
  }
  Path file=getDefaultWorkFile(context,"String_Node_Str");
  final MapFile.Writer out=createMapFileWriter(context,codec,compressionType,file);
  return new Writer(out);
}

Fixed version (ground truth):
@Override public RecordWriter<WritableComparable<?>,Writable> getRecordWriter(TaskAttemptContext context) throws IOException {
  CompressionCodec codec=null;
  SequenceFile.CompressionType compressionType=SequenceFile.CompressionType.NONE;
  if (getCompressOutput(context)) {
    compressionType=SequenceFileOutputFormat.getOutputCompressionType(context);
    codec=getCompressionCodec(context);
  }
  Path file=getDefaultWorkFile(context,"String_Node_Str");
  final MapFile.Writer out=createMapFileWriter(context,codec,compressionType,file);
  return new Writer(out);
}
Program: 94411
Project: 94411
Buggy source:
public static String getZoomName(final HdfsMrsImageDataProvider dp,final int zoomLevel){
  try {
    MrsPyramid pyramid=MrsPyramid.open(dp);
    MrsPyramidMetadata metadata=pyramid.getMetadata();
    String zoomName=pyramid.getMetadata().getName(zoomLevel);
    if (zoomName != null) {
      return new Path(dp.getResourcePath(true),zoomName).toUri().toString();
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
public static String getZoomName(final HdfsMrsImageDataProvider dp,final int zoomLevel){
  try {
    MrsPyramid pyramid=MrsPyramid.open(dp);
    MrsPyramidMetadata metadata=pyramid.getMetadata();
    String zoomName=metadata.getName(zoomLevel);
    if (zoomName != null) {
      return new Path(dp.getResourcePath(true),zoomName).toUri().toString();
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
  return null;
}
Program: 94413
Project: 94413
Buggy source:
public static String read(DataInputStream stream) throws IOException {
  byte[] data=new byte[stream.readInt()];
  stream.readFully(data);
  return new String(data,"String_Node_Str");
}

Fixed version (ground truth):
public static String read(DataInputStream stream) throws IOException {
  int len=stream.readInt();
  if (len == -1) {
    return null;
  }
 else {
    byte[] data=new byte[len];
    stream.readFully(data);
    return new String(data,"String_Node_Str");
  }
}
Program: 94414
Project: 94414
Buggy source:
public static void write(String str,DataOutputStream stream) throws IOException {
  byte[] data=str.getBytes("String_Node_Str");
  stream.writeInt(data.length);
  stream.write(data);
}

Fixed version (ground truth):
public static void write(String str,DataOutputStream stream) throws IOException {
  if (str == null) {
    stream.writeInt(-1);
  }
 else {
    byte[] data=str.getBytes("String_Node_Str");
    stream.writeInt(data.length);
    stream.write(data);
  }
}
Program: 94415
Project: 94415
Buggy source:
public static boolean canOpen(String input,ProviderProperties providerProperties) throws AccumuloException, AccumuloSecurityException, IOException {
  initConnectionInfo();
  ParseResults results=parseResourceName(input);
  initDataSource(results.namespace);
  DataSourceEntry entry=getDataSourceEntry(results.namespace);
  ByteArrayId adapterId=new ByteArrayId(results.name);
  DataAdapter<?> adapter=entry.adapterStore.getAdapter(adapterId);
  if (adapter == null) {
    return false;
  }
  return checkAuthorizations(adapterId,results.namespace,providerProperties);
}

Fixed version (ground truth):
public static boolean canOpen(String input,ProviderProperties providerProperties) throws AccumuloException, AccumuloSecurityException, IOException {
  initConnectionInfo();
  ParseResults results=parseResourceName(input);
  try {
    initDataSource(results.namespace);
    DataSourceEntry entry=getDataSourceEntry(results.namespace);
    ByteArrayId adapterId=new ByteArrayId(results.name);
    DataAdapter<?> adapter=entry.adapterStore.getAdapter(adapterId);
    if (adapter == null) {
      return false;
    }
    return checkAuthorizations(adapterId,results.namespace,providerProperties);
  }
 catch (  IllegalArgumentException e) {
    log.info("String_Node_Str" + input + "String_Node_Str"+ e.getMessage());
  }
  return false;
}
Program: 94416
Project: 94416
Buggy source:
public void beforePaintingTile(final long tileId){
  if (aggregationType == AggregationType.MIN) {
    composite=new MinCompositeDouble();
  }
 else   if (aggregationType == AggregationType.MAX) {
    composite=new MaxCompositeDouble();
  }
 else   if (aggregationType == AggregationType.MASK) {
    composite=new MaskComposite(1.0,0.0,Double.NaN);
  }
 else   if (aggregationType == AggregationType.GAUSSIAN) {
    composite=new GaussianComposite();
  }
 else {
    composite=new AdditiveCompositeDouble();
  }
  raster=RasterUtils.createEmptyRaster(tileSize,tileSize,1,DataBuffer.TYPE_DOUBLE,Double.NaN);
  totalRaster=null;
  if (aggregationType == AggregationType.AVERAGE) {
    totalRaster=raster.createCompatibleWritableRaster();
    final BufferedImage bi=RasterUtils.makeBufferedImage(totalRaster);
    final Graphics2D gr=bi.createGraphics();
    totalComposite=new AdditiveComposite();
    gr.setComposite(new AdditiveComposite());
    gr.setStroke(new BasicStroke(0));
    totalPainter=new GeometryPainter(gr,totalRaster,new Color(1,1,1),new Color(0,0,0));
  }
  final BufferedImage bi=RasterUtils.makeBufferedImage(raster);
  final Graphics2D gr=bi.createGraphics();
  gr.setComposite(composite);
  gr.setStroke(new BasicStroke(0));
  rasterPainter=new GeometryPainter(gr,raster,new Color(1,1,1),new Color(0,0,0));
  final Tile tile=TMSUtils.tileid(tileId,zoom);
  final TMSUtils.Bounds tb=TMSUtils.tileBounds(tile.tx,tile.ty,zoom,tileSize);
  Bounds b=new Bounds(tb.w,tb.s,tb.e,tb.n);
  rasterPainter.setBounds(b);
}

Fixed version (ground truth):
public void beforePaintingTile(final long tileId){
  if (aggregationType == AggregationType.MIN) {
    composite=new MinCompositeDouble();
  }
 else   if (aggregationType == AggregationType.MAX) {
    composite=new MaxCompositeDouble();
  }
 else   if (aggregationType == AggregationType.MASK) {
    composite=new MaskComposite(1.0,0.0,Double.NaN);
  }
 else   if (aggregationType == AggregationType.GAUSSIAN) {
    composite=new GaussianComposite();
  }
 else {
    composite=new AdditiveCompositeDouble();
  }
  raster=RasterUtils.createEmptyRaster(tileSize,tileSize,1,DataBuffer.TYPE_DOUBLE,Double.NaN);
  totalRaster=null;
  final Tile tile=TMSUtils.tileid(tileId,zoom);
  final TMSUtils.Bounds tb=TMSUtils.tileBounds(tile.tx,tile.ty,zoom,tileSize);
  Bounds b=new Bounds(tb.w,tb.s,tb.e,tb.n);
  if (aggregationType == AggregationType.AVERAGE) {
    totalRaster=raster.createCompatibleWritableRaster();
    final BufferedImage bi=RasterUtils.makeBufferedImage(totalRaster);
    final Graphics2D gr=bi.createGraphics();
    gr.setComposite(new AdditiveComposite());
    gr.setStroke(new BasicStroke(0));
    totalPainter=new GeometryPainter(gr,totalRaster,new Color(1,1,1),new Color(0,0,0));
    totalPainter.setBounds(b);
  }
  final BufferedImage bi=RasterUtils.makeBufferedImage(raster);
  final Graphics2D gr=bi.createGraphics();
  gr.setComposite(composite);
  gr.setStroke(new BasicStroke(0));
  rasterPainter=new GeometryPainter(gr,raster,new Color(1,1,1),new Color(0,0,0));
  rasterPainter.setBounds(b);
}
Program: 94417
Project: 94417
Buggy source:
private static void findInputs(final FileStatus status,final FileSystem fs,final PathFilter inputFilter,List<FileStatus> result) throws IOException {
  if (status.isDir()) {
    for (    FileStatus childStat : fs.listStatus(status.getPath(),inputFilter)) {
      if (childStat.isDir()) {
        findInputs(childStat,fs,inputFilter,result);
      }
 else {
        result.add(childStat);
      }
    }
  }
 else {
    result.add(status);
  }
}

Fixed version (ground truth):
private static void findInputs(final FileStatus status,final FileSystem fs,final PathFilter inputFilter,List<FileStatus> result) throws IOException {
  if (status.isDirectory()) {
    for (    FileStatus childStat : fs.listStatus(status.getPath(),inputFilter)) {
      if (childStat.isDirectory()) {
        findInputs(childStat,fs,inputFilter,result);
      }
 else {
        result.add(childStat);
      }
    }
  }
 else {
    result.add(status);
  }
}
Program: 94419
Project: 94419
Buggy source:
@Override public void teardownForSpark(final Configuration conf) throws DataProviderException {
  performTeardown(conf);
}

Fixed version (ground truth):
@Override public void teardownForSpark(final Configuration conf) throws DataProviderException {
}
Program: 94420
Project: 94420
Buggy source:
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeDouble(minX);
  out.writeDouble(minY);
  out.writeDouble(maxX);
  out.writeDouble(maxY);
}

Fixed version (ground truth):
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeBoolean(set);
  if (set) {
    out.writeDouble(minX);
    out.writeDouble(minY);
    out.writeDouble(maxX);
    out.writeDouble(maxY);
  }
}
Program: 94421
Project: 94421
Buggy source:
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  minX=in.readDouble();
  minY=in.readDouble();
  maxX=in.readDouble();
  maxY=in.readDouble();
}

Fixed version (ground truth):
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  set=in.readBoolean();
  if (set) {
    minX=in.readDouble();
    minY=in.readDouble();
    maxX=in.readDouble();
    maxY=in.readDouble();
  }
}
Program: 94422
Project: 94422
Buggy source:
private boolean saveSingleTile(final String output,final MrsImage image,String format,final long tileid,final int zoom,int tilesize){
  try {
    final MrsImagePyramidMetadata metadata=image.getMetadata();
    final TMSUtils.Tile t=TMSUtils.tileid(tileid,zoom);
    Raster raster=image.getTile(t.tx,t.ty);
    log.info("String_Node_Str" + t.tx + "String_Node_Str"+ t.ty);
    if (raster != null) {
      String out=makeOutputName(output,format,tileid,zoom,tilesize);
      if (colorscale != null || !format.equals("String_Node_Str")) {
        ColorScaleApplier applier=null;
switch (format) {
case "String_Node_Str":
case "String_Node_Str":
          applier=new PngColorScaleApplier();
        break;
case "String_Node_Str":
case "String_Node_Str":
      applier=new JpegColorScaleApplier();
    break;
}
if (applier != null) {
  raster=applier.applyColorScale(raster,colorscale,image.getExtrema(),image.getMetadata().getDefaultValues());
}
}
GDALUtils.saveRaster(raster,out,format,t.tx,t.ty,image.getZoomlevel(),image.getTilesize(),metadata.getDefaultValue(0));
System.out.println("String_Node_Str" + out);
return true;
}
log.info("String_Node_Str");
}
 catch (final Exception e) {
e.printStackTrace();
}
return false;
}

Fixed version (ground truth):
private boolean saveSingleTile(final String output,final MrsImage image,String format,final long tileid,final int zoom,int tilesize){
  try {
    final MrsImagePyramidMetadata metadata=image.getMetadata();
    final TMSUtils.Tile t=TMSUtils.tileid(tileid,zoom);
    Raster raster=image.getTile(t.tx,t.ty);
    log.info("String_Node_Str" + t.tx + "String_Node_Str"+ t.ty);
    if (raster != null) {
      String out=makeOutputName(output,format,tileid,zoom,tilesize);
      if (colorscale != null || !format.equals("String_Node_Str")) {
        ColorScaleApplier applier=null;
switch (format) {
case "String_Node_Str":
case "String_Node_Str":
          applier=new PngColorScaleApplier();
        break;
case "String_Node_Str":
case "String_Node_Str":
      applier=new JpegColorScaleApplier();
    break;
}
if (applier != null) {
  raster=applier.applyColorScale(raster,colorscale,image.getExtrema(),image.getMetadata().getDefaultValues());
}
}
GDALJavaUtils.saveRasterTile(raster,out,t.tx,t.ty,image.getZoomlevel(),metadata.getDefaultValue(0),format);
System.out.println("String_Node_Str" + out);
return true;
}
log.info("String_Node_Str");
}
 catch (final Exception e) {
e.printStackTrace();
}
return false;
}
Program: 94426
Project: 94426
Buggy source:
public static WritableRaster makeRasterWritable(final Raster raster){
  return Raster.createWritableRaster(raster.getSampleModel(),raster.getDataBuffer(),null);
}

Fixed version (ground truth):
public static WritableRaster makeRasterWritable(final Raster raster){
  if (raster instanceof WritableRaster) {
    return (WritableRaster)raster;
  }
  return Raster.createWritableRaster(raster.getSampleModel(),raster.getDataBuffer(),null);
}
Program: 94427
Project: 94427
Buggy source:
private static void copyPixel(final int x,final int y,final int b,final Raster src,final WritableRaster dst,double[] nodatas){
switch (src.getTransferType()) {
case DataBuffer.TYPE_BYTE:
{
      final byte p=(byte)src.getSample(x,y,b);
      if (p != (byte)nodatas[b]) {
        dst.setSample(x,y,b,p);
      }
      break;
    }
case DataBuffer.TYPE_FLOAT:
{
    final float p=src.getSampleFloat(x,y,b);
    if (!Float.isNaN(p) && p != (float)nodatas[b]) {
      dst.setSample(x,y,b,p);
    }
    break;
  }
case DataBuffer.TYPE_DOUBLE:
{
  final double p=src.getSampleDouble(x,y,b);
  if (!Double.isNaN(p) && p != nodatas[b]) {
    dst.setSample(x,y,b,p);
  }
  break;
}
case DataBuffer.TYPE_INT:
{
final int p=src.getSample(x,y,b);
if (p != (int)nodatas[b]) {
  dst.setSample(x,y,b,p);
}
break;
}
case DataBuffer.TYPE_SHORT:
{
final short p=(short)src.getSample(x,y,b);
if (p != (short)nodatas[b]) {
dst.setSample(x,y,b,p);
}
break;
}
case DataBuffer.TYPE_USHORT:
{
final int p=src.getSample(x,y,b);
if (p != (int)nodatas[b]) {
dst.setSample(x,y,b,p);
}
break;
}
}
}

Fixed version (ground truth):
private static void copyPixel(final int x,final int y,final int b,final Raster src,final WritableRaster dst,Number nodata){
switch (src.getTransferType()) {
case DataBuffer.TYPE_BYTE:
{
      final byte p=(byte)src.getSample(x,y,b);
      if (p != nodata.byteValue()) {
        dst.setSample(x,y,b,p);
      }
      break;
    }
case DataBuffer.TYPE_FLOAT:
{
    final float p=src.getSampleFloat(x,y,b);
    if (!Float.isNaN(p) && p != nodata.floatValue()) {
      dst.setSample(x,y,b,p);
    }
    break;
  }
case DataBuffer.TYPE_DOUBLE:
{
  final double p=src.getSampleDouble(x,y,b);
  if (!Double.isNaN(p) && p != nodata.doubleValue()) {
    dst.setSample(x,y,b,p);
  }
  break;
}
case DataBuffer.TYPE_INT:
{
final int p=src.getSample(x,y,b);
if (p != nodata.intValue()) {
  dst.setSample(x,y,b,p);
}
break;
}
case DataBuffer.TYPE_SHORT:
{
final short p=(short)src.getSample(x,y,b);
if (p != nodata.shortValue()) {
dst.setSample(x,y,b,p);
}
break;
}
case DataBuffer.TYPE_USHORT:
{
final int p=src.getSample(x,y,b);
if (p != nodata.shortValue()) {
dst.setSample(x,y,b,p);
}
break;
}
}
}
Program: 94428
Project: 94428
Buggy source:
@Override public void readAttributes(DataInputStream stream) throws IOException {
  int attrs=stream.readInt();
  for (int i=0; i < attrs; i++) {
    String key=stream.readUTF();
    String value=stream.readUTF();
    attributes.put(key,value);
  }
}

Fixed version (ground truth):
@Override public void readAttributes(DataInputStream stream) throws IOException {
  int attrs=stream.readInt();
  for (int i=0; i < attrs; i++) {
    String key=stream.readUTF();
    String value=StringUtils.read(stream);
    attributes.put(key,value);
  }
}
Program: 94429
Project: 94429
Buggy source:
@Override public void writeAttributes(DataOutputStream stream) throws IOException {
  stream.writeInt(attributes.size());
  for (  Map.Entry<String,String> attr : attributes.entrySet()) {
    stream.writeUTF(attr.getKey());
    stream.writeUTF(attr.getValue());
  }
}

Fixed version (ground truth):
@Override public void writeAttributes(DataOutputStream stream) throws IOException {
  stream.writeInt(attributes.size());
  for (  Map.Entry<String,String> attr : attributes.entrySet()) {
    stream.writeUTF(attr.getKey());
    StringUtils.write(attr.getValue(),stream);
  }
}
Program: 94430
Project: 94430
Buggy source:
public static Path createJobTmp() throws IOException {
  return createUniqueTmp();
}

Fixed version (ground truth):
public static Path createJobTmp(Configuration conf) throws IOException {
  return createUniqueTmp(conf);
}
Program: 94431
Project: 94431
Buggy source:
/** 
 * Creates a unique path but doesn't create a directory.
 * @return A new unique temporary path
 * @throws IOException
 */
public static Path createUniqueTmpPath() throws IOException {
  return new Path(getTempDir(),HadoopUtils.createRandomString(40));
}

Fixed version (ground truth):
public static Path createUniqueTmpPath(Configuration conf) throws IOException {
  return new Path(getTempDir(conf),HadoopUtils.createRandomString(40));
}
Program: 94432
Project: 94432
Buggy source:
/** 
 * Creates a unique temp directory and returns the path.
 * @return
 * @throws IOException
 */
public static Path createUniqueTmp() throws IOException {
  final Path tmp=createUniqueTmpPath();
  final FileSystem fs=HadoopFileUtils.getFileSystem(tmp);
  if (!fs.exists(tmp)) {
    fs.mkdirs(tmp);
  }
  return tmp;
}

Fixed version (ground truth):
/** 
 * Creates a unique temp directory and returns the path.
 * @return
 * @throws IOException
 */
public static Path createUniqueTmp(Configuration conf) throws IOException {
  final Path tmp=createUniqueTmpPath(conf);
  final FileSystem fs=HadoopFileUtils.getFileSystem(tmp);
  if (!fs.exists(tmp)) {
    fs.mkdirs(tmp);
  }
  return tmp;
}
Program: 94433
Project: 94433
Buggy source:
private static ShapefileGeometryCollection loadGeometryCollection(Configuration conf) throws IOException {
  if (conf.get("String_Node_Str") != null) {
    Path path=new Path(conf.get("String_Node_Str"));
    if (path.toString().toLowerCase().endsWith("String_Node_Str")) {
      ShapefileReader sr=new ShapefileReader(path);
      ReprojectedShapefileGeometryCollection rgc=new ReprojectedShapefileGeometryCollection(sr,GDALUtils.EPSG4326);
      return rgc;
    }
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
private static ShapefileGeometryCollection loadGeometryCollection(Configuration conf) throws IOException {
  if (conf.get("String_Node_Str") != null) {
    Path path=new Path(conf.get("String_Node_Str"));
    if (path.toString().toLowerCase().endsWith("String_Node_Str")) {
      ShapefileReader sr=new ShapefileReader(path);
      ReprojectedShapefileGeometryCollection rgc=new ReprojectedShapefileGeometryCollection(sr,GDALUtils.EPSG4326());
      return rgc;
    }
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 94434
Project: 94434
Buggy source:
private void internalLoader(SeekableDataInput shp,SeekableDataInput shx,SeekableDataInput dbf,InputStream prj,int cachesize) throws FormatException, IOException {
  mode="String_Node_Str";
  try {
    index=ShxFile.open(shx,true,cachesize);
    index.load();
    shape=new ShpFile(index,this);
    shape.load(shp);
    table=DbaseFile.open(dbf,true,cachesize,"String_Node_Str");
  }
 catch (  IOException e) {
    throw e;
  }
catch (  FormatException e) {
    throw e;
  }
catch (  Exception e) {
    e.printStackTrace();
    throw new IOException("String_Node_Str",e);
  }
  projection=null;
  if (prj != null) {
    BufferedReader reader=new BufferedReader(new InputStreamReader(prj));
    String tmp=reader.readLine();
    if (tmp != null && tmp.trim().compareTo("String_Node_Str") != 0) {
      projection=tmp;
    }
  }
  if (projection == null) {
    projection=GDALUtils.EPSG4326;
  }
}

Fixed version (ground truth):
private void internalLoader(SeekableDataInput shp,SeekableDataInput shx,SeekableDataInput dbf,InputStream prj,int cachesize) throws FormatException, IOException {
  mode="String_Node_Str";
  try {
    index=ShxFile.open(shx,true,cachesize);
    index.load();
    shape=new ShpFile(index,this);
    shape.load(shp);
    table=DbaseFile.open(dbf,true,cachesize,"String_Node_Str");
  }
 catch (  IOException e) {
    throw e;
  }
catch (  FormatException e) {
    throw e;
  }
catch (  Exception e) {
    e.printStackTrace();
    throw new IOException("String_Node_Str",e);
  }
  projection=null;
  if (prj != null) {
    BufferedReader reader=new BufferedReader(new InputStreamReader(prj));
    String tmp=reader.readLine();
    if (tmp != null && tmp.trim().compareTo("String_Node_Str") != 0) {
      projection=tmp;
    }
  }
  if (projection == null) {
    projection=GDALUtils.EPSG4326();
  }
}
Program: 94435
Project: 94435
Buggy source:
/** 
 * Loading metadata from an InputStream.  The objects of the file are stored in a json format.  This enables the ObjectMapper to parse out the values correctly.
 * @param stream - the stream attached to the metadata input
 * @return a valid MrsImagePyramidMetadata object
 * @throws JsonGenerationException
 * @throws JsonMappingException
 * @throws IOException
 */
public static MrsImagePyramidMetadata load(final InputStream stream) throws JsonGenerationException, JsonMappingException, IOException {
  final ObjectMapper mapper=new ObjectMapper();
  final MrsImagePyramidMetadata metadata=mapper.readValue(stream,MrsImagePyramidMetadata.class);
  return metadata;
}

Fixed version (ground truth):
/** 
 * Loading metadata from an InputStream.  The objects of the file are stored in a json format.  This enables the ObjectMapper to parse out the values correctly.
 * @param stream - the stream attached to the metadata input
 * @return a valid MrsImagePyramidMetadata object
 * @throws JsonGenerationException
 * @throws JsonMappingException
 * @throws IOException
 */
public static MrsImagePyramidMetadata load(final InputStream stream) throws JsonGenerationException, JsonMappingException, IOException {
  final ObjectMapper mapper=new ObjectMapper();
  return mapper.readValue(stream,MrsImagePyramidMetadata.class);
}