Program: 93388
Project: 93388
Buggy source:
private MapReadResult processBlocks(QueryParameters queryParameters,SubFileParameter subFileParameter) throws IOException {
  boolean queryIsWater=true;
  boolean queryReadWaterInfo=false;
  MapReadResultBuilder mapReadResultBuilder=new MapReadResultBuilder();
  for (long row=queryParameters.fromBlockY; row <= queryParameters.toBlockY; ++row) {
    for (long column=queryParameters.fromBlockX; column <= queryParameters.toBlockX; ++column) {
      long blockNumber=row * subFileParameter.blocksWidth + column;
      long currentBlockIndexEntry=this.databaseIndexCache.getIndexEntry(subFileParameter,blockNumber);
      if (queryIsWater) {
        queryIsWater&=(currentBlockIndexEntry & BITMASK_INDEX_WATER) != 0;
        queryReadWaterInfo=true;
      }
      long currentBlockPointer=currentBlockIndexEntry & BITMASK_INDEX_OFFSET;
      if (currentBlockPointer < 1 || currentBlockPointer > subFileParameter.subFileSize) {
        LOGGER.warning("String_Node_Str" + currentBlockPointer);
        LOGGER.warning("String_Node_Str" + subFileParameter.subFileSize);
        return null;
      }
      long nextBlockPointer;
      if (blockNumber + 1 == subFileParameter.numberOfBlocks) {
        nextBlockPointer=subFileParameter.subFileSize;
      }
 else {
        nextBlockPointer=this.databaseIndexCache.getIndexEntry(subFileParameter,blockNumber + 1) & BITMASK_INDEX_OFFSET;
        if (nextBlockPointer > subFileParameter.subFileSize) {
          LOGGER.warning("String_Node_Str" + nextBlockPointer);
          LOGGER.warning("String_Node_Str" + subFileParameter.subFileSize);
          return null;
        }
      }
      int currentBlockSize=(int)(nextBlockPointer - currentBlockPointer);
      if (currentBlockSize < 0) {
        LOGGER.warning("String_Node_Str" + currentBlockSize);
        return null;
      }
 else       if (currentBlockSize == 0) {
        continue;
      }
 else       if (currentBlockSize > ReadBuffer.MAXIMUM_BUFFER_SIZE) {
        LOGGER.warning("String_Node_Str" + currentBlockSize);
        continue;
      }
 else       if (currentBlockPointer + currentBlockSize > this.fileSize) {
        LOGGER.warning("String_Node_Str" + currentBlockSize);
        return null;
      }
      this.inputFile.seek(subFileParameter.startAddress + currentBlockPointer);
      if (!this.readBuffer.readFromFile(currentBlockSize)) {
        LOGGER.warning("String_Node_Str" + currentBlockSize);
        return null;
      }
      this.tileLatitude=MercatorProjection.tileYToLatitude(subFileParameter.boundaryTileTop + row,subFileParameter.baseZoomLevel);
      this.tileLongitude=MercatorProjection.tileXToLongitude(subFileParameter.boundaryTileLeft + column,subFileParameter.baseZoomLevel);
      try {
        PoiWayBundle poiWayBundle=processBlock(queryParameters,subFileParameter);
        mapReadResultBuilder.add(poiWayBundle);
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        LOGGER.log(Level.SEVERE,null,e);
      }
    }
  }
  if (queryIsWater && queryReadWaterInfo) {
    mapReadResultBuilder.isWater=true;
  }
  return mapReadResultBuilder.build();
}

Fixed version (ground truth):
private MapReadResult processBlocks(QueryParameters queryParameters,SubFileParameter subFileParameter) throws IOException {
  boolean queryIsWater=true;
  boolean queryReadWaterInfo=false;
  MapReadResultBuilder mapReadResultBuilder=new MapReadResultBuilder();
  for (long row=queryParameters.fromBlockY; row <= queryParameters.toBlockY; ++row) {
    for (long column=queryParameters.fromBlockX; column <= queryParameters.toBlockX; ++column) {
      long blockNumber=row * subFileParameter.blocksWidth + column;
      long currentBlockIndexEntry=this.databaseIndexCache.getIndexEntry(subFileParameter,blockNumber);
      if (queryIsWater) {
        queryIsWater&=(currentBlockIndexEntry & BITMASK_INDEX_WATER) != 0;
        queryReadWaterInfo=true;
      }
      long currentBlockPointer=currentBlockIndexEntry & BITMASK_INDEX_OFFSET;
      if (currentBlockPointer < 1 || currentBlockPointer > subFileParameter.subFileSize) {
        LOGGER.warning("String_Node_Str" + currentBlockPointer);
        LOGGER.warning("String_Node_Str" + subFileParameter.subFileSize);
        return null;
      }
      long nextBlockPointer;
      if (blockNumber + 1 == subFileParameter.numberOfBlocks) {
        nextBlockPointer=subFileParameter.subFileSize;
      }
 else {
        nextBlockPointer=this.databaseIndexCache.getIndexEntry(subFileParameter,blockNumber + 1) & BITMASK_INDEX_OFFSET;
        if (nextBlockPointer > subFileParameter.subFileSize) {
          LOGGER.warning("String_Node_Str" + nextBlockPointer);
          LOGGER.warning("String_Node_Str" + subFileParameter.subFileSize);
          return null;
        }
      }
      int currentBlockSize=(int)(nextBlockPointer - currentBlockPointer);
      if (currentBlockSize < 0) {
        LOGGER.warning("String_Node_Str" + currentBlockSize);
        return null;
      }
 else       if (currentBlockSize == 0) {
        continue;
      }
 else       if (currentBlockSize > ReadBuffer.MAXIMUM_BUFFER_SIZE) {
        LOGGER.warning("String_Node_Str" + currentBlockSize);
        continue;
      }
 else       if (currentBlockPointer + currentBlockSize > this.fileSize) {
        LOGGER.warning("String_Node_Str" + currentBlockSize);
        return null;
      }
      this.inputFile.seek(subFileParameter.startAddress + currentBlockPointer);
      if (!this.readBuffer.readFromFile(currentBlockSize)) {
        LOGGER.warning("String_Node_Str" + currentBlockSize);
        return null;
      }
      this.tileLatitude=MercatorProjection.tileYToLatitude(subFileParameter.boundaryTileTop + row,subFileParameter.baseZoomLevel);
      this.tileLongitude=MercatorProjection.tileXToLongitude(subFileParameter.boundaryTileLeft + column,subFileParameter.baseZoomLevel);
      try {
        PoiWayBundle poiWayBundle=processBlock(queryParameters,subFileParameter);
        if (poiWayBundle != null) {
          mapReadResultBuilder.add(poiWayBundle);
        }
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        LOGGER.log(Level.SEVERE,null,e);
      }
    }
  }
  if (queryIsWater && queryReadWaterInfo) {
    mapReadResultBuilder.isWater=true;
  }
  return mapReadResultBuilder.build();
}