nus-yam/ex-repair huggingface dataset:
Program: 154401
Project: 154401
Buggy source:
private int minValue(LinkedList<Move> moves,int currentSearchDepth,int alphaMax,int betaMin){
  Pair<Integer,Move> value=null;
  if (currentSearchDepth == desiredDepth || isGoalState(moves)) {
    Random random=new Random();
    return random.nextInt(1000);
  }
  Game tempGame=createTempGame(moves);
  ArrayList<Move> moveList=findPossibleMoves(tempGame);
  for (int i=0; i < moveList.size(); i++) {
    Game tempGameTwo=createTempGame(moves);
    tempGameTwo.move(moveList.get(i),tempGame.myTurn());
    value=maxValue(tempGameTwo.moves,desiredDepth + 1,alphaMax,betaMin);
    betaMin=Math.min(value._1,betaMin);
    if (alphaMax >= betaMin) {
      return betaMin;
    }
  }
  return betaMin;
}

Fixed version (ground truth):
private int minValue(LinkedList<Move> moves,int currentSearchDepth,int alphaMax,int betaMin){
  Pair<Integer,Move> value=null;
  if (currentSearchDepth == desiredDepth || isGoalState(moves)) {
    Random random=new Random();
    return random.nextInt(1000);
  }
  Game tempGame=createTempGame(moves);
  ArrayList<Move> moveList=findPossibleMoves(tempGame);
  for (int i=0; i < moveList.size(); i++) {
    Game tempGameTwo=createTempGame(moves);
    tempGameTwo.move(moveList.get(i),tempGame.myTurn());
    value=maxValue(tempGameTwo.moves,currentSearchDepth + 1,alphaMax,betaMin);
    betaMin=Math.min(value._1,betaMin);
    if (alphaMax >= betaMin) {
      return betaMin;
    }
  }
  return betaMin;
}
Program: 154402
Project: 154402
Buggy source:
private Pair<Integer,Move> maxValue(LinkedList<Move> moves,int currentSearchDepth,int alphaMax,int betaMin){
  Move bestMove=null;
  int value;
  if (currentSearchDepth == desiredDepth || isGoalState(moves)) {
    Random random=new Random();
    ArrayList<Move> m=findPossibleMoves(game);
    return Pair.pair(random.nextInt(1000),m.get(random.nextInt(m.size())));
  }
  Game tempGame=createTempGame(moves);
  ArrayList<Move> moveList=findPossibleMoves(tempGame);
  bestMove=moveList.get(0);
  for (int i=0; i < moveList.size(); i++) {
    Game tempGameTwo=createTempGame(moves);
    tempGameTwo.move(moveList.get(i),tempGame.myTurn());
    value=minValue(tempGameTwo.moves,desiredDepth + 1,alphaMax,betaMin);
    if (value > alphaMax) {
      alphaMax=value;
      bestMove=moveList.get(i);
    }
    if (alphaMax >= betaMin) {
      return Pair.pair(alphaMax,bestMove);
    }
  }
  return Pair.pair(alphaMax,bestMove);
}

Fixed version (ground truth):
private Pair<Integer,Move> maxValue(LinkedList<Move> moves,int currentSearchDepth,int alphaMax,int betaMin){
  Move bestMove=null;
  int value;
  if (currentSearchDepth == desiredDepth || isGoalState(moves)) {
    Random random=new Random();
    ArrayList<Move> m=findPossibleMoves(game);
    return Pair.pair(random.nextInt(1000),m.get(random.nextInt(m.size())));
  }
  Game tempGame=createTempGame(moves);
  ArrayList<Move> moveList=findPossibleMoves(tempGame);
  bestMove=moveList.get(0);
  for (int i=0; i < moveList.size(); i++) {
    Game tempGameTwo=createTempGame(moves);
    tempGameTwo.move(moveList.get(i),tempGame.myTurn());
    value=minValue(tempGameTwo.moves,currentSearchDepth + 1,alphaMax,betaMin);
    if (value > alphaMax) {
      alphaMax=value;
      bestMove=moveList.get(i);
    }
    if (alphaMax >= betaMin) {
      return Pair.pair(alphaMax,bestMove);
    }
  }
  return Pair.pair(alphaMax,bestMove);
}
Program: 154403
Project: 154403
Buggy source:
@Override public String getElementAsString(){
  StringBuilder strBuilder=new StringBuilder();
  strBuilder.append("String_Node_Str" + this.name);
  for (  Map.Entry<String,String> entry : tagAttributes.entrySet()) {
    strBuilder.append("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue()+ "String_Node_Str");
  }
  strBuilder.append("String_Node_Str");
  for (  LinkedList<Item> list : items.values()) {
    for (    Item item : list) {
      strBuilder.append(item.getElementAsString());
    }
  }
  if (this.content != null) {
    strBuilder.append(this.content);
  }
  strBuilder.append("String_Node_Str" + this.name + "String_Node_Str");
  return strBuilder.toString();
}

Fixed version (ground truth):
@Override public String getElementAsString(){
  StringBuilder strBuilder=new StringBuilder();
  strBuilder.append("String_Node_Str" + this.name);
  for (  Map.Entry<String,String> entry : tagAttributes.entrySet()) {
    strBuilder.append("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue()+ "String_Node_Str");
  }
  strBuilder.append("String_Node_Str");
  for (  LinkedList<Item> list : items.values()) {
    for (    Item item : list) {
      strBuilder.append(item.getElementAsString());
    }
  }
  if (this.content != null) {
    if (this.contentCDATA) {
      strBuilder.append("String_Node_Str").append(this.content).append("String_Node_Str");
    }
 else {
      strBuilder.append(this.content);
    }
  }
  strBuilder.append("String_Node_Str" + this.name + "String_Node_Str");
  return strBuilder.toString();
}
Program: 154404
Project: 154404
Buggy source:
public Item parse(String xml) throws ParserException {
  try {
    if (xml == null)     return null;
    InputStream is=new ByteArrayInputStream(xml.getBytes("String_Node_Str"));
    parser=parserFactory.newSAXParser();
    parser.parse(is,new ResponseParserHandler());
  }
 catch (  Exception e) {
    throw new ParserException(e);
  }
  return result;
}

Fixed version (ground truth):
public Item parse(String xml) throws ParserException {
  try {
    if (xml == null)     return null;
    InputStream is=new ByteArrayInputStream(xml.getBytes("String_Node_Str"));
    ResponseParserHandler handler=new ResponseParserHandler();
    org.apache.xerces.parsers.SAXParser saxParser=new org.apache.xerces.parsers.SAXParser();
    saxParser.setProperty(LEXICAL_HANDLER,handler);
    saxParser.setContentHandler(handler);
    saxParser.parse(new InputSource(is));
  }
 catch (  Exception e) {
    throw new ParserException(e);
  }
  return result;
}
Program: 154405
Project: 154405
Buggy source:
/** 
 * @param ch     - The characters.
 * @param start  - The start position in the character array.
 * @param length - The number of characters to use from the character array.
 */
@Override public void characters(char[] ch,int start,int lenght) throws SAXException {
  String trimmed=new String(ch,start,lenght).trim();
  if (!trimmed.isEmpty() && !tagStack.empty()) {
    tagStack.peek().setContent(trimmed);
  }
}

Fixed version (ground truth):
/** 
 * @param ch     - The characters.
 * @param start  - The start position in the character array.
 * @param length - The number of characters to use from the character array.
 */
@Override public void characters(char[] ch,int start,int lenght) throws SAXException {
  String trimmed=new String(ch,start,lenght).trim();
  if (!trimmed.isEmpty() && !tagStack.empty()) {
    tagStack.peek().appendContent(trimmed);
  }
}
Program: 154406
Project: 154406
Buggy source:
/** 
 * @param wsdl the path or URL to the WSDL document
 * @throws XmlException
 * @throws IOException
 * @throws FrameworkException
 * @throws WSDLException
 */
public WSClient(String wsdl) throws XmlException, IOException, FrameworkException, WSDLException {
  WsdlProject project;
  try {
    project=new WsdlProject();
  }
 catch (  SoapUIException e) {
    throw new FrameworkException(e);
  }
  try {
    iface=WsdlInterfaceFactory.importWsdl(project,wsdl,true)[0];
  }
 catch (  SoapUIException e) {
    throw new WSDLException(e);
  }
  parseWsdlOperations();
  this.wsdl=wsdl;
}

Fixed version (ground truth):
/** 
 * @param wsdl the path or URL to the WSDL document
 * @throws XmlException
 * @throws IOException
 * @throws FrameworkException
 * @throws WSDLException
 */
public WSClient(String wsdl) throws XmlException, IOException, FrameworkException, WSDLException {
  if (!verifyDomainAvailability(wsdl))   throw new WSDLException("String_Node_Str" + wsdl + "String_Node_Str");
  WsdlProject project;
  try {
    project=new WsdlProject();
  }
 catch (  SoapUIException e) {
    throw new FrameworkException(e);
  }
  try {
    iface=WsdlInterfaceFactory.importWsdl(project,wsdl,true)[0];
  }
 catch (  SoapUIException e) {
    throw new WSDLException(e);
  }
  parseWsdlOperations();
  this.wsdl=wsdl;
}
Program: 154407
Project: 154407
Buggy source:
public FrameworkException(Exception originalException){
  super(originalException);
  this.originalException=originalException;
}

Fixed version (ground truth):
public FrameworkException(String message){
  super(message);
}
Program: 154408
Project: 154408
Buggy source:
public WSDLException(Exception originalException){
  super(originalException);
}

Fixed version (ground truth):
public WSDLException(String message){
  super(message);
}
Program: 154409
Project: 154409
Buggy source:
@Test public void shouldAddAndDeleteAtBook(){
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str","String_Node_Str");
  parameters.put("String_Node_Str","String_Node_Str");
  String id=client.post("String_Node_Str",parameters);
  String retrievedBook=client.get("String_Node_Str" + id);
  String expectedBook="String_Node_Str";
  assertEquals(expectedBook,retrievedBook);
  String deletedBook=client.delete("String_Node_Str" + id);
  assertEquals(deletedBook,expectedBook);
  assertEquals("String_Node_Str",client.get("String_Node_Str" + id));
}

Fixed version (ground truth):
@Test public void shouldAddAndDeleteAtBook(){
  RSClient client=new RSClient("String_Node_Str","String_Node_Str",53111);
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str","String_Node_Str");
  parameters.put("String_Node_Str","String_Node_Str");
  String id=client.post("String_Node_Str",parameters);
  String retrievedBook=client.get("String_Node_Str" + id);
  String expectedBook="String_Node_Str";
  assertEquals(expectedBook,retrievedBook);
  String deletedBook=client.delete("String_Node_Str" + id);
  assertEquals(deletedBook,expectedBook);
  assertEquals("String_Node_Str",client.get("String_Node_Str" + id));
}
Program: 154410
Project: 154410
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((content == null) ? 0 : content.hashCode());
  result=prime * result + ((items == null) ? 0 : items.hashCode());
  result=prime * result + ((name == null) ? 0 : name.hashCode());
  result=prime * result + ((tagParameters == null) ? 0 : tagParameters.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((content == null) ? 0 : content.hashCode());
  result=prime * result + ((items == null) ? 0 : items.hashCode());
  result=prime * result + ((name == null) ? 0 : name.hashCode());
  result=prime * result + ((tagAttributes == null) ? 0 : tagAttributes.hashCode());
  return result;
}
Program: 154411
Project: 154411
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  ResponseItem other=(ResponseItem)obj;
  if (content == null) {
    if (other.content != null)     return false;
  }
 else   if (!content.equals(other.content))   return false;
  if (items == null) {
    if (other.items != null)     return false;
  }
 else   if (!items.equals(other.items))   return false;
  if (name == null) {
    if (other.name != null)     return false;
  }
 else   if (!name.equals(other.name))   return false;
  if (tagParameters == null) {
    if (other.tagParameters != null)     return false;
  }
 else   if (!tagParameters.equals(other.tagParameters))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  ResponseItem other=(ResponseItem)obj;
  if (content == null) {
    if (other.content != null)     return false;
  }
 else   if (!content.equals(other.content))   return false;
  if (items == null) {
    if (other.items != null)     return false;
  }
 else   if (!items.equals(other.items))   return false;
  if (name == null) {
    if (other.name != null)     return false;
  }
 else   if (!name.equals(other.name))   return false;
  if (tagAttributes == null) {
    if (other.tagAttributes != null)     return false;
  }
 else   if (!tagAttributes.equals(other.tagAttributes))   return false;
  return true;
}
Program: 154412
Project: 154412
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + content + "String_Node_Str"+ name+ "String_Node_Str"+ tagParameters+ "String_Node_Str"+ items+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + content + "String_Node_Str"+ name+ "String_Node_Str"+ tagAttributes+ "String_Node_Str"+ items+ "String_Node_Str";
}
Program: 154413
Project: 154413
Buggy source:
public ResponseItem(String tagName){
  this.name=tagName;
  items=new HashMap<String,LinkedList<ResponseItem>>();
  this.tagParameters=new HashMap<String,String>();
}

Fixed version (ground truth):
public ResponseItem(String tagName){
  this.name=tagName;
  items=new HashMap<String,LinkedList<ResponseItem>>();
  this.tagAttributes=new HashMap<String,String>();
}
Program: 154414
Project: 154414
Buggy source:
/** 
 * @param uri       - The Namespace URI.
 * @param localName - The local name (without prefix).
 * @param qName     - The qualified name (with prefix).
 */
@Override public void endElement(String uri,String localName,String qName) throws SAXException {
  String name=qName.split("String_Node_Str")[1];
  if (processing) {
    if (name.equals(opName)) {
      processing=false;
    }
 else {
      ResponseItem poped=tagStack.pop();
      if (!tagStack.empty()) {
        ResponseItem father=tagStack.peek();
        father.addItem(poped);
      }
 else {
        result=poped;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param uri       - The Namespace URI.
 * @param localName - The local name (without prefix).
 * @param qName     - The qualified name (with prefix).
 */
@Override public void endElement(String uri,String localName,String qName) throws SAXException {
  String name=qName.split("String_Node_Str")[1];
  if (processing) {
    if (name.equals(opName)) {
      processing=false;
    }
 else {
      ResponseItem poped=tagStack.pop();
      if (!tagStack.empty()) {
        ResponseItem father=tagStack.peek();
        father.addChild(poped);
      }
 else {
        result=poped;
      }
    }
  }
}
Program: 154415
Project: 154415
Buggy source:
@Test public void shouldAddAnItemWithParameters(){
  HashMap<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str","String_Node_Str");
  ResponseItem childItem=new ResponseItem("String_Node_Str",parameters);
  assertEquals("String_Node_Str",childItem.getTagParameters().get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldAddAnItemWithParameters(){
  HashMap<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str","String_Node_Str");
  ResponseItem childItem=new ResponseItem("String_Node_Str",parameters);
  assertEquals("String_Node_Str",childItem.getTagAttributes().get("String_Node_Str"));
}
Program: 154416
Project: 154416
Buggy source:
@Test public void shouldAddAnSimpleItem() throws NoSuchFieldException {
  ResponseItem childItem=new ResponseItem("String_Node_Str");
  childItem.setContent("String_Node_Str");
  item.addItem(childItem);
  assertEquals("String_Node_Str",item.getAttr("String_Node_Str").getContent());
}

Fixed version (ground truth):
@Test public void shouldAddAnSimpleItem() throws NoSuchFieldException {
  ResponseItem childItem=new ResponseItem("String_Node_Str");
  childItem.setContent("String_Node_Str");
  item.addChild(childItem);
  assertEquals("String_Node_Str",item.getChild("String_Node_Str").getContent());
}
Program: 154417
Project: 154417
Buggy source:
@Test(expected=NoSuchFieldException.class) public void shouldThrowsAnExceptionWhenTheElementNotExist() throws NoSuchFieldException {
  item.getAttr("String_Node_Str");
}

Fixed version (ground truth):
@Test(expected=NoSuchFieldException.class) public void shouldThrowsAnExceptionWhenTheElementNotExist() throws NoSuchFieldException {
  item.getChild("String_Node_Str");
}
Program: 154418
Project: 154418
Buggy source:
@Test public void shouldAddAComplexItem() throws NoSuchFieldException {
  ResponseItem coAuthorItem=new ResponseItem("String_Node_Str");
  ResponseItem nameItem=new ResponseItem("String_Node_Str");
  nameItem.setContent("String_Node_Str");
  coAuthorItem.addItem(nameItem);
  item.addItem(coAuthorItem);
  assertEquals("String_Node_Str",item.getAttr("String_Node_Str").getAttr("String_Node_Str").getContent());
}

Fixed version (ground truth):
@Test public void shouldAddAComplexItem() throws NoSuchFieldException {
  ResponseItem coAuthorItem=new ResponseItem("String_Node_Str");
  ResponseItem nameItem=new ResponseItem("String_Node_Str");
  nameItem.setContent("String_Node_Str");
  coAuthorItem.addChild(nameItem);
  item.addChild(coAuthorItem);
  assertEquals("String_Node_Str",item.getChild("String_Node_Str").getChild("String_Node_Str").getContent());
}
Program: 154419
Project: 154419
Buggy source:
@Test public void shouldAddAComplexWithTwoSimpleItems() throws NoSuchFieldException {
  ResponseItem coAuthorItem=new ResponseItem("String_Node_Str");
  ResponseItem nameItemA=new ResponseItem("String_Node_Str");
  nameItemA.setContent("String_Node_Str");
  ResponseItem nameItemB=new ResponseItem("String_Node_Str");
  nameItemB.setContent("String_Node_Str");
  coAuthorItem.addItem(nameItemA);
  coAuthorItem.addItem(nameItemB);
  item.addItem(coAuthorItem);
  List<ResponseItem> coAuthors=item.getAttr("String_Node_Str").getAttrAsList("String_Node_Str");
  assertEquals("String_Node_Str",coAuthors.get(0).getContent());
  assertEquals("String_Node_Str",coAuthors.get(1).getContent());
}

Fixed version (ground truth):
@Test public void shouldAddAComplexWithTwoSimpleItems() throws NoSuchFieldException {
  ResponseItem coAuthorItem=new ResponseItem("String_Node_Str");
  ResponseItem nameItemA=new ResponseItem("String_Node_Str");
  nameItemA.setContent("String_Node_Str");
  ResponseItem nameItemB=new ResponseItem("String_Node_Str");
  nameItemB.setContent("String_Node_Str");
  coAuthorItem.addChild(nameItemA);
  coAuthorItem.addChild(nameItemB);
  item.addChild(coAuthorItem);
  List<ResponseItem> coAuthors=item.getChild("String_Node_Str").getChildAsList("String_Node_Str");
  assertEquals("String_Node_Str",coAuthors.get(0).getContent());
  assertEquals("String_Node_Str",coAuthors.get(1).getContent());
}
Program: 154420
Project: 154420
Buggy source:
@Test public void shouldAddTwoSimpleItemWithTheSameName() throws NoSuchFieldException {
  ResponseItem childItemA=new ResponseItem("String_Node_Str");
  childItemA.setContent("String_Node_Str");
  item.addItem(childItemA);
  ResponseItem childItemB=new ResponseItem("String_Node_Str");
  childItemB.setContent("String_Node_Str");
  item.addItem(childItemB);
  List<ResponseItem> children=item.getAttrAsList("String_Node_Str");
  assertEquals("String_Node_Str",children.get(0).getContent());
  assertEquals("String_Node_Str",children.get(1).getContent());
}

Fixed version (ground truth):
@Test public void shouldAddTwoSimpleItemWithTheSameName() throws NoSuchFieldException {
  ResponseItem childItemA=new ResponseItem("String_Node_Str");
  childItemA.setContent("String_Node_Str");
  item.addChild(childItemA);
  ResponseItem childItemB=new ResponseItem("String_Node_Str");
  childItemB.setContent("String_Node_Str");
  item.addChild(childItemB);
  List<ResponseItem> children=item.getChildAsList("String_Node_Str");
  assertEquals("String_Node_Str",children.get(0).getContent());
  assertEquals("String_Node_Str",children.get(1).getContent());
}
Program: 154421
Project: 154421
Buggy source:
@Test public void shouldGetAListWithOneElement() throws NoSuchFieldException {
  ResponseItem childItem=new ResponseItem("String_Node_Str");
  childItem.setContent("String_Node_Str");
  item.addItem(childItem);
  assertEquals(1,item.getAttrAsList("String_Node_Str").size());
  assertEquals("String_Node_Str",item.getAttr("String_Node_Str").getContent());
}

Fixed version (ground truth):
@Test public void shouldGetAListWithOneElement() throws NoSuchFieldException {
  ResponseItem childItem=new ResponseItem("String_Node_Str");
  childItem.setContent("String_Node_Str");
  item.addChild(childItem);
  assertEquals(1,item.getChildAsList("String_Node_Str").size());
  assertEquals("String_Node_Str",item.getChild("String_Node_Str").getContent());
}
Program: 154422
Project: 154422
Buggy source:
@Test public void shouldAddAComplexItemAnHaveContent() throws NoSuchFieldException {
  ResponseItem coAuthorItem=new ResponseItem("String_Node_Str");
  ResponseItem nameItem=new ResponseItem("String_Node_Str");
  nameItem.setContent("String_Node_Str");
  coAuthorItem.addItem(nameItem);
  item.addItem(coAuthorItem);
  item.setContent("String_Node_Str");
  assertEquals("String_Node_Str",item.getAttr("String_Node_Str").getAttr("String_Node_Str").getContent());
  assertEquals((Integer)1935,item.getContentAsInt());
}

Fixed version (ground truth):
@Test public void shouldAddAComplexItemAnHaveContent() throws NoSuchFieldException {
  ResponseItem coAuthorItem=new ResponseItem("String_Node_Str");
  ResponseItem nameItem=new ResponseItem("String_Node_Str");
  nameItem.setContent("String_Node_Str");
  coAuthorItem.addChild(nameItem);
  item.addChild(coAuthorItem);
  item.setContent("String_Node_Str");
  assertEquals("String_Node_Str",item.getChild("String_Node_Str").getChild("String_Node_Str").getContent());
  assertEquals((Integer)1935,item.getContentAsInt());
}
Program: 154423
Project: 154423
Buggy source:
@Test public void shouldParseAnItemWithParameters() throws ParserConfigurationException, SAXException, NoSuchFieldException {
  String sampleXml="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ResponseParser parser=new ResponseParser();
  ResponseItem item=parser.parse(sampleXml);
  ResponseItem actual=item.getAttr("String_Node_Str");
  assertEquals("String_Node_Str",actual.getTagParameters().get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldParseAnItemWithParameters() throws ParserConfigurationException, SAXException, NoSuchFieldException {
  String sampleXml="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ResponseParser parser=new ResponseParser();
  ResponseItem item=parser.parse(sampleXml);
  ResponseItem actual=item.getChild("String_Node_Str");
  assertEquals("String_Node_Str",actual.getTagAttributes().get("String_Node_Str"));
}
Program: 154424
Project: 154424
Buggy source:
@Test public void shouldParseASimpleXmlWithLineBreaks() throws ParserConfigurationException, SAXException {
  String sampleXml="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ResponseParser parser=new ResponseParser();
  ResponseItem actual=parser.parse(sampleXml);
  ResponseItem expected=new ResponseItem("String_Node_Str");
  ResponseItem child=new ResponseItem("String_Node_Str");
  child.setContent("String_Node_Str");
  expected.addItem(child);
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void shouldParseASimpleXmlWithLineBreaks() throws ParserConfigurationException, SAXException {
  String sampleXml="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ResponseParser parser=new ResponseParser();
  ResponseItem actual=parser.parse(sampleXml);
  ResponseItem expected=new ResponseItem("String_Node_Str");
  ResponseItem child=new ResponseItem("String_Node_Str");
  child.setContent("String_Node_Str");
  expected.addChild(child);
  assertEquals(expected,actual);
}
Program: 154426
Project: 154426
Buggy source:
@Test public void shouldParseAComplexTypeTest() throws ParserConfigurationException, SAXException {
  String sampleXml="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ResponseParser parser=new ResponseParser();
  ResponseItem actual=parser.parse(sampleXml);
  ResponseItem expected=new ResponseItem("String_Node_Str");
  ResponseItem item=new ResponseItem("String_Node_Str");
  ResponseItem childA=new ResponseItem("String_Node_Str");
  childA.setContent("String_Node_Str");
  item.addItem(childA);
  ResponseItem childB=new ResponseItem("String_Node_Str");
  childB.setContent("String_Node_Str");
  item.addItem(childB);
  ResponseItem childC=new ResponseItem("String_Node_Str");
  childC.setContent("String_Node_Str");
  item.addItem(childC);
  ResponseItem childD=new ResponseItem("String_Node_Str");
  childD.setContent("String_Node_Str");
  item.addItem(childD);
  expected.addItem(item);
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void shouldParseAComplexTypeTest() throws ParserConfigurationException, SAXException {
  String sampleXml="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ResponseParser parser=new ResponseParser();
  ResponseItem actual=parser.parse(sampleXml);
  ResponseItem expected=new ResponseItem("String_Node_Str");
  ResponseItem item=new ResponseItem("String_Node_Str");
  ResponseItem childA=new ResponseItem("String_Node_Str");
  childA.setContent("String_Node_Str");
  item.addChild(childA);
  ResponseItem childB=new ResponseItem("String_Node_Str");
  childB.setContent("String_Node_Str");
  item.addChild(childB);
  ResponseItem childC=new ResponseItem("String_Node_Str");
  childC.setContent("String_Node_Str");
  item.addChild(childC);
  ResponseItem childD=new ResponseItem("String_Node_Str");
  childD.setContent("String_Node_Str");
  item.addChild(childD);
  expected.addChild(item);
  assertEquals(expected,actual);
}
Program: 154427
Project: 154427
Buggy source:
@Test public void shouldParseASimpleXml() throws ParserConfigurationException, SAXException {
  String sampleXml="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ResponseParser parser=new ResponseParser();
  ResponseItem actual=parser.parse(sampleXml);
  ResponseItem expected=new ResponseItem("String_Node_Str");
  ResponseItem child=new ResponseItem("String_Node_Str");
  child.setContent("String_Node_Str");
  expected.addItem(child);
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void shouldParseASimpleXml() throws ParserConfigurationException, SAXException {
  String sampleXml="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ResponseParser parser=new ResponseParser();
  ResponseItem actual=parser.parse(sampleXml);
  ResponseItem expected=new ResponseItem("String_Node_Str");
  ResponseItem child=new ResponseItem("String_Node_Str");
  child.setContent("String_Node_Str");
  expected.addChild(child);
  assertEquals(expected,actual);
}
Program: 154428
Project: 154428
Buggy source:
public static void main(String[] args){
  checker.captureCallStacks=false;
  Main.main(args);
}

Fixed version (ground truth):
public static void main(String[] args){
  Property.start();
  Main.main(args);
  Property.stop();
}
Program: 154429
Project: 154429
Buggy source:
private static boolean isConstant(Object o){
  return o instanceof Integer || o instanceof String;
}

Fixed version (ground truth):
private static boolean isConstant(Object o){
  return o instanceof Integer || o instanceof String || o instanceof Boolean;
}
Program: 154430
Project: 154430
Buggy source:
State popEvent(){
  return new State(vertex,store,events.pop(),parent);
}

Fixed version (ground truth):
State popEvent(){
  return new State(vertex,store,events.pop(),parent,time);
}
Program: 154431
Project: 154431
Buggy source:
private State(int vertex,Treap<Binding> store,Queue<Event> events,Parent parent){
  this.vertex=vertex;
  this.store=store;
  this.events=events;
  this.parent=parent;
  this.time=1 + (parent == null ? 0 : parent.state.time);
}

Fixed version (ground truth):
private State(int vertex,Treap<Binding> store,Queue<Event> events,Parent parent,int time){
  this.vertex=vertex;
  this.store=store;
  this.events=events;
  this.parent=parent;
  this.time=time;
}
Program: 154432
Project: 154432
Buggy source:
private static void selectOldest(State[] a,int i,int j,int k){
  int ii, jj, kk;
  if (i >= k)   return;
  jj=i + random.nextInt() % (k - i);
  swap(a,i,jj);
  for (ii=jj=kk=i + 1; kk < k; ++kk) {
    if (a[kk].time <= a[i].time) {
      swap(a,jj++,kk);
    }
  }
  if (jj < k) {
    if (j < jj) {
      selectOldest(a,i,j,jj);
    }
 else {
      selectOldest(a,jj,j,k);
    }
  }
}

Fixed version (ground truth):
private static void selectOldest(State[] a,int i,int j,int k){
  int ii, jj, kk;
  if (i >= k)   return;
  jj=i + random.nextInt() % (k - i);
  swap(a,i,jj);
  for (ii=jj=kk=i + 1; kk < k; ++kk) {
    if (a[kk].time <= a[i].time) {
      swap(a,jj++,kk);
    }
  }
  swap(a,i,--jj);
  if (j < jj) {
    selectOldest(a,i,j,jj);
  }
 else   if (j > jj) {
    selectOldest(a,jj + 1,j,k);
  }
}
Program: 154433
Project: 154433
Buggy source:
static State make(int vertex,Treap<Binding> store,Queue<Event> events,Queue<Event> consumed,State parent){
  return new State(vertex,store,events,new Parent(parent,consumed));
}

Fixed version (ground truth):
static State make(int vertex,Treap<Binding> store,Queue<Event> events,Queue<Event> consumed,State parent){
  return new State(vertex,store,events,new Parent(parent,consumed),parent.time + 1);
}
Program: 154434
Project: 154434
Buggy source:
State pushEvent(Event event){
  return new State(vertex,store,events.push(event),parent);
}

Fixed version (ground truth):
State pushEvent(Event event){
  return new State(vertex,store,events.push(event),parent,time);
}
Program: 154435
Project: 154435
Buggy source:
static State start(int vertex){
  return new State(vertex,Treap.<Binding>empty(),Queue.<Event>empty(),null);
}

Fixed version (ground truth):
static State start(int vertex){
  return new State(vertex,Treap.<Binding>empty(),Queue.<Event>empty(),null,0);
}
Program: 154437
Project: 154437
Buggy source:
public boolean play(CellKey this_cell_key,Player this_player){
  assert(cell_space != null);
  assert(started);
  Cell this_cell=cell_space.get_cell_from_key(this_cell_key);
  if (this_cell != null)   return play(this_cell,this_player);
 else   return false;
}

Fixed version (ground truth):
public boolean play(CellKey this_cell_key,Player this_player){
  assert(myCellSpace != null);
  assert(started);
  Cell this_cell=myCellSpace.get_cell_from_key(this_cell_key);
  if (this_cell != null)   return play(this_cell,this_player);
 else   return false;
}
Program: 154438
Project: 154438
Buggy source:
public void set_listener(GameListener this_listener){
  my_listener=this_listener;
}

Fixed version (ground truth):
public void set_listener(GameListener this_listener){
  myListener=this_listener;
}
Program: 154439
Project: 154439
Buggy source:
protected Game(){
  players=new LinkedHashSet<Player>();
  pieces=new LinkedHashSet<Piece>();
  started=false;
  my_listener=null;
}

Fixed version (ground truth):
protected Game(){
  myPlayers=new LinkedHashSet<Player>();
  pieces=new LinkedHashSet<Piece>();
  started=false;
  myListener=null;
}
Program: 154440
Project: 154440
Buggy source:
protected abstract void next_player();

Fixed version (ground truth):
protected void next_player(){
  if (playerTurn.hasNext()) {
    currentPlayer=playerTurn.next();
    if (!currentPlayer.is_alive())     next_player();
    assert(currentPlayer != null);
  }
 else   select_first_player();
}
Program: 154441
Project: 154441
Buggy source:
protected abstract void select_first_player();

Fixed version (ground truth):
protected void select_first_player(){
  playerTurn=getPlayers().iterator();
  currentPlayer=playerTurn.next();
  if (!currentPlayer.is_alive())   next_player();
  assert(currentPlayer != null);
}
Program: 154442
Project: 154442
Buggy source:
public void start(){
  assert(players.size() > 1);
  select_first_player();
  started=true;
}

Fixed version (ground truth):
public void start(){
  assert(myPlayers.size() > 1);
  select_first_player();
  started=true;
}
Program: 154443
Project: 154443
Buggy source:
public ReadOnlyCellSpace get_cell_space_view(){
  assert(cell_space != null);
  return cell_space;
}

Fixed version (ground truth):
public ReadOnlyCellSpace get_cell_space_view(){
  assert(myCellSpace != null);
  return myCellSpace;
}
Program: 154444
Project: 154444
Buggy source:
public abstract Player get_current_player();

Fixed version (ground truth):
public Player get_current_player(){
  return currentPlayer;
}
Program: 154445
Project: 154445
Buggy source:
protected void win(Player winner){
  if (my_listener != null)   my_listener.on_win(this,winner);
}

Fixed version (ground truth):
protected void win(Player winner){
  if (myListener != null) {
    myListener.on_win(this,winner);
  }
}
Program: 154446
Project: 154446
Buggy source:
public void change_owner(Player this_player){
  Player old_owner=owner;
  old_owner.loose_a_piece(this);
  owner=this_player;
  owner.win_a_piece(this);
  if (my_listener != null)   my_listener.on_owner_changed(this,old_owner,owner);
}

Fixed version (ground truth):
public void change_owner(Player this_player){
  Player old_owner=owner;
  old_owner.looseAPiece(this);
  owner=this_player;
  owner.winAPiece(this);
  if (my_listener != null)   my_listener.on_owner_changed(this,old_owner,owner);
}
Program: 154447
Project: 154447
Buggy source:
public Player(String this_name){
  super(this_name);
}

Fixed version (ground truth):
public Player(String thisName){
  super(thisName);
}
Program: 154448
Project: 154448
Buggy source:
@Override public void create(){
  Gdx.app.log("String_Node_Str","String_Node_Str");
  camera=new OrthographicCamera(500,300);
  cam=new PerspectiveCamera(67,500,300);
  meshObj=new MeshObject(0,0,10,10,10);
  meshObj2=new MeshObject(10,20,10,10,10);
  CollisionHelper.collidable.add(meshObj);
  CollisionHelper.collidable.add(meshObj2);
  spawn=new Vector2(-100,5);
  target=new Vector2(100,-5);
  font=new BitmapFont(Gdx.files.internal("String_Node_Str"),Gdx.files.internal("String_Node_Str"),false);
  gl=Gdx.graphics.getGL10();
  batch=new SpriteBatch();
  Gdx.app.log("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public void create(){
  Gdx.app.log("String_Node_Str","String_Node_Str");
  camera=new OrthographicCamera(500,300);
  cam=new PerspectiveCamera(67,500,300);
  meshObj=new MeshObject(0,0,10,10,10);
  meshObj2=new MeshObject(10,20,10,10,10);
  CollisionHelper.collidable.add(meshObj);
  CollisionHelper.collidable.add(meshObj2);
  spawn=new Vector2(-50,5);
  target=new Vector2(50,-5);
  font=new BitmapFont(Gdx.files.internal("String_Node_Str"),Gdx.files.internal("String_Node_Str"),false);
  gl=Gdx.graphics.getGL10();
  batch=new SpriteBatch();
  Gdx.app.log("String_Node_Str","String_Node_Str");
}
Program: 154449
Project: 154449
Buggy source:
@Override public void render(){
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  camera.update();
  camera.apply(gl);
  batch.setProjectionMatrix(camera.combined);
  batch.setTransformMatrix(camera.view);
  if (Gdx.input.justTouched()) {
    wp=new WayPoint(spawn,target,false);
    wp.CalculateNextPossibleWayPoints();
  }
  if (debug) {
    VisualDebugHelper.drawPoints(gl);
  }
  meshObj.render(gl);
  meshObj2.render(gl);
  batch.begin();
  font.draw(batch,"String_Node_Str" + Gdx.graphics.getFramesPerSecond(),-220,140);
  batch.end();
}

Fixed version (ground truth):
@Override public void render(){
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  cam.update();
  cam.apply(gl);
  batch.setProjectionMatrix(camera.combined);
  batch.setTransformMatrix(camera.view);
  if (Gdx.input.justTouched()) {
    wp=new WayPoint(spawn,target,false);
    wp.CalculateNextPossibleWayPoints();
  }
  if (debug) {
    VisualDebugHelper.drawPoints(gl);
    VisualDebugHelper.drawLines(gl);
  }
  meshObj.render(gl);
  meshObj2.render(gl);
  batch.begin();
  font.draw(batch,"String_Node_Str" + Gdx.graphics.getFramesPerSecond(),-220,140);
  batch.end();
}
Program: 154450
Project: 154450
Buggy source:
public void calculateHit(float dst){
  hit=new Vector2();
  hit.set(rayDir.add(start).mul(dst));
  if (debug) {
    VisualDebugHelper.addPoint(hit);
  }
}

Fixed version (ground truth):
public void calculateHit(float dst){
  hit=new Vector2();
  hit.set(rayDir.mul(dst));
  if (debug) {
    VisualDebugHelper.addPoint(hit);
  }
}
Program: 154451
Project: 154451
Buggy source:
public static void drawPoints(GL10 gl){
  gl.glPointSize(10);
  renderer.begin(GL10.GL_POINTS);
  renderer.color(1,0,0,1);
  for (  Vector2 point : points) {
    renderer.vertex(point.x,point.y,DEPTH);
  }
  renderer.end();
}

Fixed version (ground truth):
public static void drawPoints(GL10 gl){
  gl.glPointSize(5);
  renderer.begin(GL10.GL_POINTS);
  for (  Vector2 point : points) {
    renderer.color(1,0,0,1);
    renderer.vertex(point.x,point.y,DEPTH);
  }
  renderer.end();
}
Program: 154452
Project: 154452
Buggy source:
public static void addPoint(Vector2 v){
  points.add(v);
  Gdx.app.log("String_Node_Str","String_Node_Str" + v);
}

Fixed version (ground truth):
public static void addPoint(Vector2 v){
  v=new Vector2(v);
  points.add(v);
  Gdx.app.log("String_Node_Str","String_Node_Str" + v);
}
Program: 154453
Project: 154453
Buggy source:
public WayPoint(Vector2 position,Vector2 target,boolean isHitPoint){
  this.position=position;
  this.target=target;
  this.isHitPoint=isHitPoint;
  ri=new RayInfo();
  dirs=new ArrayList<Vector2>();
  possibleNextWaypoints=new ArrayList<WayPoint>();
  if (debug) {
    VisualDebugHelper.addPoint(position);
  }
  Gdx.app.log("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public WayPoint(Vector2 position,Vector2 target,boolean isHitPoint){
  this.position=position;
  this.target=target;
  this.isHitPoint=isHitPoint;
  ri=new RayInfo();
  dirs=new ArrayList<Vector2>();
  possibleNextWaypoints=new ArrayList<WayPoint>();
  if (debug) {
    VisualDebugHelper.addPoint(position);
    VisualDebugHelper.addPoint(target);
  }
  Gdx.app.log("String_Node_Str","String_Node_Str");
}
Program: 154454
Project: 154454
Buggy source:
private Vector2 CastRay(Vector2 start,Vector2 end){
  Gdx.app.log("String_Node_Str","String_Node_Str");
  ri.start=new Vector2(start);
  ri.end=new Vector2(end);
  float oldDst=MAX_RAY_LENGTH;
  ri.calculateDir();
  hasCollided=false;
  for (  MeshObject mesh : CollisionHelper.collidable) {
    Gdx.app.log("String_Node_Str","String_Node_Str");
    if (oldDst > ri.distanceToHit && RayCastHelper.IntersectLineCircle(mesh.getPosition(),mesh.getRadius(),ri)) {
      oldDst=ri.distanceToHit;
      hasCollided=true;
      Gdx.app.log("String_Node_Str","String_Node_Str");
    }
  }
  ri.calculateHit(ri.distanceToHit);
  return ri.hit;
}

Fixed version (ground truth):
private Vector2 CastRay(Vector2 start,Vector2 end){
  Gdx.app.log("String_Node_Str","String_Node_Str");
  ri.start=new Vector2(start);
  ri.end=new Vector2(end);
  float oldDst=MAX_RAY_LENGTH;
  ri.calculateDir();
  hasCollided=false;
  for (  MeshObject mesh : CollisionHelper.collidable) {
    Gdx.app.log("String_Node_Str","String_Node_Str");
    if (oldDst > ri.distanceToHit && RayCastHelper.IntersectLineCircle(mesh.getPosition(),mesh.getRadius(),ri)) {
      oldDst=ri.distanceToHit;
      hasCollided=true;
      Gdx.app.log("String_Node_Str","String_Node_Str");
    }
  }
  ri.calculateHit(ri.distanceToHit);
  if (debug) {
    VisualDebugHelper.addLine(start,ri.hit);
  }
  return ri.hit;
}
Program: 154455
Project: 154455
Buggy source:
private boolean doSideSteps(ArrayList<Vector2> dirs){
  Gdx.app.log("String_Node_Str","String_Node_Str");
  for (  Vector2 dir : dirs) {
    Vector2 hit=CastRay(this.position,this.position.add(dir.mul(MAX_RAY_LENGTH)));
  }
  float currentStep=0;
  int numberOfWays=0;
  Gdx.app.log("String_Node_Str",ri.distanceToHit + "String_Node_Str" + currentStep);
  int i=0;
  while (i > 100) {
    i++;
    currentStep+=stepLength;
    Gdx.app.log("String_Node_Str","String_Node_Str");
    for (    Vector2 dir : dirs) {
      if (doOneSideStep(dir,currentStep)) {
        numberOfWays++;
        Gdx.app.log("String_Node_Str","String_Node_Str");
        if (numberOfWays >= ALTERNATIVE_WAYS) {
          return true;
        }
      }
    }
  }
  if (numberOfWays >= 1) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean doSideSteps(ArrayList<Vector2> dirs){
  Gdx.app.log("String_Node_Str","String_Node_Str");
  for (  Vector2 dir : dirs) {
    Vector2 hit=CastRay(this.position,this.position.add(dir));
  }
  float currentStep=0;
  int numberOfWays=0;
  Gdx.app.log("String_Node_Str",ri.distanceToHit + "String_Node_Str" + currentStep);
  int i=0;
  while (i > 100) {
    i++;
    currentStep+=stepLength;
    Gdx.app.log("String_Node_Str","String_Node_Str");
    for (    Vector2 dir : dirs) {
      if (doOneSideStep(dir,currentStep)) {
        numberOfWays++;
        Gdx.app.log("String_Node_Str","String_Node_Str");
        if (numberOfWays >= ALTERNATIVE_WAYS) {
          return true;
        }
      }
    }
  }
  if (numberOfWays >= 1) {
    return true;
  }
 else {
    return false;
  }
}
Program: 154456
Project: 154456
Buggy source:
@Override public void create(){
  Gdx.app.log("String_Node_Str","String_Node_Str");
  camera=new PerspectiveCamera(67,500,300);
  meshObj=new MeshObject(0,0,10,10,10);
  rotate=0;
  Gdx.app.log("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public void create(){
  Gdx.app.log("String_Node_Str","String_Node_Str");
  camera=new PerspectiveCamera(67,500,300);
  meshObj=new MeshObject(0,0,10,10,10);
  CollisionHelper.collidable.add(meshObj);
  spawn=new Vector2(-100,0);
  target=new Vector2(100,5);
  rotate=0;
  gl=Gdx.graphics.getGL10();
  Gdx.app.log("String_Node_Str","String_Node_Str");
}
Program: 154457
Project: 154457
Buggy source:
@Override public void render(){
  GL10 gl=Gdx.graphics.getGL10();
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  camera.update();
  camera.apply(gl);
  gl.glPushMatrix();
  gl.glTranslatef(meshObj.getPosition().x,meshObj.getPosition().y,-40);
  gl.glRotatef(rotate,0,1,0);
  meshObj.getMesh().render(GL10.GL_TRIANGLE_STRIP);
  gl.glPopMatrix();
  rotate++;
}

Fixed version (ground truth):
@Override public void render(){
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  camera.update();
  camera.apply(gl);
  if (Gdx.input.justTouched()) {
    wp=new WayPoint(spawn,target,false);
    wp.CalculateNextPossibleWayPoints();
  }
  meshObj.render(gl);
  rotate++;
}
Program: 154458
Project: 154458
Buggy source:
public MeshObject(float x,float y,float width,float length,float height){
  mesh=new Mesh(false,8,14,new VertexAttribute(Usage.Position,3,"String_Node_Str"));
  mesh=generateBlock(mesh,width,length,height);
  this.position=new Vector2(x,y);
}

Fixed version (ground truth):
public MeshObject(float x,float y,float width,float length,float height){
  this.setRadius(width * 1.01f);
  mesh=new Mesh(false,8,14,new VertexAttribute(Usage.Position,3,"String_Node_Str"));
  mesh=generateBlock(mesh,width,length,height);
  this.position=new Vector2(x,y);
}
Program: 154459
Project: 154459
Buggy source:
public WayPoint(Vector2 position,WayPoint lastWp,WayPoint target,boolean isHitPoint){
}

Fixed version (ground truth):
public WayPoint(Vector2 position,Vector2 target,boolean isHitPoint){
  this.position=position;
  this.target=target;
  this.isHitPoint=isHitPoint;
  ri=new RayInfo();
  dirs=new ArrayList<Vector2>();
}
Program: 154460
Project: 154460
Buggy source:
private Vector2 CastRay(Vector2 start,Vector2 end){
  ri.start=start;
  ri.end=end;
  float oldDst=300;
  ri.calculateDir();
  for (  MeshObject mesh : collision) {
    if (oldDst > ri.distanceToHit && RayCastHelper.IntersectLineCircle(mesh.position,mesh.radius,ri)) {
      oldDst=ri.distanceToHit;
    }
  }
  ri.calculateHit(ri.distanceToHit);
  return ri.hit;
}

Fixed version (ground truth):
private Vector2 CastRay(Vector2 start,Vector2 end){
  ri.start=start;
  ri.end=end;
  float oldDst=MAX_RAY_LENGTH;
  ri.calculateDir();
  for (  MeshObject mesh : CollisionHelper.collidable) {
    if (oldDst > ri.distanceToHit && RayCastHelper.IntersectLineCircle(mesh.getPosition(),mesh.getRadius(),ri)) {
      oldDst=ri.distanceToHit;
      Gdx.app.log("String_Node_Str","String_Node_Str");
    }
  }
  ri.calculateHit(ri.distanceToHit);
  return ri.hit;
}
Program: 154461
Project: 154461
Buggy source:
public boolean CalculateNextPossibleWayPoints(){
  if (!this.isHitPoint) {
    return doForwardStep();
  }
 else {
    return doSideSteps(dirs);
  }
}

Fixed version (ground truth):
public boolean CalculateNextPossibleWayPoints(){
  if (!this.isHitPoint) {
    Gdx.app.log("String_Node_Str","String_Node_Str");
    return doForwardStep();
  }
 else {
    Gdx.app.log("String_Node_Str","String_Node_Str");
    dirs.add(new Vector2(0,1));
    dirs.add(new Vector2(0,-1));
    return doSideSteps(dirs);
  }
}
Program: 154462
Project: 154462
Buggy source:
private boolean doOneSideStep(Vector2 dir,float currentStep){
  WayPoint wp=new WayPoint(this.position.add(dir.mul(currentStep)),this,this.target,false);
  if (wp.CalculateNextPossibleWayPoints()) {
    this.possibleNextWaypoints.add(wp);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean doOneSideStep(Vector2 dir,float currentStep){
  WayPoint wp=new WayPoint(this.position.add(dir.mul(currentStep)),this.target,false);
  if (wp.CalculateNextPossibleWayPoints()) {
    this.possibleNextWaypoints.add(wp);
    return true;
  }
  return false;
}
Program: 154463
Project: 154463
Buggy source:
private boolean doForwardStep(){
  Vector2 hit=CastRay(this.position,target.position);
  if (hit == target.position) {
    return true;
  }
  WayPoint wp=new WayPoint(hit,this,this.target,true);
  if (wp.CalculateNextPossibleWayPoints()) {
    possibleNextWaypoints.add(wp);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean doForwardStep(){
  Vector2 hit=CastRay(this.position,target);
  if (hit == target) {
    Gdx.app.log("String_Node_Str","String_Node_Str");
    return true;
  }
  WayPoint wp=new WayPoint(hit,this.target,true);
  if (wp.CalculateNextPossibleWayPoints()) {
    possibleNextWaypoints.add(wp);
    return true;
  }
  Gdx.app.log("String_Node_Str","String_Node_Str");
  return false;
}