Program: 94418
Project: 94418
Buggy source:
@Override public List<InputSplit> getSplits(JobContext context) throws IOException {
  Configuration conf=context.getConfiguration();
  TiledInputFormatContext ifContext=TiledInputFormatContext.load(conf);
  final int zoom=ifContext.getZoomLevel();
  final int tilesize=ifContext.getTileSize();
  HdfsMrsImageDataProvider dp=new HdfsMrsImageDataProvider(context.getConfiguration(),input,null);
  Path inputWithZoom=new Path(dp.getResourcePath(true),"String_Node_Str" + zoom);
  org.mrgeo.hdfs.tile.FileSplit splitfile=new org.mrgeo.hdfs.tile.FileSplit();
  splitfile.readSplits(inputWithZoom);
  MrsImagePyramidMetadataReader metadataReader=dp.getMetadataReader();
  MrsImagePyramidMetadata metadata=metadataReader.read();
  List<InputSplit> actualSplits=super.getSplits(context);
  List<InputSplit> result=new ArrayList<InputSplit>(actualSplits.size());
  for (  InputSplit actualSplit : actualSplits) {
    if (!(actualSplit instanceof FileSplit)) {
      throw new IOException("String_Node_Str" + actualSplit.getClass().getCanonicalName());
    }
    FileSplit fileSplit=(FileSplit)actualSplit;
    String partFile=fileSplit.getPath().getParent().getName();
    if (!partFile.startsWith("String_Node_Str")) {
      throw new IOException("String_Node_Str" + partFile);
    }
    org.mrgeo.hdfs.tile.FileSplit.FileSplitInfo splitinfo;
    try {
      splitinfo=(org.mrgeo.hdfs.tile.FileSplit.FileSplitInfo)splitfile.getSplitByName(partFile);
    }
 catch (    Splits.SplitNotFoundException e) {
      LOG.info("String_Node_Str" + super.getClass().getName() + "String_Node_Str"+ partFile);
      continue;
    }
    long endTileId=splitinfo.getEndId();
    long startTileId=splitinfo.getStartId();
    TMSUtils.Tile startTile=TMSUtils.tileid(startTileId,zoom);
    TMSUtils.Tile endTile=TMSUtils.tileid(endTileId,zoom);
    TileBounds partFileTileBounds=new TileBounds(startTile.tx,startTile.ty,endTile.tx,endTile.ty);
    Bounds partFileBounds=TMSUtils.tileToBounds(partFileTileBounds,zoom,tilesize);
    if (ifContext.getBounds() != null) {
      Bounds requestedBounds=ifContext.getBounds().getTMSBounds();
      if (requestedBounds.intersect(partFileBounds,false)) {
        Bounds intersected=requestedBounds.intersection(partFileBounds,false);
        TMSUtils.TileBounds tb=TMSUtils.boundsToTile(intersected,zoom,tilesize);
        long s=TMSUtils.tileid(tb.w,tb.s,zoom);
        long e=TMSUtils.tileid(tb.e,tb.n,zoom);
        result.add(new TiledInputSplit(actualSplit,s,e,zoom,metadata.getTilesize()));
      }
    }
 else {
      result.add(new TiledInputSplit(actualSplit,startTileId,endTileId,ifContext.getZoomLevel(),metadata.getTilesize()));
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public List<InputSplit> getSplits(JobContext context) throws IOException {
  long start=System.currentTimeMillis();
  Configuration conf=context.getConfiguration();
  TiledInputFormatContext ifContext=TiledInputFormatContext.load(conf);
  final int zoom=ifContext.getZoomLevel();
  final int tilesize=ifContext.getTileSize();
  HdfsMrsImageDataProvider dp=new HdfsMrsImageDataProvider(context.getConfiguration(),input,null);
  Path inputWithZoom=new Path(dp.getResourcePath(true),"String_Node_Str" + zoom);
  org.mrgeo.hdfs.tile.FileSplit splitfile=new org.mrgeo.hdfs.tile.FileSplit();
  splitfile.readSplits(inputWithZoom);
  MrsImagePyramidMetadataReader metadataReader=dp.getMetadataReader();
  MrsImagePyramidMetadata metadata=metadataReader.read();
  org.mrgeo.hdfs.tile.FileSplit fsplit=new org.mrgeo.hdfs.tile.FileSplit();
  fsplit.readSplits(inputWithZoom);
  org.mrgeo.hdfs.tile.FileSplit.FileSplitInfo[] splits=(org.mrgeo.hdfs.tile.FileSplit.FileSplitInfo[])fsplit.getSplits();
  List<InputSplit> result=new ArrayList<InputSplit>(splits.length);
  final Bounds requestedBounds;
  if (ifContext.getBounds() != null) {
    requestedBounds=ifContext.getBounds().getTMSBounds();
  }
 else {
    requestedBounds=null;
  }
  for (  org.mrgeo.hdfs.tile.FileSplit.FileSplitInfo split : splits) {
    final Path part=new Path(inputWithZoom,split.getName());
    final Path dataFile=new Path(part,MapFile.DATA_FILE_NAME);
    final FileSystem fs=HadoopFileUtils.getFileSystem(conf,dataFile);
    final BlockLocation[] blocks=fs.getFileBlockLocations(dataFile,0,Integer.MAX_VALUE);
    final long endTileId=split.getEndId();
    final long startTileId=split.getStartId();
    final TMSUtils.Tile startTile=TMSUtils.tileid(startTileId,zoom);
    final TMSUtils.Tile endTile=TMSUtils.tileid(endTileId,zoom);
    final TileBounds partFileTileBounds=new TileBounds(startTile.tx,startTile.ty,endTile.tx,endTile.ty);
    final Bounds partFileBounds=TMSUtils.tileToBounds(partFileTileBounds,zoom,tilesize);
    if (requestedBounds != null) {
      if (requestedBounds.intersect(partFileBounds,false)) {
        Bounds intersected=requestedBounds.intersection(partFileBounds,false);
        TMSUtils.TileBounds tb=TMSUtils.boundsToTile(intersected,zoom,tilesize);
        long s=TMSUtils.tileid(tb.w,tb.s,zoom);
        long e=TMSUtils.tileid(tb.e,tb.n,zoom);
        for (        BlockLocation block : blocks) {
          result.add(new TiledInputSplit(new FileSplit(dataFile,block.getOffset(),block.getLength(),block.getHosts()),s,e,zoom,metadata.getTilesize()));
        }
      }
    }
 else {
      for (      BlockLocation block : blocks) {
        result.add(new TiledInputSplit(new FileSplit(dataFile,block.getOffset(),block.getLength(),block.getHosts()),startTileId,endTileId,zoom,metadata.getTilesize()));
      }
    }
  }
  long end=System.currentTimeMillis();
  log.info("String_Node_Str" + (end - start) + "String_Node_Str");
  return result;
}