Program: 24766
Project: 24766
Buggy source:
public Explanation explain() throws IOException {
  Explanation result=new Explanation(0,"String_Node_Str" + toString() + "String_Node_Str");
  Explanation totalExpl;
  if (matchEndCell == 0)   totalExpl=((SpansCell)cells.get(0)).spans.explain();
 else {
    float totalScore=0.0f;
    totalExpl=new Explanation(0,"String_Node_Str");
    for (int i=0; i <= matchEndCell; i++) {
      SpansCell cell=(SpansCell)cells.get(i);
      totalScore+=cell.score();
      totalExpl.addDetail(cell.spans.explain());
    }
    totalExpl.setValue(totalScore);
  }
  result.addDetail(totalExpl);
  Explanation boostExpl=new Explanation(query.getBoost(),"String_Node_Str");
  if (boostExpl.getValue() != 1.0f)   result.addDetail(boostExpl);
  Explanation distExpl=new Explanation(0,"String_Node_Str" + (nClauses + 1) + "String_Node_Str");
  Explanation slopExpl=new Explanation(similarity.sloppyFreq(matchDist),"String_Node_Str" + matchDist + "String_Node_Str");
  distExpl.addDetail(slopExpl);
  distExpl.setValue(slopExpl.getValue() / (nClauses + 1));
  Explanation coordExpl=new Explanation((float)(matchEndCell + 1) / (nClauses + 1),"String_Node_Str" + (matchEndCell + 1) + "String_Node_Str"+ (nClauses + 1)+ "String_Node_Str");
  Explanation combinedFactorsExpl=new Explanation(distExpl.getValue() + coordExpl.getValue(),"String_Node_Str");
  combinedFactorsExpl.addDetail(distExpl);
  combinedFactorsExpl.addDetail(coordExpl);
  result.addDetail(combinedFactorsExpl);
  result.setValue(totalExpl.getValue() * boostExpl.getValue() * combinedFactorsExpl.getValue());
  return result;
}

Fixed version (ground truth):
public Explanation explain() throws IOException {
  Explanation result=new Explanation(0,"String_Node_Str" + toString() + "String_Node_Str");
  Explanation totalExpl;
  if (matchEndCell == 0)   totalExpl=((SpansCell)cells.get(0)).spans.explain();
 else {
    float totalScore=0.0f;
    totalExpl=new Explanation(0,"String_Node_Str");
    SpansCell prevCell=null;
    for (int i=0; i <= matchEndCell; i++) {
      SpansCell cell=(SpansCell)cells.get(i);
      if (prevCell != null && cell.start() < prevCell.end())       continue;
      totalScore+=cell.score();
      totalExpl.addDetail(cell.spans.explain());
      prevCell=cell;
    }
    totalExpl.setValue(totalScore);
  }
  result.addDetail(totalExpl);
  Explanation boostExpl=new Explanation(query.getBoost(),"String_Node_Str");
  if (boostExpl.getValue() != 1.0f)   result.addDetail(boostExpl);
  Explanation distExpl=new Explanation(0,"String_Node_Str" + (nClauses + 1) + "String_Node_Str");
  Explanation slopExpl=new Explanation(similarity.sloppyFreq(matchDist),"String_Node_Str" + matchDist + "String_Node_Str");
  distExpl.addDetail(slopExpl);
  distExpl.setValue(slopExpl.getValue() / (nClauses + 1));
  Explanation coordExpl=new Explanation((float)(matchNumCells + 1) / (nClauses + 1),"String_Node_Str" + (matchNumCells + 1) + "String_Node_Str"+ (nClauses + 1)+ "String_Node_Str");
  Explanation combinedFactorsExpl=new Explanation(distExpl.getValue() + coordExpl.getValue(),"String_Node_Str");
  combinedFactorsExpl.addDetail(distExpl);
  combinedFactorsExpl.addDetail(coordExpl);
  result.addDetail(combinedFactorsExpl);
  result.setValue(totalExpl.getValue() * boostExpl.getValue() * combinedFactorsExpl.getValue());
  return result;
}