Program: 101252
Project: 101252
Buggy source:
private FileStats getFileStatsFromScriptData(final Map<String,Map<Integer,Double>> allCoverageData,final ScriptData data){
  final Scanner in=new Scanner(data.getSourceCode());
  final Map<Integer,Double> coverageData=allCoverageData.get(data.getSourceName());
  final List<LineCoverageRecord> lineCoverageRecords=Lists.newArrayList();
  if (!data.getLineNumbersOfAllStatements().isEmpty()) {
    for (int lineNr=1; lineNr < data.getLineNumberOfFirstStatement() && in.hasNext(); lineNr++) {
      lineCoverageRecords.add(new LineCoverageRecord(lineNr,-1,in.nextLine()));
    }
    for (int lineNr=data.getLineNumberOfFirstStatement(), lengthCountdown=0; in.hasNext(); lineNr++) {
      final String line=in.nextLine();
      final Double coverageEntry=coverageData.get(lineNr);
      final int timesLineExecuted;
      if (coverageEntry == null) {
        final int lineLength=line.trim().length();
        if (lengthCountdown > 0 && lineLength > 0) {
          lengthCountdown-=lineLength;
          timesLineExecuted=-1;
        }
 else {
          timesLineExecuted=data.hasStatement(lineNr) ? 0 : -1;
        }
      }
 else {
        timesLineExecuted=coverageEntry.intValue();
        if (data.getStatementLength(lineNr) != null) {
          lengthCountdown=data.getStatementLength(lineNr);
        }
      }
      lineCoverageRecords.add(new LineCoverageRecord(lineNr,timesLineExecuted,line));
    }
  }
 else {
    for (int lineNr=1; in.hasNext(); lineNr++) {
      lineCoverageRecords.add(new LineCoverageRecord(lineNr,-1,in.nextLine()));
    }
  }
  return new FileStats(data.getSourceName(),lineCoverageRecords,data.isSeparateFile());
}

Fixed version (ground truth):
private FileStats getFileStatsFromScriptData(final Map<Integer,Double> coverageData,final ScriptData data){
  final Scanner in=new Scanner(data.getSourceCode());
  final List<LineCoverageRecord> lineCoverageRecords=Lists.newArrayList();
  if (!data.getLineNumbersOfAllStatements().isEmpty()) {
    for (int lineNr=1; lineNr < data.getLineNumberOfFirstStatement() && in.hasNext(); lineNr++) {
      lineCoverageRecords.add(new LineCoverageRecord(lineNr,-1,in.nextLine()));
    }
    for (int lineNr=data.getLineNumberOfFirstStatement(), lengthCountdown=0; in.hasNext(); lineNr++) {
      final String line=in.nextLine();
      final Double coverageEntry=coverageData.get(lineNr);
      final int timesLineExecuted;
      if (coverageEntry == null) {
        final int lineLength=line.trim().length();
        if (lengthCountdown > 0 && lineLength > 0) {
          lengthCountdown-=lineLength;
          timesLineExecuted=-1;
        }
 else {
          timesLineExecuted=data.hasStatement(lineNr) ? 0 : -1;
        }
      }
 else {
        timesLineExecuted=coverageEntry.intValue();
        if (data.getStatementLength(lineNr) != null) {
          lengthCountdown=data.getStatementLength(lineNr);
        }
      }
      lineCoverageRecords.add(new LineCoverageRecord(lineNr,timesLineExecuted,line));
    }
  }
 else {
    for (int lineNr=1; in.hasNext(); lineNr++) {
      lineCoverageRecords.add(new LineCoverageRecord(lineNr,-1,in.nextLine()));
    }
  }
  return new FileStats(data.getSourceName(),lineCoverageRecords,data.isSeparateFile());
}