Program: 46612
Project: 46612
Buggy source:
public QueryResult parseQueryResponse(String response1,String queryType){
  try {
    XmlPullParserFactory factory=XmlPullParserFactory.newInstance();
    factory.setNamespaceAware(true);
    XmlPullParser xpp=factory.newPullParser();
    xpp.setInput(new StringReader(response1));
    int eventType=xpp.getEventType();
    boolean done=false;
    SObject currentSObject=null;
    boolean inRecord=false;
    String prevType=null;
    while (eventType != XmlPullParser.END_DOCUMENT && !done) {
      String name=null;
switch (eventType) {
case XmlPullParser.START_DOCUMENT:
        break;
case XmlPullParser.START_TAG:
      name=xpp.getName();
    System.out.println("String_Node_Str" + name);
  if (name.equalsIgnoreCase(DONE)) {
    if (!inRecord) {
      result.setDone(Boolean.parseBoolean(xpp.nextText()));
    }
  }
 else   if (name.equalsIgnoreCase(QUERY_LOCATOR)) {
    if (!inRecord) {
      String ql=xpp.nextText();
      result.setQueryLocator(ql);
    }
  }
 else   if (name.equalsIgnoreCase(SIZE)) {
    if (!inRecord) {
      result.setSize(Integer.parseInt(xpp.nextText()));
    }
  }
 else   if (name.equalsIgnoreCase(RECORDS)) {
    if (!inRecord) {
      currentSObject=new SObject();
      inRecord=true;
    }
  }
 else   if (name.equalsIgnoreCase(TYPE)) {
    if (inRecord) {
      String type=xpp.nextText();
      if ((prevType == null) || (type.equals(prevType))) {
        currentSObject.setType(type);
        prevType=type;
      }
    }
  }
 else   if (name.equalsIgnoreCase(ID)) {
    if (inRecord) {
      if (prevType.equals(currentSObject.getType())) {
        String Id=xpp.nextText();
        if (Id != null && Id != "String_Node_Str" && Id != "String_Node_Str") {
          currentSObject.setField(getRelationshipPrefix(parentChildrelationships) + ID,Id);
        }
      }
    }
  }
 else   if (!(currentSObject == null)) {
    if (xpp.getPrefix().equals("String_Node_Str")) {
      if (xpp.getAttributeCount() == 0) {
        if ((inRecord) && (prevType.equals(currentSObject.getType()))) {
          String value=xpp.nextText();
          currentSObject.setField(getRelationshipPrefix(parentChildrelationships) + name,value);
        }
      }
 else {
        if (xpp.getAttributeValue(null,"String_Node_Str") != null && xpp.getAttributeValue(null,"String_Node_Str").contains("String_Node_Str"))         parentChildrelationships.push(xpp.getName());
      }
    }
  }
break;
case XmlPullParser.END_TAG:
name=xpp.getName();
System.out.println("String_Node_Str" + name);
if (name.equalsIgnoreCase(RECORDS)) {
if (currentSObject.getType() != null) {
result.getRecords().add(currentSObject);
inRecord=false;
}
}
 else if (name.equalsIgnoreCase(queryType)) {
done=true;
}
 else if (!parentChildrelationships.isEmpty()) {
String lastRel=(String)parentChildrelationships.peek();
if (name.equalsIgnoreCase(lastRel)) parentChildrelationships.pop();
}
break;
}
eventType=xpp.next();
}
}
 catch (XmlPullParserException xppe) {
throw new RuntimeException(xppe);
}
catch (IOException ioe) {
throw new RuntimeException(ioe);
}
return result;
}

Fixed version (ground truth):
public QueryResult parseQueryResponse(String response1,String queryType){
  try {
    XmlPullParserFactory factory=XmlPullParserFactory.newInstance();
    factory.setNamespaceAware(true);
    XmlPullParser xpp=factory.newPullParser();
    xpp.setInput(new StringReader(response1));
    int eventType=xpp.getEventType();
    boolean done=false;
    SObject currentSObject=null;
    boolean inRecord=false;
    String prevType=null;
    while (eventType != XmlPullParser.END_DOCUMENT && !done) {
      String name=null;
switch (eventType) {
case XmlPullParser.START_DOCUMENT:
        break;
case XmlPullParser.START_TAG:
      name=xpp.getName();
    System.out.println("String_Node_Str" + name);
  if (name.equalsIgnoreCase(DONE)) {
    if (!inRecord) {
      result.setDone(Boolean.parseBoolean(xpp.nextText()));
    }
  }
 else   if (name.equalsIgnoreCase(QUERY_LOCATOR)) {
    if (!inRecord) {
      String ql=xpp.nextText();
      result.setQueryLocator(ql);
    }
  }
 else   if (name.equalsIgnoreCase(SIZE)) {
    if (!inRecord) {
      result.setSize(Integer.parseInt(xpp.nextText()));
    }
  }
 else   if (name.equalsIgnoreCase(RECORDS)) {
    if (!inRecord) {
      currentSObject=new SObject();
      inRecord=true;
    }
  }
 else   if (name.equalsIgnoreCase(TYPE)) {
    if (inRecord) {
      String type=xpp.nextText();
      if ((prevType == null) || (type.equals(prevType))) {
        currentSObject.setType(type);
        prevType=type;
      }
    }
  }
 else   if (name.equalsIgnoreCase(ID)) {
    if (inRecord) {
      if (prevType.equals(currentSObject.getType())) {
        String Id=xpp.nextText();
        if (Id != null && !Id.equalsIgnoreCase("String_Node_Str") && !Id.equals("String_Node_Str")) {
          currentSObject.setField(getRelationshipPrefix(parentChildrelationships) + ID,Id);
        }
      }
    }
  }
 else   if (!(currentSObject == null)) {
    if (xpp.getPrefix().equals("String_Node_Str")) {
      if (xpp.getAttributeCount() == 0) {
        if ((inRecord) && (prevType.equals(currentSObject.getType()))) {
          String value=xpp.nextText();
          currentSObject.setField(getRelationshipPrefix(parentChildrelationships) + name,value);
        }
      }
 else {
        if (xpp.getAttributeValue(null,"String_Node_Str") != null && xpp.getAttributeValue(null,"String_Node_Str").contains("String_Node_Str"))         parentChildrelationships.push(xpp.getName());
      }
    }
  }
break;
case XmlPullParser.END_TAG:
name=xpp.getName();
System.out.println("String_Node_Str" + name);
if (name.equalsIgnoreCase(RECORDS)) {
if (currentSObject.getType() != null) {
result.getRecords().add(currentSObject);
inRecord=false;
}
}
 else if (name.equalsIgnoreCase(queryType)) {
done=true;
}
 else if (!parentChildrelationships.isEmpty()) {
String lastRel=(String)parentChildrelationships.peek();
if (name.equalsIgnoreCase(lastRel)) parentChildrelationships.pop();
}
break;
}
eventType=xpp.next();
}
}
 catch (XmlPullParserException xppe) {
throw new RuntimeException(xppe);
}
catch (IOException ioe) {
throw new RuntimeException(ioe);
}
return result;
}