Program: 26444
Project: 26444
Buggy source:
public BasicDataSet parse(String filepath,TimeZone timeZone) throws IOException {
  File file=new File(filepath);
  String filename=file.getName();
  int end=filename.indexOf("String_Node_Str");
  if (end == -1) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  String id=DataHelper.newString(filename.substring(0,end));
  int start=end + 1;
  end=filename.indexOf("String_Node_Str",start);
  end=filename.indexOf("String_Node_Str",end + 1);
  if (end == -1) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  String timestamp=DataHelper.newString(filename.substring(start,end));
  long baseTime=0;
  try {
    baseTime=TIMESTAMP_FORMAT.parse(timestamp).getTime();
  }
 catch (  ParseException e) {
    throw new IllegalArgumentException("String_Node_Str" + timestamp + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
  BasicDataSet data=new BasicDataSet(filename);
  data.setHostname(id);
  data.setMetadata("String_Node_Str",timestamp);
  String typeName=DataHelper.newString(filename.substring(end + 1,filename.length() - 4).toUpperCase());
  if (!TYPE_NAMES.containsKey(typeName)) {
    throw new IllegalArgumentException("String_Node_Str" + typeName + "String_Node_Str"+ TYPE_NAMES.keySet());
  }
  LineNumberReader in=null;
  try {
    in=new LineNumberReader(new FileReader(file));
    String line=null;
    DataRecord currentRecord=null;
    Map<String,DataType> typesByBlockSize=new java.util.HashMap<String,DataType>(1);
    Map<String,Aggregator> readDataByBlockSize=new java.util.HashMap<String,Aggregator>(1);
    Map<String,Aggregator> writeDataByBlockSize=new java.util.HashMap<String,Aggregator>(1);
    while ((line=in.readLine()) != null) {
      String[] values=DATA_SPLITTER.split(line);
      if (values.length != 4) {
        LOGGER.warn("String_Node_Str",in.getLineNumber());
        continue;
      }
      if (currentRecord == null) {
        currentRecord=new DataRecord(baseTime + Integer.parseInt(values[0]),values[0]);
      }
 else       if (!currentRecord.getTimestamp().equals(values[0])) {
        for (        String blockSize : typesByBlockSize.keySet()) {
          DataType type=typesByBlockSize.get(blockSize);
          Aggregator readAggregator=readDataByBlockSize.get(blockSize);
          Aggregator writeAggregator=writeDataByBlockSize.get(blockSize);
          double read=Double.NaN;
          double write=Double.NaN;
          if (readAggregator != null) {
            read=readAggregator.getAverage();
            readAggregator.clear();
          }
          if (writeAggregator != null) {
            write=writeAggregator.getAverage();
            writeAggregator.clear();
          }
          currentRecord.addData(type,new double[]{read,write});
        }
        data.addRecord(currentRecord);
        currentRecord=new DataRecord(baseTime + Integer.parseInt(values[0]),values[0]);
      }
      String operation=values[2];
      String blockSize=values[3];
      Aggregator aggregator=null;
      if ("String_Node_Str".equals(operation)) {
        aggregator=readDataByBlockSize.get(blockSize);
        if (aggregator == null) {
          aggregator=new Aggregator();
          readDataByBlockSize.put(blockSize,aggregator);
        }
      }
 else {
        aggregator=writeDataByBlockSize.get(blockSize);
        if (aggregator == null) {
          aggregator=new Aggregator();
          writeDataByBlockSize.put(blockSize,aggregator);
        }
      }
      DataType type=typesByBlockSize.get(blockSize);
      if (type == null) {
        type=new SubDataType(typeName,blockSize,TYPE_NAMES.get(typeName),"String_Node_Str","String_Node_Str");
        data.addType(type);
        typesByBlockSize.put(blockSize,type);
      }
      aggregator.aggregate(Integer.parseInt(values[1]));
    }
    if (currentRecord != null) {
      data.addRecord(currentRecord);
    }
    return data;
  }
  finally {
    if (in != null) {
      in.close();
    }
  }
}

Fixed version (ground truth):
public BasicDataSet parse(String filepath,TimeZone timeZone) throws IOException {
  File file=new File(filepath);
  String filename=file.getName();
  int end=filename.indexOf("String_Node_Str");
  if (end == -1) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  String id=DataHelper.newString(filename.substring(0,end));
  int start=end + 1;
  end=filename.indexOf("String_Node_Str",start);
  end=filename.indexOf("String_Node_Str",end + 1);
  if (end == -1) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  String timestamp=DataHelper.newString(filename.substring(start,end));
  long baseTime=0;
  try {
    baseTime=TIMESTAMP_FORMAT.parse(timestamp).getTime();
  }
 catch (  ParseException e) {
    throw new IllegalArgumentException("String_Node_Str" + timestamp + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
  BasicDataSet data=new BasicDataSet(filename);
  data.setHostname(id);
  data.setMetadata("String_Node_Str",timestamp);
  String typeName=DataHelper.newString(filename.substring(end + 1,filename.length() - 4).toUpperCase());
  if (!TYPE_NAMES.containsKey(typeName)) {
    throw new IllegalArgumentException("String_Node_Str" + typeName + "String_Node_Str"+ TYPE_NAMES.keySet());
  }
  LineNumberReader in=null;
  try {
    in=new LineNumberReader(new FileReader(file));
    String line=null;
    DataRecord currentRecord=null;
    Map<String,DataType> typesByBlockSize=new java.util.HashMap<String,DataType>(1);
    Map<String,Aggregator> readDataByBlockSize=new java.util.HashMap<String,Aggregator>(1);
    Map<String,Aggregator> writeDataByBlockSize=new java.util.HashMap<String,Aggregator>(1);
    while ((line=in.readLine()) != null) {
      String[] values=DATA_SPLITTER.split(line);
      if (values.length != 4) {
        LOGGER.warn("String_Node_Str",in.getLineNumber());
        continue;
      }
      if (currentRecord == null) {
        currentRecord=new DataRecord(baseTime + Integer.parseInt(values[0]),values[0]);
      }
 else       if (!currentRecord.getTimestamp().equals(values[0])) {
        for (        String blockSize : typesByBlockSize.keySet()) {
          DataType type=typesByBlockSize.get(blockSize);
          Aggregator readAggregator=readDataByBlockSize.get(blockSize);
          Aggregator writeAggregator=writeDataByBlockSize.get(blockSize);
          double read=Double.NaN;
          double write=Double.NaN;
          if (readAggregator != null) {
            read=readAggregator.getAverage();
            readAggregator.clear();
          }
          if (writeAggregator != null) {
            write=writeAggregator.getAverage();
            writeAggregator.clear();
          }
          currentRecord.addData(type,new double[]{read,write});
        }
        data.addRecord(currentRecord);
        currentRecord=new DataRecord(baseTime + Integer.parseInt(values[0]),values[0]);
      }
      String operation=values[2];
      String blockSize=DataHelper.newString(values[3]);
      Aggregator aggregator=null;
      if ("String_Node_Str".equals(operation)) {
        aggregator=readDataByBlockSize.get(blockSize);
        if (aggregator == null) {
          aggregator=new Aggregator();
          readDataByBlockSize.put(blockSize,aggregator);
        }
      }
 else {
        aggregator=writeDataByBlockSize.get(blockSize);
        if (aggregator == null) {
          aggregator=new Aggregator();
          writeDataByBlockSize.put(blockSize,aggregator);
        }
      }
      DataType type=typesByBlockSize.get(blockSize);
      if (type == null) {
        type=new SubDataType(typeName,blockSize,TYPE_NAMES.get(typeName),"String_Node_Str","String_Node_Str");
        data.addType(type);
        typesByBlockSize.put(blockSize,type);
      }
      try {
        aggregator.aggregate(Integer.parseInt(values[1]));
      }
 catch (      NumberFormatException nfe) {
        LOGGER.warn("String_Node_Str",values[1],in.getLineNumber());
      }
    }
    if (currentRecord != null) {
      data.addRecord(currentRecord);
    }
    return data;
  }
  finally {
    if (in != null) {
      in.close();
    }
  }
}