nus-yam/ex-repair huggingface dataset:
Program: 84007
Project: 84007
Buggy source:
private static Iterable<OProperty<?>> parseProperties(XMLEventReader2 reader,StartElement2 propertiesElement){
  List<OProperty<?>> rt=new ArrayList<OProperty<?>>();
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    if (event.isEndElement() && event.asEndElement().getName().equals(propertiesElement.getName())) {
      return rt;
    }
    if (event.isStartElement() && event.asStartElement().getName().getNamespaceURI().equals(NS_DATASERVICES)) {
      String name=event.asStartElement().getName().getLocalPart();
      Attribute2 typeAttribute=event.asStartElement().getAttributeByName(M_TYPE);
      Attribute2 nullAttribute=event.asStartElement().getAttributeByName(M_NULL);
      boolean isNull=nullAttribute != null && "String_Node_Str".equals(nullAttribute.getValue());
      OProperty<?> op=null;
      String type=null;
      boolean isComplexType=false;
      if (typeAttribute != null) {
        type=typeAttribute.getValue();
        EdmType et=EdmType.get(type);
        isComplexType=!et.isPrimitive();
      }
      if (isComplexType) {
        op=OProperties.complex(name,type,isNull ? null : Enumerable.create(parseProperties(reader,event.asStartElement())).toList());
      }
 else {
        op=OProperties.parse(name,type,isNull ? null : reader.getElementText());
      }
      rt.add(op);
    }
  }
  throw new RuntimeException();
}

Fixed version (ground truth):
public static Iterable<OProperty<?>> parseProperties(XMLEventReader2 reader,StartElement2 propertiesElement){
  List<OProperty<?>> rt=new ArrayList<OProperty<?>>();
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    if (event.isEndElement() && event.asEndElement().getName().equals(propertiesElement.getName())) {
      return rt;
    }
    if (event.isStartElement() && event.asStartElement().getName().getNamespaceURI().equals(NS_DATASERVICES)) {
      String name=event.asStartElement().getName().getLocalPart();
      Attribute2 typeAttribute=event.asStartElement().getAttributeByName(M_TYPE);
      Attribute2 nullAttribute=event.asStartElement().getAttributeByName(M_NULL);
      boolean isNull=nullAttribute != null && "String_Node_Str".equals(nullAttribute.getValue());
      OProperty<?> op=null;
      String type=null;
      boolean isComplexType=false;
      if (typeAttribute != null) {
        type=typeAttribute.getValue();
        EdmType et=EdmType.get(type);
        isComplexType=!et.isPrimitive();
      }
      if (isComplexType) {
        op=OProperties.complex(name,type,isNull ? null : Enumerable.create(parseProperties(reader,event.asStartElement())).toList());
      }
 else {
        op=OProperties.parse(name,type,isNull ? null : reader.getElementText());
      }
      rt.add(op);
    }
  }
  throw new RuntimeException();
}
Program: 84010
Project: 84010
Buggy source:
public static Object parseIdObject(String id){
  String cleanid=null;
  if (id != null && id.length() > 0) {
    if (id.startsWith("String_Node_Str") && id.endsWith("String_Node_Str")) {
      cleanid=id.substring(1,id.length() - 1);
    }
  }
  if (cleanid == null) {
    throw new RuntimeException("String_Node_Str");
  }
  Object idObject;
  if (cleanid.startsWith("String_Node_Str") && cleanid.endsWith("String_Node_Str")) {
    idObject=cleanid.substring(1,cleanid.length() - 1);
  }
 else {
    idObject=Integer.parseInt(cleanid);
  }
  return idObject;
}

Fixed version (ground truth):
public static Object parseIdObject(String id){
  String cleanid=null;
  if (id != null && id.length() > 0) {
    if (id.startsWith("String_Node_Str") && id.endsWith("String_Node_Str")) {
      cleanid=id.substring(1,id.length() - 1);
    }
  }
  if (cleanid == null) {
    throw new RuntimeException("String_Node_Str");
  }
  Object idObject;
  if (cleanid.startsWith("String_Node_Str") && cleanid.endsWith("String_Node_Str")) {
    idObject=cleanid.substring(1,cleanid.length() - 1);
  }
 else   if (cleanid.endsWith("String_Node_Str")) {
    idObject=Long.parseLong(cleanid.substring(0,cleanid.length() - 1));
  }
 else {
    idObject=Integer.parseInt(cleanid);
  }
  return idObject;
}
Program: 84011
Project: 84011
Buggy source:
private Object idObject(String id){
  String cleanid=null;
  if (id != null && id.length() > 0) {
    if (id.startsWith("String_Node_Str") && id.endsWith("String_Node_Str")) {
      cleanid=id.substring(1,id.length() - 1);
    }
  }
  if (cleanid == null)   throw new RuntimeException("String_Node_Str");
  Object idObject;
  if (cleanid.startsWith("String_Node_Str") && cleanid.endsWith("String_Node_Str")) {
    idObject=cleanid.substring(1,cleanid.length() - 1);
  }
 else {
    idObject=Integer.parseInt(cleanid);
  }
  return idObject;
}

Fixed version (ground truth):
private Object idObject(String id){
  String cleanid=null;
  if (id != null && id.length() > 0) {
    if (id.startsWith("String_Node_Str") && id.endsWith("String_Node_Str")) {
      cleanid=id.substring(1,id.length() - 1);
    }
  }
  if (cleanid == null)   throw new RuntimeException("String_Node_Str");
  Object idObject;
  if (cleanid.startsWith("String_Node_Str") && cleanid.endsWith("String_Node_Str")) {
    idObject=cleanid.substring(1,cleanid.length() - 1);
  }
 else   if (cleanid.endsWith("String_Node_Str")) {
    idObject=Long.parseLong(cleanid.substring(0,cleanid.length() - 1));
  }
 else {
    idObject=Integer.parseInt(cleanid);
  }
  return idObject;
}
Program: 84012
Project: 84012
Buggy source:
public void setAnswer(E answer){
  if (isValidAnswer(answer)) {
    this.answer=answer;
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void setAnswer(E answer){
}
Program: 84013
Project: 84013
Buggy source:
public void playCard(Player activePlayer,Supply supply,Card cardToPlay){
  if (!this.cardsInPlay.contains(cardToPlay)) {
    this.cardsInPlay.add(cardToPlay);
  }
  this.playedCards.add(cardToPlay);
  activePlayer.playCard(cardToPlay,this,supply);
}

Fixed version (ground truth):
public void playCard(Player activePlayer,Supply supply,Card cardToPlay){
  if (!this.cardsInPlay.contains(cardToPlay)) {
    if (!this.playedCards.contains(cardToPlay)) {
      this.cardsInPlay.add(cardToPlay);
    }
  }
  this.playedCards.add(cardToPlay);
  activePlayer.playCard(cardToPlay,this,supply);
}
Program: 84014
Project: 84014
Buggy source:
private List<Player> findWinners(){
  List<Player> winners=new ArrayList<Player>();
  int highestPoints=Integer.MIN_VALUE;
  for (  Player player : getPlayers()) {
    if (player.countVictoryPoints(null) > highestPoints) {
      winners=new ArrayList<Player>();
      winners.add(player);
      highestPoints=player.countVictoryPoints(null);
    }
 else     if (player.countVictoryPoints(null) == highestPoints) {
      if (player.getTurnCounter() < winners.get(0).getTurnCounter()) {
        winners=new ArrayList<Player>();
        winners.add(player);
      }
 else       if (player.getTurnCounter() == winners.get(0).getTurnCounter()) {
        winners.add(player);
      }
    }
  }
  return winners;
}

Fixed version (ground truth):
private List<Player> findWinners(){
  List<Player> winners=new ArrayList<Player>();
  int highestPoints=Integer.MIN_VALUE;
  for (  Player player : getPlayers()) {
    if (player.countVictoryPoints(null) > highestPoints) {
      winners.clear();
      winners.add(player);
      highestPoints=player.countVictoryPoints(null);
    }
 else     if (player.countVictoryPoints(null) == highestPoints) {
      if (player.getTurnCounter() < winners.get(0).getTurnCounter()) {
        winners.clear();
        winners.add(player);
      }
 else       if (player.getTurnCounter() == winners.get(0).getTurnCounter()) {
        winners.add(player);
      }
    }
  }
  return winners;
}
Program: 84015
Project: 84015
Buggy source:
private void updateCardImages(){
  for (int i=0; i < cardImages.size(); i++) {
    if (cardImages.get(i).getLongOverlayText() != revealedCards.get(i).getChoosenOption().getName()) {
      cardImages.get(i).setLongOverlayText(revealedCards.get(i).getChoosenOption().getName());
    }
  }
}

Fixed version (ground truth):
private void updateCardImages(){
  for (int i=0; i < cardImages.size(); i++) {
    if (!cardImages.get(i).getLongOverlayText().equals(revealedCards.get(i).getChoosenOption().getName())) {
      cardImages.get(i).setLongOverlayText(revealedCards.get(i).getChoosenOption().getName());
    }
  }
}
Program: 84016
Project: 84016
Buggy source:
@Override public void itemStateChanged(ItemEvent e){
  if (e.getSource() instanceof Checkbox) {
    Checkbox checkbox=(Checkbox)e.getSource();
    if (checkboxCardMapping.containsKey(checkbox)) {
      controller.cardChangedState(checkboxCardMapping.get(checkbox),checkbox.getState());
      return;
    }
  }
  new RuntimeException("String_Node_Str" + e.getSource());
}

Fixed version (ground truth):
@Override public void itemStateChanged(ItemEvent e){
  if (e.getSource() instanceof Checkbox) {
    Checkbox checkbox=(Checkbox)e.getSource();
    if (checkboxCardMapping.containsKey(checkbox)) {
      controller.cardChangedState(checkboxCardMapping.get(checkbox),checkbox.getState());
      return;
    }
  }
  throw new RuntimeException("String_Node_Str" + e.getSource());
}
Program: 84017
Project: 84017
Buggy source:
@Test public void eigenvalues(){
  double[][] mat1={{3,0,0},{1,3,1},{2,-1,1}};
  double[][] mat={{0,-1},{1,0}};
  ComplexNumber[] evs1=SquareMatrixOps.eigenvalues(new Matrix(mat1));
  ComplexNumber[] exp1={new ComplexNumber(3,0),new ComplexNumber(2,0),new ComplexNumber(2,0)};
  for (  ComplexNumber ev : evs1) {
    System.out.println("String_Node_Str");
    double[][] fuck={{0,0,0},{1,0,1},{2,-1,-2}};
    System.out.println("String_Node_Str" + SquareMatrixOps.determinant(new Matrix(fuck)));
    Matrix m=new Matrix(mat1);
    System.out.println(m.subtract(Pattern.diag(ev,m.rows())));
    System.out.println(SquareMatrixOps.determinant(m.subtract(Pattern.diag(ev,m.rows()))));
    assertTrue(SquareMatrixOps.determinant(m.subtract(Pattern.diag(ev,m.rows()))).isZero());
  }
  if (1 == 1)   return;
  double[][] mat2={{0,-1},{1,0}};
  ComplexNumber[] evs2=SquareMatrixOps.eigenvalues(new Matrix(mat2));
  Vector[] vecs=SquareMatrixOps.eigenvectors(new Matrix(mat1),evs1);
  double epsilon=ComplexNumber.getEpsilon();
  ComplexNumber.setEpsilon(1e-6);
  assertTrue(compareArrays(evs1,exp1));
  ComplexNumber.setEpsilon(epsilon);
}

Fixed version (ground truth):
@Test public void eigenvalues(){
  double[][] mat1={{3,0,0},{1,3,1},{2,-1,1}};
  double[][] mat={{0,-1},{1,0}};
  ComplexNumber[] evs1=SquareMatrixOps.eigenvalues(new Matrix(mat1));
  ComplexNumber[] exp1={new ComplexNumber(3,0),new ComplexNumber(2,0),new ComplexNumber(2,0)};
  for (  ComplexNumber ev : evs1) {
    Matrix m=new Matrix(mat1);
    assertTrue(SquareMatrixOps.determinant(m.subtract(Pattern.diag(ev,m.rows()))).isZero());
  }
  if (1 == 1)   return;
  double[][] mat2={{0,-1},{1,0}};
  ComplexNumber[] evs2=SquareMatrixOps.eigenvalues(new Matrix(mat2));
  Vector[] vecs=SquareMatrixOps.eigenvectors(new Matrix(mat1),evs1);
  double epsilon=ComplexNumber.getEpsilon();
  ComplexNumber.setEpsilon(1e-6);
  assertTrue(compareArrays(evs1,exp1));
  ComplexNumber.setEpsilon(epsilon);
}
Program: 84018
Project: 84018
Buggy source:
@Test public void det(){
  double[][] f={{1,2,3},{4,5,6},{7,8,7}};
  double[][] g={{1,2},{3,4}};
  double[][] h={{3,0,6,-3},{0,2,3,0},{-4,-7,2,0},{2,0,1,10}};
  ComplexNumber[][] i={{new ComplexNumber(2,1),new ComplexNumber(3,-1),new ComplexNumber(4,-3)},{new ComplexNumber(4,0),new ComplexNumber(6,-1),new ComplexNumber(2,5)},{new ComplexNumber(0,3),new ComplexNumber(2,-1),new ComplexNumber(1,3)}};
  Matrix m=new Matrix(f);
  Matrix t=new Matrix(g);
  Matrix u=new Matrix(h);
  Matrix z=new Matrix(i);
  assertTrue(SquareMatrixOps.determinant(m).equals(new ComplexNumber(6,0)));
  assertTrue(SquareMatrixOps.determinant(t).equals(new ComplexNumber(-2,0)));
  assertTrue(SquareMatrixOps.determinant(new Matrix(9)).equals(new ComplexNumber(1,0)));
  assertTrue(SquareMatrixOps.determinant(u).equals(new ComplexNumber(1404,0)));
  assertTrue(SquareMatrixOps.determinant(z).equals(new ComplexNumber(-118,-84)));
}

Fixed version (ground truth):
@Test public void det(){
  double[][] f={{1,2,3},{4,5,6},{7,8,7}};
  double[][] g={{1,2},{3,4}};
  double[][] h={{3,0,6,-3},{0,2,3,0},{-4,-7,2,0},{2,0,1,10}};
  double[][] sing_arr={{0,0,0},{1,0,1},{2,-1,-2}};
  ComplexNumber[][] i={{new ComplexNumber(2,1),new ComplexNumber(3,-1),new ComplexNumber(4,-3)},{new ComplexNumber(4,0),new ComplexNumber(6,-1),new ComplexNumber(2,5)},{new ComplexNumber(0,3),new ComplexNumber(2,-1),new ComplexNumber(1,3)}};
  Matrix m=new Matrix(f);
  Matrix t=new Matrix(g);
  Matrix u=new Matrix(h);
  Matrix z=new Matrix(i);
  Matrix singular=new Matrix(sing_arr);
  assertTrue(SquareMatrixOps.determinant(singular).isZero());
  assertTrue(SquareMatrixOps.determinant(m).equals(new ComplexNumber(6,0)));
  assertTrue(SquareMatrixOps.determinant(t).equals(new ComplexNumber(-2,0)));
  assertTrue(SquareMatrixOps.determinant(new Matrix(9)).equals(new ComplexNumber(1,0)));
  assertTrue(SquareMatrixOps.determinant(u).equals(new ComplexNumber(1404,0)));
  assertTrue(SquareMatrixOps.determinant(z).equals(new ComplexNumber(-118,-84)));
}
Program: 84019
Project: 84019
Buggy source:
@Test public void eigenvalues(){
  double[][] mat1={{3,0,0},{1,3,1},{2,-1,1}};
  ComplexNumber[] evs1=SquareMatrixOps.eigenvalues(new Matrix(mat1));
  ComplexNumber[] exp1={new ComplexNumber(3,0),new ComplexNumber(2,0),new ComplexNumber(2,0)};
  for (  ComplexNumber ev : evs1) {
    System.out.println(ev);
  }
  Vector[] vecs=SquareMatrixOps.eigenvectors(new Matrix(mat1),evs1);
  for (  Vector v : vecs) {
    System.out.println(v);
  }
  double epsilon=ComplexNumber.getEpsilon();
  ComplexNumber.setEpsilon(1e-6);
  assertTrue(compareArrays(evs1,exp1));
  ComplexNumber.setEpsilon(epsilon);
}

Fixed version (ground truth):
@Test public void eigenvalues(){
  double[][] mat1={{3,0,0},{1,3,1},{2,-1,1}};
  double[][] mat={{0,-1},{1,0}};
  ComplexNumber[] evs1=SquareMatrixOps.eigenvalues(new Matrix(mat1));
  ComplexNumber[] exp1={new ComplexNumber(3,0),new ComplexNumber(2,0),new ComplexNumber(2,0)};
  for (  ComplexNumber ev : evs1) {
    System.out.println("String_Node_Str");
    double[][] fuck={{0,0,0},{1,0,1},{2,-1,-2}};
    System.out.println("String_Node_Str" + SquareMatrixOps.determinant(new Matrix(fuck)));
    Matrix m=new Matrix(mat1);
    System.out.println(m.subtract(Pattern.diag(ev,m.rows())));
    System.out.println(SquareMatrixOps.determinant(m.subtract(Pattern.diag(ev,m.rows()))));
    assertTrue(SquareMatrixOps.determinant(m.subtract(Pattern.diag(ev,m.rows()))).isZero());
  }
  if (1 == 1)   return;
  double[][] mat2={{0,-1},{1,0}};
  ComplexNumber[] evs2=SquareMatrixOps.eigenvalues(new Matrix(mat2));
  Vector[] vecs=SquareMatrixOps.eigenvectors(new Matrix(mat1),evs1);
  double epsilon=ComplexNumber.getEpsilon();
  ComplexNumber.setEpsilon(1e-6);
  assertTrue(compareArrays(evs1,exp1));
  ComplexNumber.setEpsilon(epsilon);
}
Program: 84021
Project: 84021
Buggy source:
private void saveToTable(SearchNode n){
  if (transpositionTable.size() < TABLE_SIZE)   transpositionTable.put(n.gameState,n);
}

Fixed version (ground truth):
private void saveToTable(SearchNode n){
  if (transpositionTable.size() < TABLE_SIZE && n.depth >= 2) {
    transpositionTable.put(n.gameState,n);
  }
}
Program: 84022
Project: 84022
Buggy source:
private Action iterative_deepening(State root) throws InvalidActionException {
  ActionValuePair evenGuess=new ActionValuePair(null,0);
  ActionValuePair oddGuess=new ActionValuePair(null,0);
  SearchNode rootNode=new SearchNode();
  rootNode.gameState=root;
  rootNode.maxnode=this.maximizer;
  int d;
  for (d=1; d < this.maxdepth; d++) {
    rootNode.depth=d;
    try {
      if (d % 2 == 0)       evenGuess=MTD(rootNode,evenGuess,d);
 else       oddGuess=MTD(rootNode,oddGuess,d);
    }
 catch (    IllegalStateException ex) {
      break;
    }
    System.out.printf("String_Node_Str",0.001 * (System.currentTimeMillis() - startTimeMillis));
    System.out.print("String_Node_Str" + d + "String_Node_Str"+ (d % 2 == 0 ? evenGuess : oddGuess));
    System.out.println();
    if (times_up())     break;
  }
  String ps=saveSearchStatistics(d);
  System.out.print(ps);
  if (d % 2 == 0)   return evenGuess.action;
 else   return oddGuess.action;
}

Fixed version (ground truth):
private Action iterative_deepening(State root) throws InvalidActionException {
  ActionValuePair evenGuess=new ActionValuePair(null,0);
  ActionValuePair oddGuess=new ActionValuePair(null,0);
  SearchNode rootNode=new SearchNode();
  rootNode.gameState=root;
  rootNode.maxnode=this.maximizer;
  int d;
  boolean early_exit=false;
  for (d=1; d < this.maxdepth; d++) {
    rootNode.depth=d;
    try {
      if (d % 2 == 0)       evenGuess=MTD(rootNode,evenGuess,d);
 else       oddGuess=MTD(rootNode,oddGuess,d);
    }
 catch (    IllegalStateException ex) {
      early_exit=true;
      break;
    }
    System.out.printf("String_Node_Str",0.001 * (System.currentTimeMillis() - startTimeMillis));
    System.out.print("String_Node_Str" + d + "String_Node_Str"+ (d % 2 == 0 ? evenGuess : oddGuess));
    System.out.println();
    if (times_up()) {
      early_exit=true;
      break;
    }
  }
  String ps=saveSearchStatistics(d);
  System.out.print(ps);
  if (!early_exit) {
  }
 else {
    System.out.println("String_Node_Str" + d);
  }
  d--;
  Action move;
  if (d % 2 == 0)   move=evenGuess.action;
 else   move=oddGuess.action;
  System.out.println("String_Node_Str" + move);
  return move;
}
Program: 84024
Project: 84024
Buggy source:
@Override public Action decide(State state){
  leafNodes=0;
  checkedNodes=0;
  loopsHit=0;
  actionsChecked=0;
  cacheHits=0;
  startTimeMillis=System.currentTimeMillis();
  transpositionTable=new HashMap<State,SearchNode>(TABLE_SIZE);
  try {
    Action a=iterative_deepening(state);
    if (DEBUG)     GraphVizPrinter.setDecision(a.applyTo(state));
    if (DEBUG)     GraphVizPrinter.printGraphToFile();
    return a;
  }
 catch (  InvalidActionException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
@Override public Action decide(State state){
  leafNodes=0;
  checkedNodes=0;
  loopsHit=0;
  actionsChecked=0;
  cacheHits=0;
  startTimeMillis=System.currentTimeMillis();
  transpositionTable=new HashMap<State,SearchNode>(TABLE_SIZE);
  try {
    if (DEBUG)     GraphVizPrinter.setState(state);
    Action a=iterative_deepening(state);
    if (DEBUG)     GraphVizPrinter.setDecision(a.applyTo(state));
    if (DEBUG)     GraphVizPrinter.printGraphToFile();
    return a;
  }
 catch (  InvalidActionException e) {
    e.printStackTrace();
    return null;
  }
}
Program: 84025
Project: 84025
Buggy source:
private boolean times_up(){
  return (System.currentTimeMillis() - startTimeMillis) > searchTime;
}

Fixed version (ground truth):
private boolean times_up(){
  boolean timesUp=(System.currentTimeMillis() - startTimeMillis) > searchTime;
  return timesUp;
}
Program: 84026
Project: 84026
Buggy source:
private ActionValuePair MTD(SearchNode n,ActionValuePair firstGuess,int depth) throws InvalidActionException {
  ActionValuePair g=firstGuess;
  int f_plus=WIN;
  int f_minus=LOSE;
  do {
    int gamma;
    if (g.value == f_minus) {
      gamma=g.value + 1;
    }
 else {
      gamma=g.value;
    }
    g=MT(n,gamma,depth);
    if (g.value < gamma) {
      f_plus=g.value;
    }
 else {
      f_minus=g.value;
    }
  }
 while (f_plus != f_minus);
  return g;
}

Fixed version (ground truth):
private ActionValuePair MTD(SearchNode n,ActionValuePair firstGuess,int depth) throws InvalidActionException {
  ActionValuePair g=firstGuess;
  int f_plus=WIN;
  int f_minus=LOSE;
  int iter=0;
  do {
    int gamma;
    if (g.value == f_minus) {
      gamma=g.value + 1;
    }
 else {
      gamma=g.value;
    }
    g=MT(n,gamma,depth,iter);
    if (g.value < gamma) {
      f_plus=g.value;
    }
 else {
      f_minus=g.value;
    }
    iter++;
  }
 while (f_plus != f_minus);
  return g;
}
Program: 84028
Project: 84028
Buggy source:
/** 
 * Default constructor.
 * @param properties
 */
public SearchService(Properties properties){
  String host=properties.getProperty("String_Node_Str");
  if (host != null) {
    host=_host;
  }
  String port=properties.getProperty("String_Node_Str");
  if (port != null) {
    _port=Integer.parseInt(port);
  }
  _indexCommand=properties.getProperty("String_Node_Str");
  _configFile=properties.getProperty("String_Node_Str");
  if (_indexCommand == null || _configFile == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Default constructor.
 * @param properties
 */
public SearchService(Properties properties){
  String host=properties.getProperty("String_Node_Str");
  if (host == null) {
    host=_host;
  }
  String port=properties.getProperty("String_Node_Str");
  if (port == null) {
    _port=Integer.parseInt(port);
  }
  _indexCommand=properties.getProperty("String_Node_Str");
  _configFile=properties.getProperty("String_Node_Str");
  if (_indexCommand == null || _configFile == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 84029
Project: 84029
Buggy source:
/** 
 * Default constructor.
 * @param properties
 */
public SearchService(Properties properties){
  String host=properties.getProperty("String_Node_Str");
  if (host == null) {
    host=_host;
  }
  String port=properties.getProperty("String_Node_Str");
  if (port == null) {
    _port=Integer.parseInt(port);
  }
  _indexCommand=properties.getProperty("String_Node_Str");
  _configFile=properties.getProperty("String_Node_Str");
  if (_indexCommand == null || _configFile == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Default constructor.
 * @param properties
 */
public SearchService(Properties properties){
  String host=properties.getProperty("String_Node_Str");
  if (host != null) {
    _host=host;
  }
  String port=properties.getProperty("String_Node_Str");
  if (port != null) {
    _port=Integer.parseInt(port);
  }
  _indexCommand=properties.getProperty("String_Node_Str");
  _configFile=properties.getProperty("String_Node_Str");
  if (_indexCommand == null || _configFile == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 84031
Project: 84031
Buggy source:
private String docXml(Element parent){
  Element doc=parent.element("String_Node_Str");
  doc.content().removeAll(doc.elements("String_Node_Str"));
  String xml=doc.asXML();
  StringWriter w=new StringWriter();
  MarkupParser parser=new MarkupParser(new ConfluenceDialect());
  HtmlDocumentBuilder builder=new HtmlDocumentBuilder(w){
    @Override public void lineBreak(){
    }
  }
;
  builder.setEmitAsDocument(false);
  parser.setBuilder(builder);
  parser.parse(xml);
  return w.toString();
}

Fixed version (ground truth):
private String docXml(Element parent){
  Element doc=parent.element("String_Node_Str");
  doc.content().removeAll(doc.elements("String_Node_Str"));
  String xml=doc.getText();
  StringWriter w=new StringWriter();
  MarkupParser parser=new MarkupParser(new ConfluenceDialect());
  HtmlDocumentBuilder builder=new HtmlDocumentBuilder(w){
    @Override public void lineBreak(){
    }
  }
;
  builder.setEmitAsDocument(false);
  parser.setBuilder(builder);
  parser.parse(xml);
  return w.toString();
}
Program: 84032
Project: 84032
Buggy source:
public void mergeClips(Collection<SpriteClip> mergeClips){
  if (mergeClips == null) {
    return;
  }
  if (mergeClips.size() == 1) {
    SpriteClip selectedClip=mergeClips.iterator().next();
    Collection<SpriteClip> overlappingSprites=new HashSet();
    overlappingSprites.add(selectedClip);
    for (    SpriteClip currentClip : clips) {
      if (selectedClip != currentClip && currentClip.getBoundingBox().intersects(selectedClip.getBoundingBox())) {
        overlappingSprites.add(currentClip);
      }
    }
    if (overlappingSprites.size() >= 2) {
      clips.removeAll(overlappingSprites);
      SpriteClip newMergedClip=SpriteClip.makeMergedClip(overlappingSprites);
      clips.add(newMergedClip);
    }
  }
 else {
    clips.removeAll(mergeClips);
    SpriteClip newMergedClip=SpriteClip.makeMergedClip(mergeClips);
    clips.add(newMergedClip);
  }
}

Fixed version (ground truth):
public void mergeClips(Collection<SpriteClip> mergeClips){
  if (mergeClips == null || mergeClips.size() == 0) {
    return;
  }
  if (mergeClips.size() == 1) {
    SpriteClip selectedClip=mergeClips.iterator().next();
    Collection<SpriteClip> overlappingSprites=new HashSet();
    overlappingSprites.add(selectedClip);
    for (    SpriteClip currentClip : clips) {
      if (selectedClip != currentClip && currentClip.getBoundingBox().intersects(selectedClip.getBoundingBox())) {
        overlappingSprites.add(currentClip);
      }
    }
    if (overlappingSprites.size() >= 2) {
      clips.removeAll(overlappingSprites);
      SpriteClip newMergedClip=SpriteClip.makeMergedClip(overlappingSprites);
      clips.add(newMergedClip);
    }
  }
 else {
    clips.removeAll(mergeClips);
    SpriteClip newMergedClip=SpriteClip.makeMergedClip(mergeClips);
    clips.add(newMergedClip);
  }
}
Program: 84033
Project: 84033
Buggy source:
@Override public boolean isSystemView(String catalogName,String schemaName,String viewName){
  return super.isSystemView(catalogName,schemaName,viewName) || schemaName.equals("String_Node_Str") || schemaName.equals("String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean isSystemView(String catalogName,String schemaName,String viewName){
  return super.isSystemView(catalogName,schemaName,viewName) || schemaName.equals("String_Node_Str") || viewName.toLowerCase().equals("String_Node_Str");
}
Program: 84034
Project: 84034
Buggy source:
@Override public boolean isSystemTable(String catalogName,String schemaName,String tableName){
  return super.isSystemTable(catalogName,schemaName,tableName) || schemaName.equals("String_Node_Str") || schemaName.equals("String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean isSystemTable(String catalogName,String schemaName,String tableName){
  return super.isSystemTable(catalogName,schemaName,tableName) || schemaName.equals("String_Node_Str") || tableName.toLowerCase().startsWith("String_Node_Str");
}
Program: 84035
Project: 84035
Buggy source:
/** 
 * Return singleton SqlGeneratorFactory
 */
public static ChangeFactory getInstance(){
  if (instance == null) {
    instance=new ChangeFactory();
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Return singleton SqlGeneratorFactory
 */
public static synchronized ChangeFactory getInstance(){
  if (instance == null) {
    instance=new ChangeFactory();
  }
  return instance;
}
Program: 84036
Project: 84036
Buggy source:
public ColumnConfig setValueDate(String valueDate){
  if (valueDate == null || valueDate.equalsIgnoreCase("String_Node_Str")) {
    this.valueDate=null;
  }
  try {
    this.valueDate=new ISODateFormat().parse(valueDate);
  }
 catch (  ParseException e) {
    this.valueComputed=new DatabaseFunction(valueDate);
  }
  return this;
}

Fixed version (ground truth):
public ColumnConfig setValueDate(String valueDate){
  if (valueDate == null || valueDate.equalsIgnoreCase("String_Node_Str")) {
    this.valueDate=null;
  }
 else {
    try {
      this.valueDate=new ISODateFormat().parse(valueDate);
    }
 catch (    ParseException e) {
      this.valueComputed=new DatabaseFunction(valueDate);
    }
  }
  return this;
}
Program: 84038
Project: 84038
Buggy source:
protected void readTables(DatabaseSnapshot snapshot,String schema,DatabaseMetaData databaseMetaData) throws SQLException, DatabaseException {
  Database database=snapshot.getDatabase();
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  ResultSet rs=databaseMetaData.getTables(database.convertRequestedSchemaToCatalog(schema),database.convertRequestedSchemaToSchema(schema),null,new String[]{"String_Node_Str","String_Node_Str"});
  try {
    while (rs.next()) {
      Table table=readTable(rs,database);
      table.setSchema(schema);
      if (database.isLiquibaseTable(table.getName())) {
        if (table.getName().equalsIgnoreCase(database.getDatabaseChangeLogTableName())) {
          snapshot.setDatabaseChangeLogTable(table);
          continue;
        }
        if (table.getName().equalsIgnoreCase(database.getDatabaseChangeLogLockTableName())) {
          snapshot.setDatabaseChangeLogLockTable(table);
          continue;
        }
      }
      if (database.isSystemTable(table.getRawCatalogName(),table.getRawSchemaName(),table.getName()) || database.isSystemView(table.getRawCatalogName(),table.getRawSchemaName(),table.getName())) {
        continue;
      }
      snapshot.getTables().add(table);
    }
  }
  finally {
    rs.close();
  }
}

Fixed version (ground truth):
protected void readTables(DatabaseSnapshot snapshot,String schema,DatabaseMetaData databaseMetaData) throws SQLException, DatabaseException {
  Database database=snapshot.getDatabase();
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  ResultSet rs=databaseMetaData.getTables(database.convertRequestedSchemaToCatalog(schema),database.convertRequestedSchemaToSchema(schema),null,new String[]{"String_Node_Str","String_Node_Str"});
  try {
    while (rs.next()) {
      Table table=readTable(rs,database);
      table.setSchema(schema);
      if (database.isLiquibaseTable(table.getName())) {
        if (table.getName().equalsIgnoreCase(database.getDatabaseChangeLogTableName())) {
          snapshot.setDatabaseChangeLogTable(table);
          continue;
        }
        if (table.getName().equalsIgnoreCase(database.getDatabaseChangeLogLockTableName())) {
          snapshot.setDatabaseChangeLogLockTable(table);
          continue;
        }
      }
      if (database.isSystemTable(table.getRawCatalogName(),table.getRawSchemaName(),table.getName()) || database.isSystemView(table.getRawCatalogName(),table.getRawSchemaName(),table.getName())) {
        continue;
      }
      snapshot.getTables().add(table);
    }
  }
  finally {
    try {
      rs.close();
    }
 catch (    SQLException ignore) {
    }
  }
}
Program: 84040
Project: 84040
Buggy source:
protected void readPrimaryKeys(DatabaseSnapshot snapshot,String schema,DatabaseMetaData databaseMetaData) throws DatabaseException, SQLException {
  Database database=snapshot.getDatabase();
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  List<PrimaryKey> foundPKs=new ArrayList<PrimaryKey>();
  for (  Table table : snapshot.getTables()) {
    ResultSet rs=databaseMetaData.getPrimaryKeys(database.convertRequestedSchemaToCatalog(schema),database.convertRequestedSchemaToSchema(schema),table.getName());
    while (rs.next()) {
      String tableName=convertFromDatabaseName(rs.getString("String_Node_Str"));
      String columnName=convertFromDatabaseName(rs.getString("String_Node_Str"));
      short position=rs.getShort("String_Node_Str");
      boolean foundExistingPK=false;
      for (      PrimaryKey pk : foundPKs) {
        if (pk.getTable().getName().equals(tableName)) {
          pk.addColumnName(position - 1,columnName);
          foundExistingPK=true;
        }
      }
      if (!foundExistingPK) {
        PrimaryKey primaryKey=new PrimaryKey();
        primaryKey.setTable(table);
        primaryKey.addColumnName(position - 1,columnName);
        primaryKey.setName(convertPrimaryKeyName(rs.getString("String_Node_Str")));
        foundPKs.add(primaryKey);
      }
    }
    rs.close();
  }
  snapshot.getPrimaryKeys().addAll(foundPKs);
}

Fixed version (ground truth):
protected void readPrimaryKeys(DatabaseSnapshot snapshot,String schema,DatabaseMetaData databaseMetaData) throws DatabaseException, SQLException {
  Database database=snapshot.getDatabase();
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  List<PrimaryKey> foundPKs=new ArrayList<PrimaryKey>();
  for (  Table table : snapshot.getTables()) {
    ResultSet rs=databaseMetaData.getPrimaryKeys(database.convertRequestedSchemaToCatalog(schema),database.convertRequestedSchemaToSchema(schema),table.getName());
    try {
      while (rs.next()) {
        String tableName=convertFromDatabaseName(rs.getString("String_Node_Str"));
        String columnName=convertFromDatabaseName(rs.getString("String_Node_Str"));
        short position=rs.getShort("String_Node_Str");
        boolean foundExistingPK=false;
        for (        PrimaryKey pk : foundPKs) {
          if (pk.getTable().getName().equals(tableName)) {
            pk.addColumnName(position - 1,columnName);
            foundExistingPK=true;
          }
        }
        if (!foundExistingPK) {
          PrimaryKey primaryKey=new PrimaryKey();
          primaryKey.setTable(table);
          primaryKey.addColumnName(position - 1,columnName);
          primaryKey.setName(convertPrimaryKeyName(rs.getString("String_Node_Str")));
          foundPKs.add(primaryKey);
        }
      }
    }
  finally {
      rs.close();
    }
  }
  snapshot.getPrimaryKeys().addAll(foundPKs);
}
Program: 84041
Project: 84041
Buggy source:
public boolean hasTable(String schemaName,String tableName,Database database){
  try {
    ResultSet rs=getMetaData(database).getTables(database.convertRequestedSchemaToCatalog(schemaName),database.convertRequestedSchemaToSchema(schemaName),convertTableNameToDatabaseTableName(tableName),new String[]{"String_Node_Str"});
    try {
      return rs.next();
    }
  finally {
      rs.close();
    }
  }
 catch (  Exception e) {
    throw new UnexpectedLiquibaseException(e);
  }
}

Fixed version (ground truth):
public boolean hasTable(String schemaName,String tableName,Database database){
  try {
    ResultSet rs=getMetaData(database).getTables(database.convertRequestedSchemaToCatalog(schemaName),database.convertRequestedSchemaToSchema(schemaName),convertTableNameToDatabaseTableName(tableName),new String[]{"String_Node_Str"});
    try {
      return rs.next();
    }
  finally {
      try {
        rs.close();
      }
 catch (      SQLException ignore) {
      }
    }
  }
 catch (  Exception e) {
    throw new UnexpectedLiquibaseException(e);
  }
}
Program: 84042
Project: 84042
Buggy source:
public Column getColumn(String schemaName,String tableName,String columnName,Database database) throws DatabaseException {
  ResultSet rs=null;
  try {
    rs=getMetaData(database).getColumns(database.convertRequestedSchemaToCatalog(schemaName),database.convertRequestedSchemaToSchema(schemaName),convertTableNameToDatabaseTableName(tableName),convertColumnNameToDatabaseTableName(columnName));
    if (!rs.next()) {
      return null;
    }
    return readColumn(rs,database);
  }
 catch (  Exception e) {
    throw new DatabaseException(e);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
  }
}

Fixed version (ground truth):
public Column getColumn(String schemaName,String tableName,String columnName,Database database) throws DatabaseException {
  ResultSet rs=null;
  try {
    rs=getMetaData(database).getColumns(database.convertRequestedSchemaToCatalog(schemaName),database.convertRequestedSchemaToSchema(schemaName),convertTableNameToDatabaseTableName(tableName),convertColumnNameToDatabaseTableName(columnName));
    if (!rs.next()) {
      return null;
    }
    return readColumn(rs,database);
  }
 catch (  Exception e) {
    throw new DatabaseException(e);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException ignore) {
      }
    }
  }
}
Program: 84043
Project: 84043
Buggy source:
public boolean isColumnAutoIncrement(Database database,String schemaName,String tableName,String columnName) throws SQLException, DatabaseException {
  if (!database.supportsAutoIncrement()) {
    return false;
  }
  boolean autoIncrement=false;
  Statement statement=null;
  ResultSet selectRS=null;
  try {
    statement=((JdbcConnection)database.getConnection()).getUnderlyingConnection().createStatement();
    selectRS=statement.executeQuery("String_Node_Str" + database.escapeColumnName(schemaName,tableName,columnName) + "String_Node_Str"+ database.escapeTableName(schemaName,tableName)+ "String_Node_Str");
    ResultSetMetaData meta=selectRS.getMetaData();
    autoIncrement=meta.isAutoIncrement(1);
  }
  finally {
    if (selectRS != null) {
      selectRS.close();
    }
    if (statement != null) {
      statement.close();
    }
  }
  return autoIncrement;
}

Fixed version (ground truth):
public boolean isColumnAutoIncrement(Database database,String schemaName,String tableName,String columnName) throws SQLException, DatabaseException {
  if (!database.supportsAutoIncrement()) {
    return false;
  }
  boolean autoIncrement=false;
  Statement statement=null;
  ResultSet selectRS=null;
  try {
    statement=((JdbcConnection)database.getConnection()).getUnderlyingConnection().createStatement();
    selectRS=statement.executeQuery("String_Node_Str" + database.escapeColumnName(schemaName,tableName,columnName) + "String_Node_Str"+ database.escapeTableName(schemaName,tableName)+ "String_Node_Str");
    ResultSetMetaData meta=selectRS.getMetaData();
    autoIncrement=meta.isAutoIncrement(1);
  }
  finally {
    if (selectRS != null) {
      try {
        selectRS.close();
      }
 catch (      SQLException ignored) {
      }
    }
    if (statement != null) {
      try {
        statement.close();
      }
 catch (      SQLException ignored) {
      }
    }
  }
  return autoIncrement;
}
Program: 84044
Project: 84044
Buggy source:
protected void readViews(DatabaseSnapshot snapshot,String schema,DatabaseMetaData databaseMetaData) throws SQLException, DatabaseException {
  Database database=snapshot.getDatabase();
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  ResultSet rs=databaseMetaData.getTables(database.convertRequestedSchemaToCatalog(schema),database.convertRequestedSchemaToSchema(schema),null,new String[]{"String_Node_Str"});
  try {
    while (rs.next()) {
      View view=readView(rs,database);
      if (database.isSystemView(view.getRawCatalogName(),view.getRawSchemaName(),view.getName())) {
        continue;
      }
      snapshot.getViews().add(view);
    }
  }
  finally {
    rs.close();
  }
}

Fixed version (ground truth):
protected void readViews(DatabaseSnapshot snapshot,String schema,DatabaseMetaData databaseMetaData) throws SQLException, DatabaseException {
  Database database=snapshot.getDatabase();
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  ResultSet rs=databaseMetaData.getTables(database.convertRequestedSchemaToCatalog(schema),database.convertRequestedSchemaToSchema(schema),null,new String[]{"String_Node_Str"});
  try {
    while (rs.next()) {
      View view=readView(rs,database);
      if (database.isSystemView(view.getRawCatalogName(),view.getRawSchemaName(),view.getName())) {
        continue;
      }
      snapshot.getViews().add(view);
    }
  }
  finally {
    try {
      rs.close();
    }
 catch (    SQLException ignore) {
    }
  }
}
Program: 84046
Project: 84046
Buggy source:
public List<ForeignKey> getForeignKeys(String schemaName,String foreignKeyTableName,Database database) throws DatabaseException {
  List<ForeignKey> fkList=new ArrayList<ForeignKey>();
  try {
    String dbCatalog=database.convertRequestedSchemaToCatalog(schemaName);
    String dbSchema=database.convertRequestedSchemaToSchema(schemaName);
    ResultSet rs=getMetaData(database).getImportedKeys(dbCatalog,dbSchema,convertTableNameToDatabaseTableName(foreignKeyTableName));
    while (rs.next()) {
      ForeignKeyInfo fkInfo=fillForeignKeyInfo(rs);
      fkList.add(generateForeignKey(fkInfo,database,fkList));
    }
    rs.close();
    return fkList;
  }
 catch (  Exception e) {
    throw new DatabaseException(e);
  }
}

Fixed version (ground truth):
public List<ForeignKey> getForeignKeys(String schemaName,String foreignKeyTableName,Database database) throws DatabaseException {
  List<ForeignKey> fkList=new ArrayList<ForeignKey>();
  try {
    String dbCatalog=database.convertRequestedSchemaToCatalog(schemaName);
    String dbSchema=database.convertRequestedSchemaToSchema(schemaName);
    ResultSet rs=getMetaData(database).getImportedKeys(dbCatalog,dbSchema,convertTableNameToDatabaseTableName(foreignKeyTableName));
    try {
      while (rs.next()) {
        ForeignKeyInfo fkInfo=fillForeignKeyInfo(rs);
        fkList.add(generateForeignKey(fkInfo,database,fkList));
      }
    }
  finally {
      rs.close();
    }
    return fkList;
  }
 catch (  Exception e) {
    throw new DatabaseException(e);
  }
}
Program: 84047
Project: 84047
Buggy source:
public Table getTable(String schemaName,String tableName,Database database) throws DatabaseException {
  ResultSet rs=null;
  try {
    DatabaseMetaData metaData=getMetaData(database);
    rs=metaData.getTables(database.convertRequestedSchemaToCatalog(schemaName),database.convertRequestedSchemaToSchema(schemaName),convertTableNameToDatabaseTableName(tableName),new String[]{"String_Node_Str"});
    if (!rs.next()) {
      return null;
    }
    Table table=readTable(rs,database);
    rs.close();
    rs=metaData.getColumns(database.convertRequestedSchemaToCatalog(schemaName),database.convertRequestedSchemaToSchema(schemaName),convertTableNameToDatabaseTableName(tableName),null);
    while (rs.next()) {
      table.getColumns().add(readColumn(rs,database));
    }
    return table;
  }
 catch (  Exception e) {
    throw new DatabaseException(e);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
  }
}

Fixed version (ground truth):
public Table getTable(String schemaName,String tableName,Database database) throws DatabaseException {
  ResultSet rs=null;
  try {
    DatabaseMetaData metaData=getMetaData(database);
    rs=metaData.getTables(database.convertRequestedSchemaToCatalog(schemaName),database.convertRequestedSchemaToSchema(schemaName),convertTableNameToDatabaseTableName(tableName),new String[]{"String_Node_Str"});
    Table table;
    try {
      if (!rs.next()) {
        return null;
      }
      table=readTable(rs,database);
    }
  finally {
      rs.close();
    }
    rs=metaData.getColumns(database.convertRequestedSchemaToCatalog(schemaName),database.convertRequestedSchemaToSchema(schemaName),convertTableNameToDatabaseTableName(tableName),null);
    try {
      while (rs.next()) {
        table.getColumns().add(readColumn(rs,database));
      }
    }
  finally {
      rs.close();
    }
    return table;
  }
 catch (  Exception e) {
    throw new DatabaseException(e);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException ignore) {
      }
    }
  }
}
Program: 84049
Project: 84049
Buggy source:
protected boolean handleIncludedChangeLog(String fileName,boolean isRelativePath,String relativeBaseFileName) throws LiquibaseException {
  if (!(fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str"))) {
    log.debug(relativeBaseFileName + "String_Node_Str" + fileName+ "String_Node_Str");
    return false;
  }
  if (fileName.equalsIgnoreCase("String_Node_Str") || fileName.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  if (isRelativePath) {
    fileName=FilenameUtils.concat(FilenameUtils.getFullPath(relativeBaseFileName),fileName);
  }
  DatabaseChangeLog changeLog=ChangeLogParserFactory.getInstance().getParser(fileName,resourceAccessor).parse(fileName,changeLogParameters,resourceAccessor);
  PreconditionContainer preconditions=changeLog.getPreconditions();
  if (preconditions != null) {
    if (null == databaseChangeLog.getPreconditions()) {
      databaseChangeLog.setPreconditions(new PreconditionContainer());
    }
    databaseChangeLog.getPreconditions().addNestedPrecondition(preconditions);
  }
  for (  ChangeSet changeSet : changeLog.getChangeSets()) {
    databaseChangeLog.addChangeSet(changeSet);
  }
  return true;
}

Fixed version (ground truth):
protected boolean handleIncludedChangeLog(String fileName,boolean isRelativePath,String relativeBaseFileName) throws LiquibaseException {
  if (!(fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str"))) {
    log.debug(relativeBaseFileName + "String_Node_Str" + fileName+ "String_Node_Str");
    return false;
  }
  if (fileName.equalsIgnoreCase("String_Node_Str") || fileName.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  if (isRelativePath) {
    String tempFile=FilenameUtils.concat(FilenameUtils.getFullPath(relativeBaseFileName),fileName);
    if (tempFile != null && new File(tempFile).exists() == true) {
      fileName=tempFile;
    }
 else {
      fileName=FilenameUtils.getFullPath(relativeBaseFileName) + fileName;
    }
  }
  DatabaseChangeLog changeLog=ChangeLogParserFactory.getInstance().getParser(fileName,resourceAccessor).parse(fileName,changeLogParameters,resourceAccessor);
  PreconditionContainer preconditions=changeLog.getPreconditions();
  if (preconditions != null) {
    if (null == databaseChangeLog.getPreconditions()) {
      databaseChangeLog.setPreconditions(new PreconditionContainer());
    }
    databaseChangeLog.getPreconditions().addNestedPrecondition(preconditions);
  }
  for (  ChangeSet changeSet : changeLog.getChangeSets()) {
    databaseChangeLog.addChangeSet(changeSet);
  }
  return true;
}
Program: 84050
Project: 84050
Buggy source:
public ChangeLogIterator(List<RanChangeSet> changeSetList,DatabaseChangeLog changeLog,ChangeSetFilter... changeSetFilters){
  final List<ChangeSet> changeSets=new ArrayList<ChangeSet>();
  for (  RanChangeSet ranChangeSet : changeSetList) {
    changeSets.add(changeLog.getChangeSet(ranChangeSet));
  }
  this.databaseChangeLog=(new DatabaseChangeLog(null){
    @Override public List<ChangeSet> getChangeSets(){
      return changeSets;
    }
  }
);
  this.changeSetFilters=Arrays.asList(changeSetFilters);
}

Fixed version (ground truth):
public ChangeLogIterator(List<RanChangeSet> changeSetList,DatabaseChangeLog changeLog,ChangeSetFilter... changeSetFilters){
  final List<ChangeSet> changeSets=new ArrayList<ChangeSet>();
  for (  RanChangeSet ranChangeSet : changeSetList) {
    ChangeSet changeSet=changeLog.getChangeSet(ranChangeSet);
    if (changeSet != null) {
      changeSets.add(changeSet);
    }
  }
  this.databaseChangeLog=(new DatabaseChangeLog(null){
    @Override public List<ChangeSet> getChangeSets(){
      return changeSets;
    }
  }
);
  this.changeSetFilters=Arrays.asList(changeSetFilters);
}
Program: 84051
Project: 84051
Buggy source:
private void checkViews(DiffResult diffResult){
  for (  View baseView : referenceSnapshot.getViews()) {
    if (!targetSnapshot.getViews().contains(baseView)) {
      diffResult.addMissingView(baseView);
    }
 else {
      for (      View targetView : targetSnapshot.getViews()) {
        if (targetView.getName().equals(baseView.getName())) {
          if (!targetView.getDefinition().equals(baseView.getDefinition())) {
            diffResult.addChangedView(targetView);
          }
        }
      }
    }
  }
  for (  View targetView : targetSnapshot.getViews()) {
    if (!referenceSnapshot.getViews().contains(targetView)) {
      diffResult.addUnexpectedView(targetView);
    }
 else {
      for (      View referenceView : referenceSnapshot.getViews()) {
        if (referenceView.getName().equals(targetView.getName())) {
          if (!referenceView.getDefinition().equals(targetView.getDefinition())) {
            diffResult.addChangedView(referenceView);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void checkViews(DiffResult diffResult){
  for (  View baseView : referenceSnapshot.getViews()) {
    if (!targetSnapshot.getViews().contains(baseView)) {
      diffResult.addMissingView(baseView);
    }
  }
  for (  View targetView : targetSnapshot.getViews()) {
    if (!referenceSnapshot.getViews().contains(targetView)) {
      diffResult.addUnexpectedView(targetView);
    }
 else {
      for (      View referenceView : referenceSnapshot.getViews()) {
        if (referenceView.getName().equals(targetView.getName())) {
          if (!referenceView.getDefinition().equals(targetView.getDefinition())) {
            diffResult.addChangedView(referenceView);
          }
        }
      }
    }
  }
}