Program: 24781
Project: 24781
Buggy source:
/** 
 * Parse a range query.
 */
private Query parseRange(EasyNode parent,String field,int maxSnippets) throws QueryGenException {
  boolean inclusive=false;
  String yesno=parseStringAttrib(parent,"String_Node_Str","String_Node_Str");
  if (yesno.equals("String_Node_Str") || yesno.equals("String_Node_Str"))   inclusive=true;
 else   if (!yesno.equals("String_Node_Str") && !yesno.equals("String_Node_Str"))   error("String_Node_Str" + "String_Node_Str");
  Term lower=null;
  Term upper=null;
  for (int i=0; i < parent.nChildren(); i++) {
    EasyNode child=parent.child(i);
    if (!child.isElement())     continue;
    String name=child.name();
    if (name.equals("String_Node_Str")) {
      if (lower != null)       error("String_Node_Str");
      if (child.child("String_Node_Str") != null)       lower=parseTerm(child.child("String_Node_Str"),field,"String_Node_Str");
 else       lower=parseTerm(child,field,"String_Node_Str");
    }
 else     if (name.equals("String_Node_Str")) {
      if (upper != null)       error("String_Node_Str");
      if (child.child("String_Node_Str") != null)       upper=parseTerm(child.child("String_Node_Str"),field,"String_Node_Str");
 else       upper=parseTerm(child,field,"String_Node_Str");
    }
 else     error("String_Node_Str" + "String_Node_Str");
  }
  if (lower == null && upper == null)   error("String_Node_Str");
  if (upper == null) {
    char[] tmp=new char[1];
    tmp[0]=Constants.MARKER_BASE;
    upper=new Term(lower.field(),new String(tmp));
  }
  SpanQuery q=new BigramSpanRangeQuery(lower,upper,inclusive,req.termLimit);
  q.setSpanRecording(maxSnippets);
  return q;
}

Fixed version (ground truth):
/** 
 * Parse a range query.
 */
private Query parseRange(EasyNode parent,String field,int maxSnippets) throws QueryGenException {
  boolean inclusive=false;
  String yesno=parseStringAttrib(parent,"String_Node_Str","String_Node_Str");
  if (yesno.equals("String_Node_Str") || yesno.equals("String_Node_Str"))   inclusive=true;
 else   if (!yesno.equals("String_Node_Str") && !yesno.equals("String_Node_Str"))   error("String_Node_Str" + "String_Node_Str");
  Term lower=null;
  Term upper=null;
  for (int i=0; i < parent.nChildren(); i++) {
    EasyNode child=parent.child(i);
    if (!child.isElement())     continue;
    String name=child.name();
    if (name.equals("String_Node_Str")) {
      if (lower != null)       error("String_Node_Str");
      if (child.child("String_Node_Str") != null)       lower=parseTerm(child.child("String_Node_Str"),field,"String_Node_Str");
 else       lower=parseTerm(child,field,"String_Node_Str");
    }
 else     if (name.equals("String_Node_Str")) {
      if (upper != null)       error("String_Node_Str");
      if (child.child("String_Node_Str") != null)       upper=parseTerm(child.child("String_Node_Str"),field,"String_Node_Str");
 else       upper=parseTerm(child,field,"String_Node_Str");
    }
 else     error("String_Node_Str" + "String_Node_Str");
  }
  if (lower == null && upper == null)   error("String_Node_Str");
  if (upper == null) {
    char[] tmp=new char[1];
    tmp[0]=Constants.MARKER_BASE;
    upper=new Term(lower.field(),new String(tmp));
  }
  SpanQuery q=new XtfSpanRangeQuery(lower,upper,inclusive,req.termLimit);
  q.setSpanRecording(maxSnippets);
  return q;
}