Program: 24820
Project: 24820
Buggy source:
/** 
 * Marks all the terms within the given text. Typically used to mark terms within a meta-data field.
 * @param doc        document to get matching spans from
 * @param fieldName  name of the field to mark.
 * @param value      value of the field to mark
 * @return           Marked up text value.
 */
public String markField(SpanDocument doc,String fieldName,final String value){
}

Fixed version (ground truth):
/** 
 * Marks all the terms within the given text. Typically used to mark terms within a meta-data field.
 * @param doc        document to get matching spans from
 * @param fieldName  name of the field to mark.
 * @param value      value of the field to mark
 * @return           Marked up text value.
 */
public String markField(SpanDocument doc,String fieldName,final String value){
  try {
    final StringBuffer buf=new StringBuffer(value.length() * 2);
    TokenStream stream=analyzer.tokenStream(fieldName,new StringReader(value));
    BasicWordIter wordIter=new BoundedWordIter(value,stream,chunkOverlap);
    doc.markField(fieldName,wordIter,maxContext,termMode,stopSet,new MarkCollector(){
      private MarkPos prevPos=null;
      private boolean inContext=false;
      private int contextSize;
      private MarkPos contextStart;
      private void copyUpTo(      MarkPos pos){
        if (prevPos != null) {
          String toAdd=prevPos.getTextTo(pos);
          buf.append(mapXMLChars(toAdd));
          if (inContext)           contextSize+=toAdd.length();
        }
        prevPos=pos;
      }
      public void beginField(      MarkPos pos){
        prevPos=pos;
      }
      public void beginContext(      MarkPos pos,      Span span){
        copyUpTo(pos);
        buf.append("String_Node_Str");
        buf.append(Integer.toString(span.rank + 1));
        buf.append("String_Node_Str");
        buf.append(Integer.toString((int)(span.score * 100)));
        buf.append("String_Node_Str");
        inContext=true;
        contextSize=0;
        contextStart=pos;
      }
      public void term(      MarkPos startPos,      MarkPos endPos,      String term){
        copyUpTo(startPos);
        buf.append("String_Node_Str");
        String toAdd=startPos.getTextTo(endPos);
        buf.append(toAdd);
        buf.append("String_Node_Str");
        prevPos=endPos;
        if (inContext)         contextSize+=toAdd.length();
      }
      public void beginSpan(      MarkPos pos,      Span span){
        copyUpTo(pos);
        buf.append("String_Node_Str");
        buf.append(Integer.toString(span.rank + 1));
        buf.append("String_Node_Str");
        buf.append(Integer.toString((int)(span.score * 100)));
        buf.append("String_Node_Str");
      }
      public void endSpan(      MarkPos pos){
        copyUpTo(pos);
        buf.append("String_Node_Str");
      }
      public void endContext(      MarkPos pos){
        copyUpTo(pos);
        buf.append("String_Node_Str");
        if (contextSize > maxContext) {
          int posDiff=contextStart.countTextTo(pos);
        }
        inContext=false;
      }
      public void endField(      MarkPos pos){
        copyUpTo(pos);
      }
    }
);
    String strVal=buf.toString();
    return strVal;
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str");
  }
}