nus-yam/ex-repair huggingface dataset:
Program: 86718
Project: 86718
Buggy source:
@Override public void updateSchema(DataAccess data) throws DatabaseWriteException {
  File file=new File("String_Node_Str" + data.getName() + "String_Node_Str");
  if (!file.exists()) {
    try {
      file.createNewFile();
      initFile(file,data.getName());
    }
 catch (    IOException e) {
      throw new DatabaseWriteException(e.getMessage());
    }
  }
  try {
    Document table=fileBuilder.build(file);
    HashSet<Column> tableLayout=data.getTableLayout();
    for (    Element element : table.getRootElement().getChildren()) {
      addFields(element,tableLayout);
      removeFields(element,tableLayout);
    }
    file.setWritable(true);
    FileWriter writer=new FileWriter(file);
    xmlSerializer.output(table,writer);
    writer.close();
  }
 catch (  JDOMException e) {
    throw new DatabaseWriteException(e.getMessage());
  }
catch (  IOException e) {
    throw new DatabaseWriteException(e.getMessage());
  }
catch (  DatabaseTableInconsistencyException e) {
    throw new DatabaseWriteException(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void updateSchema(DataAccess data) throws DatabaseWriteException {
  File file=new File("String_Node_Str" + data.getName() + "String_Node_Str");
  if (!file.exists()) {
    try {
      file.createNewFile();
      initFile(file,data.getName());
    }
 catch (    IOException e) {
      throw new DatabaseWriteException(e.getMessage());
    }
  }
  try {
    Document table=fileBuilder.build(file);
    HashSet<Column> tableLayout=data.getTableLayout();
    for (    Element element : table.getRootElement().getChildren()) {
      addFields(element,tableLayout);
      removeFields(element,tableLayout);
    }
    file.setWritable(true);
    FileWriter writer=new FileWriter(file);
    RandomAccessFile f=new RandomAccessFile(file,"String_Node_Str");
    f.getChannel().lock();
    OutputStream out=new FileOutputStream(f.getFD());
    xmlSerializer.output(table,out);
    writer.close();
    f.close();
  }
 catch (  JDOMException e) {
    throw new DatabaseWriteException(e.getMessage());
  }
catch (  IOException e) {
    throw new DatabaseWriteException(e.getMessage());
  }
catch (  DatabaseTableInconsistencyException e) {
    throw new DatabaseWriteException(e.getMessage());
  }
}
Program: 86719
Project: 86719
Buggy source:
/** 
 * Inserts data into the XML file. This does NOT update data. It will create a new entry if there isn't the exact same already present
 * @param file
 * @param data
 * @param dbTable
 * @throws IOException
 * @throws DatabaseTableInconsistencyException
 */
private void insertData(File file,DataAccess data,Document dbTable) throws IOException, DatabaseTableInconsistencyException {
  HashMap<Column,Object> entry=data.toDatabaseEntryList();
  if (data.isInconsistent()) {
    throw new DatabaseTableInconsistencyException("String_Node_Str");
  }
  Element set=new Element("String_Node_Str");
  for (  Column column : entry.keySet()) {
    Element col=new Element(column.columnName());
    col.setAttribute("String_Node_Str",String.valueOf(column.autoIncrement()));
    col.setAttribute("String_Node_Str",column.dataType().name());
    col.setAttribute("String_Node_Str",column.columnType().name());
    col.setAttribute("String_Node_Str",String.valueOf(column.isList()));
    addToElement(dbTable,col,entry.get(column),column);
    set.addContent(col);
    boolean foundDupe=false;
    for (    Element c : dbTable.getRootElement().getChildren()) {
      if (elementEquals(set,c)) {
        foundDupe=true;
      }
    }
    if (!foundDupe) {
    }
  }
  dbTable.getRootElement().addContent(set);
  FileWriter writer=new FileWriter(file);
  file.setWritable(true);
  xmlSerializer.output(dbTable,writer);
  writer.close();
}

Fixed version (ground truth):
/** 
 * Inserts data into the XML file. This does NOT update data. It will create a new entry if there isn't the exact same already present
 * @param file
 * @param data
 * @param dbTable
 * @throws IOException
 * @throws DatabaseTableInconsistencyException
 */
private void insertData(File file,DataAccess data,Document dbTable) throws IOException, DatabaseTableInconsistencyException {
  HashMap<Column,Object> entry=data.toDatabaseEntryList();
  if (data.isInconsistent()) {
    throw new DatabaseTableInconsistencyException("String_Node_Str");
  }
  Element set=new Element("String_Node_Str");
  for (  Column column : entry.keySet()) {
    Element col=new Element(column.columnName());
    col.setAttribute("String_Node_Str",String.valueOf(column.autoIncrement()));
    col.setAttribute("String_Node_Str",column.dataType().name());
    col.setAttribute("String_Node_Str",column.columnType().name());
    col.setAttribute("String_Node_Str",String.valueOf(column.isList()));
    addToElement(dbTable,col,entry.get(column),column);
    set.addContent(col);
    boolean foundDupe=false;
    for (    Element c : dbTable.getRootElement().getChildren()) {
      if (elementEquals(set,c)) {
        foundDupe=true;
      }
    }
    if (!foundDupe) {
    }
  }
  dbTable.getRootElement().addContent(set);
  file.setWritable(true);
  FileWriter writer=new FileWriter(file);
  RandomAccessFile f=new RandomAccessFile(file,"String_Node_Str");
  f.getChannel().lock();
  OutputStream out=new FileOutputStream(f.getFD());
  xmlSerializer.output(dbTable,out);
  writer.close();
  f.close();
}
Program: 86720
Project: 86720
Buggy source:
private void initFile(File file,String rootName) throws IOException {
  Document doc=new Document();
  doc.setRootElement(new Element(rootName));
  file.setWritable(true);
  FileWriter writer=new FileWriter(file);
  xmlSerializer.output(doc,writer);
  writer.close();
}

Fixed version (ground truth):
private void initFile(File file,String rootName) throws IOException {
  Document doc=new Document();
  doc.setRootElement(new Element(rootName));
  file.setWritable(true);
  FileWriter writer=new FileWriter(file);
  RandomAccessFile f=new RandomAccessFile(file,"String_Node_Str");
  f.getChannel().lock();
  OutputStream out=new FileOutputStream(f.getFD());
  xmlSerializer.output(doc,out);
  writer.close();
  f.close();
}
Program: 86721
Project: 86721
Buggy source:
private void removeData(File file,Document table,String[] fields,Object[] values) throws IOException, DatabaseTableInconsistencyException {
  for (  Element element : table.getRootElement().getChildren()) {
    int equalFields=0;
    for (int i=0; i < fields.length; ++i) {
      Element child=element.getChild(fields[i]);
      if (child != null) {
        if (child.getText().equals(String.valueOf(values[i]))) {
          equalFields++;
        }
      }
    }
    if (equalFields != fields.length) {
      continue;
    }
    element.detach();
  }
  FileWriter writer=new FileWriter(file);
  file.setWritable(true);
  xmlSerializer.output(table,writer);
  writer.close();
}

Fixed version (ground truth):
private void removeData(File file,Document table,String[] fields,Object[] values) throws IOException, DatabaseTableInconsistencyException {
  for (  Element element : table.getRootElement().getChildren()) {
    int equalFields=0;
    for (int i=0; i < fields.length; ++i) {
      Element child=element.getChild(fields[i]);
      if (child != null) {
        if (child.getText().equals(String.valueOf(values[i]))) {
          equalFields++;
        }
      }
    }
    if (equalFields != fields.length) {
      continue;
    }
    element.detach();
  }
  file.setWritable(true);
  FileWriter writer=new FileWriter(file);
  RandomAccessFile f=new RandomAccessFile(file,"String_Node_Str");
  f.getChannel().lock();
  OutputStream out=new FileOutputStream(f.getFD());
  xmlSerializer.output(table,out);
  writer.close();
  f.close();
}
Program: 86722
Project: 86722
Buggy source:
@Override public DatabaseRow[] getRelatedRows(String table1,String table2,String relation1,String relation2,String searchColumn,String searchValue){
  ArrayList<DatabaseRow> relationRows=new ArrayList<DatabaseRow>();
  ArrayList<DatabaseRow> resultRows=new ArrayList<DatabaseRow>();
  try {
    DatabaseRow[] searchRows=this.getTable(table1).getFilteredRows(searchColumn,searchValue);
    ArrayList<String> table1Values=new ArrayList<String>();
    for (    DatabaseRow row : searchRows) {
      table1Values.add(row.getStringCell(relation1));
    }
    DatabaseTable relT=this.getTable(table1 + "String_Node_Str" + table2+ "String_Node_Str");
    if (relT == null) {
      relT=this.getTable(table2 + "String_Node_Str" + table1+ "String_Node_Str");
      if (relT == null) {
        return null;
      }
    }
    for (    String val : table1Values) {
      DatabaseRow[] rs=relT.getFilteredRows(relation1,val);
      if (rs != null) {
        for (        DatabaseRow r : rs) {
          relationRows.add(r);
        }
      }
    }
    for (    DatabaseRow relRow : relationRows) {
      DatabaseRow[] rs=this.getTable(table2).getFilteredRows(relation2,relRow.getStringCell(relation2));
      for (      DatabaseRow r : rs) {
        if (!resultRows.contains(r)) {
          resultRows.add(r);
        }
      }
    }
  }
 catch (  NullPointerException npe) {
    Logman.logStackTrace("String_Node_Str",npe);
    return null;
  }
  DatabaseRow[] retForm={};
  return resultRows.toArray(retForm);
}

Fixed version (ground truth):
@Override public DatabaseRow[] getRelatedRows(String table1,String table2,String relation1,String relation2,String searchColumn,String searchValue){
  ArrayList<DatabaseRow> relationRows=new ArrayList<DatabaseRow>();
  ArrayList<DatabaseRow> resultRows=new ArrayList<DatabaseRow>();
  try {
    DatabaseRow[] searchRows=this.getTable(table1).getFilteredRows(searchColumn,searchValue);
    if (searchRows == null) {
      return null;
    }
    ArrayList<String> table1Values=new ArrayList<String>();
    for (    DatabaseRow row : searchRows) {
      table1Values.add(row.getStringCell(relation1));
    }
    DatabaseTable relT=this.getTable(table1 + "String_Node_Str" + table2+ "String_Node_Str");
    if (relT == null) {
      relT=this.getTable(table2 + "String_Node_Str" + table1+ "String_Node_Str");
      if (relT == null) {
        return null;
      }
    }
    for (    String val : table1Values) {
      DatabaseRow[] rs=relT.getFilteredRows(relation1,val);
      if (rs != null) {
        for (        DatabaseRow r : rs) {
          relationRows.add(r);
        }
      }
    }
    for (    DatabaseRow relRow : relationRows) {
      DatabaseRow[] rs=this.getTable(table2).getFilteredRows(relation2,relRow.getStringCell(relation2));
      for (      DatabaseRow r : rs) {
        if (!resultRows.contains(r)) {
          resultRows.add(r);
        }
      }
    }
  }
 catch (  NullPointerException npe) {
    Logman.logStackTrace("String_Node_Str",npe);
    return null;
  }
  DatabaseRow[] retForm={};
  return resultRows.toArray(retForm);
}
Program: 86723
Project: 86723
Buggy source:
/** 
 * Loads the properties
 */
public void load() throws IOException {
  BufferedReader in=null;
  IOException toThrow=null;
  try {
    if (this.propsFile == null)     in=new BufferedReader(new InputStreamReader(instream));
 else     in=new BufferedReader(new FileReader(propsFile));
    String inLine;
    ArrayList<String> inComments=new ArrayList<String>();
    while ((inLine=in.readLine()) != null) {
      if (inLine.startsWith("String_Node_Str") || inLine.startsWith("String_Node_Str")) {
        inComments.add(inLine);
      }
 else {
        try {
          String[] propsLine=inLine.split("String_Node_Str");
          props.put(propsLine[0].trim(),propsLine[1].trim());
          if (!inComments.isEmpty()) {
            String[] commented=new String[inComments.size()];
            for (int i=0; i < inComments.size(); i++) {
              commented[i]=inComments.get(i);
            }
            comments.put(propsLine[0],commented);
            inComments.clear();
          }
        }
 catch (        ArrayIndexOutOfBoundsException AIOOBE) {
          inComments.clear();
          continue;
        }
      }
    }
  }
 catch (  IOException ioe) {
    toThrow=ioe;
  }
 finally {
    if (in != null) {
      in.close();
    }
    if (this.propsFile == null) {
      instream.close();
    }
    if (toThrow != null) {
      throw toThrow;
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads the properties
 */
public void load() throws IOException {
  BufferedReader in=null;
  IOException toThrow=null;
  try {
    if (this.propsFile == null)     in=new BufferedReader(new InputStreamReader(instream));
 else     in=new BufferedReader(new FileReader(propsFile));
    String inLine;
    ArrayList<String> inComments=new ArrayList<String>();
    while ((inLine=in.readLine()) != null) {
      if (inLine.startsWith("String_Node_Str") || inLine.startsWith("String_Node_Str")) {
        inComments.add(inLine);
      }
 else {
        try {
          String[] propsLine=inLine.split("String_Node_Str");
          props.put(propsLine[0].trim(),propsLine[1].trim());
          if (!inComments.isEmpty()) {
            String[] commented=new String[inComments.size()];
            for (int i=0; i < inComments.size(); i++) {
              commented[i]=inComments.get(i);
            }
            comments.put(propsLine[0],commented);
            inComments.clear();
          }
        }
 catch (        ArrayIndexOutOfBoundsException AIOOBE) {
          inComments.clear();
          continue;
        }
      }
    }
  }
 catch (  IOException ioe) {
    toThrow=ioe;
  }
 finally {
    if (in != null) {
      in.close();
    }
    if (instream != null) {
      instream.close();
      instream=null;
    }
    if (toThrow != null) {
      throw toThrow;
    }
  }
}
Program: 86724
Project: 86724
Buggy source:
/** 
 * Class constructor.
 * @param url URL of the configuration file
 */
public ConfigurationFile(InputStream stream) throws IOException {
  this.filepath=null;
  this.propsFile=null;
  this.instream=stream;
  load();
}

Fixed version (ground truth):
/** 
 * Class constructor.
 * @param url URL of the configuration file
 */
public ConfigurationFile(InputStream stream) throws IOException {
  this.instream=stream;
  load();
}
Program: 86725
Project: 86725
Buggy source:
private void init(ConfigurationFile cfg){
  this.cfg=cfg;
  String typeVal=cfg.getString("String_Node_Str","String_Node_Str");
  if (typeVal.equalsIgnoreCase("String_Node_Str")) {
    dataSourceType=Database.Type.FLATFILE;
  }
 else   if (typeVal.equalsIgnoreCase("String_Node_Str")) {
    dataSourceType=Database.Type.MYSQL;
  }
}

Fixed version (ground truth):
private void init(ConfigurationFile cfg){
  this.cfg=cfg;
  String typeVal=cfg.getString("String_Node_Str","String_Node_Str");
  if (typeVal.equalsIgnoreCase("String_Node_Str")) {
    dataSourceType=Database.Type.MYSQL;
  }
 else {
    dataSourceType=Database.Type.FLATFILE;
  }
}
Program: 86726
Project: 86726
Buggy source:
public BanManager(Backbone bone,Database.Type type){
  backbone=(BackboneBans)bone.getBackbone(Backbone.System.BANS,type);
  bans=backbone.loadBans();
}

Fixed version (ground truth):
public BanManager(Backbone bone,Database.Type type){
  backbone=(BackboneBans)Backbone.getBackbone(Backbone.System.BANS,type);
  bans=backbone.loadBans();
}
Program: 86727
Project: 86727
Buggy source:
public KitProvider(Backbone bone,Database.Type type){
  backbone=(BackboneKits)bone.getBackbone(Backbone.System.KITS,type);
  kits=backbone.loadKits();
}

Fixed version (ground truth):
public KitProvider(Backbone bone,Database.Type type){
  backbone=(BackboneKits)Backbone.getBackbone(Backbone.System.KITS,type);
  kits=backbone.loadKits();
}
Program: 86728
Project: 86728
Buggy source:
public WarpProvider(Backbone bone,Database.Type type){
  backbone=(BackboneWarps)bone.getBackbone(Backbone.System.WARPS,type);
  warps=backbone.loadWarps();
}

Fixed version (ground truth):
public WarpProvider(Backbone bone,Database.Type type){
  backbone=(BackboneWarps)Backbone.getBackbone(Backbone.System.WARPS,type);
  warps=backbone.loadWarps();
}
Program: 86729
Project: 86729
Buggy source:
/** 
 * Get the port number used to receive player-connections
 * @return
 */
public int getPort(){
  return cfg.getInt("String_Node_Str",22025);
}

Fixed version (ground truth):
/** 
 * Get the port number used to receive player-connections
 * @return
 */
public int getPort(){
  return cfg.getInt("String_Node_Str",25565);
}
Program: 86730
Project: 86730
Buggy source:
private void init(ConfigurationFile cfg){
  this.cfg=cfg;
  spawnableMobs=cfg.getString("String_Node_Str").split("String_Node_Str");
  spawnableAnimals=cfg.getString("String_Node_Str").split("String_Node_Str");
  spawnableWaterAnimals=cfg.getString("String_Node_Str").split("String_Node_Str");
  String[] eb=cfg.getString("String_Node_Str","String_Node_Str").split("String_Node_Str");
  String[] bb=cfg.getString("String_Node_Str","String_Node_Str").split("String_Node_Str");
  ArrayList<Integer> ebi=new ArrayList<Integer>();
  ArrayList<Integer> bbi=new ArrayList<Integer>();
  for (  String s : eb)   ebi.add(Integer.valueOf(s));
  for (  String s : bb)   bbi.add(Integer.valueOf(s));
  enderBlocks=ebi.toArray(enderBlocks);
  bannedBlocks=bbi.toArray(bannedBlocks);
}

Fixed version (ground truth):
private void init(ConfigurationFile cfg){
  this.cfg=cfg;
  spawnableMobs=cfg.getString("String_Node_Str","String_Node_Str").split("String_Node_Str");
  spawnableAnimals=cfg.getString("String_Node_Str","String_Node_Str").split("String_Node_Str");
  spawnableWaterAnimals=cfg.getString("String_Node_Str","String_Node_Str").split("String_Node_Str");
  String[] eb=cfg.getString("String_Node_Str","String_Node_Str").split("String_Node_Str");
  String[] bb=cfg.getString("String_Node_Str","String_Node_Str").split("String_Node_Str");
  ArrayList<Integer> ebi=new ArrayList<Integer>();
  ArrayList<Integer> bbi=new ArrayList<Integer>();
  for (  String s : eb)   ebi.add(Integer.valueOf(s.trim()));
  for (  String s : bb)   bbi.add(Integer.valueOf(s.trim()));
  enderBlocks=ebi.toArray(enderBlocks);
  bannedBlocks=bbi.toArray(bannedBlocks);
}
Program: 86731
Project: 86731
Buggy source:
/** 
 * Returns a class relative identifier.
 * @param doc The class the identifier should be relative to.
 * @param str The identifier to be made relative.
 */
static String classRelativeIdentifier(ClassDoc doc,String str){
  if (str.startsWith(doc.name())) {
    return str.substring(doc.name().length() + 1);
  }
 else   if (str.startsWith(doc.containingPackage().name())) {
    return str.substring(doc.name().length() + 1);
  }
 else {
    return str;
  }
}

Fixed version (ground truth):
/** 
 * Returns a class relative identifier.
 * @param doc The class the identifier should be relative to.
 * @param str The identifier to be made relative.
 */
static String classRelativeIdentifier(ClassDoc doc,String str){
  if (str.equals(doc.name())) {
    return "String_Node_Str";
  }
 else   if (str.startsWith(doc.name())) {
    return str.substring(doc.name().length() + 1);
  }
 else   if (str.startsWith(doc.containingPackage().name())) {
    return str.substring(doc.name().length() + 1);
  }
 else {
    return str;
  }
}
Program: 86733
Project: 86733
Buggy source:
public UserRole(String name){
  this.name=name;
}

Fixed version (ground truth):
private UserRole(String name){
  this.name=name;
}
Program: 86734
Project: 86734
Buggy source:
@Override public void validate() throws OpsGenieClientValidationException {
  super.validate();
  if (name == null && id == null)   throw OpsGenieClientValidationException.missingMultipleMandatoryProperty(OpsGenieClientConstants.API.NAME,OpsGenieClientConstants.API.ID);
}

Fixed version (ground truth):
/** 
 * check the parameters for validation.
 * @throws ValidationException when name and id are both null!
 */
@Override public void validate() throws OpsGenieClientValidationException {
  super.validate();
  if (name == null && id == null)   throw OpsGenieClientValidationException.missingMultipleMandatoryProperty(OpsGenieClientConstants.API.NAME,OpsGenieClientConstants.API.ID);
}
Program: 86735
Project: 86735
Buggy source:
@Override public void fromMap(Map resp){
  setName((String)resp.get(OpsGenieClientConstants.API.NAME));
  setLastHeartbeat(new Date(((Number)resp.get(OpsGenieClientConstants.API.LAST_HEARTBEAT)).longValue()));
  setEnabled((Boolean)resp.get(OpsGenieClientConstants.API.ENABLED));
  setDescription((String)resp.get(OpsGenieClientConstants.API.DESCRIPTION));
  setStatus((String)resp.get(OpsGenieClientConstants.API.STATUS));
  setExpired("String_Node_Str".equals(getStatus()));
  setInterval(((Number)resp.get(OpsGenieClientConstants.API.INTERVAL)).intValue());
  if (resp.containsKey(OpsGenieClientConstants.API.INTERVAL_UNIT)) {
    setIntervalUnit(IntervalUnit.valueOf((String)resp.get(OpsGenieClientConstants.API.INTERVAL_UNIT)));
  }
}

Fixed version (ground truth):
@Override public void fromMap(Map resp){
  setName((String)resp.get(OpsGenieClientConstants.API.NAME));
  if (resp.containsKey(OpsGenieClientConstants.API.LAST_HEARTBEAT))   setLastHeartbeat(new Date(((Number)resp.get(OpsGenieClientConstants.API.LAST_HEARTBEAT)).longValue()));
  setEnabled((Boolean)resp.get(OpsGenieClientConstants.API.ENABLED));
  setDescription((String)resp.get(OpsGenieClientConstants.API.DESCRIPTION));
  setStatus((String)resp.get(OpsGenieClientConstants.API.STATUS));
  setExpired("String_Node_Str".equals(getStatus()));
  if (resp.containsKey(OpsGenieClientConstants.API.INTERVAL))   setInterval(((Number)resp.get(OpsGenieClientConstants.API.INTERVAL)).intValue());
  if (resp.containsKey(OpsGenieClientConstants.API.INTERVAL_UNIT)) {
    setIntervalUnit(IntervalUnit.valueOf((String)resp.get(OpsGenieClientConstants.API.INTERVAL_UNIT)));
  }
}
Program: 86736
Project: 86736
Buggy source:
@Override public void deserialize(Map data) throws ParseException {
  super.deserialize(data);
  heartbeat=new Heartbeat();
  heartbeat.fromMap(data);
}

Fixed version (ground truth):
@Override public void deserialize(Map data) throws ParseException {
  System.out.println("String_Node_Str" + data);
  super.deserialize(data);
  heartbeat=new Heartbeat();
  heartbeat.fromMap(data);
}
Program: 86737
Project: 86737
Buggy source:
/** 
 * Change a notificationRule at OpsGenie.
 * @param addNotificationRuleRequest Object to construct request parameters.
 * @return <code>ChangeNotificationRuleResponse</code> object containing OpsGenie response information.
 * @see com.ifountain.opsgenie.client.model.notificationRule.ChangeNotificationRuleRequest
 * @see com.ifountain.opsgenie.client.model.notificationRule.ChangeNotificationRuleResponse
 */
public ChangeNotificationRuleResponse changeNotificationRule(ChangeNotificationRuleRequest changeNotificationRuleRequest) throws IOException, OpsGenieClientException, ParseException ;

Fixed version (ground truth):
/** 
 * Change a notificationRule at OpsGenie.
 * @param addNotificationRuleRequest Object to construct request parameters.
 * @return <code>ChangeNotificationRuleResponse</code> object containing OpsGenie response information.
 * @see com.ifountain.opsgenie.client.model.notificationRule.ChangeNotificationRuleOrderRequest
 * @see com.ifountain.opsgenie.client.model.notificationRule.ChangeNotificationRuleResponse
 */
public ChangeNotificationRuleOrderResponse changeNotificationRule(ChangeNotificationRuleOrderRequest changeNotificationRuleOrderRequest) throws IOException, OpsGenieClientException, ParseException ;
Program: 86738
Project: 86738
Buggy source:
@Override public ChangeNotificationRuleResponse changeNotificationRule(ChangeNotificationRuleRequest changeNotificationRuleRequest) throws IOException, OpsGenieClientException, ParseException {
  return (ChangeNotificationRuleResponse)httpClient.doPostRequest(changeNotificationRuleRequest);
}

Fixed version (ground truth):
@Override public ChangeNotificationRuleOrderResponse changeNotificationRule(ChangeNotificationRuleOrderRequest changeNotificationRuleRequest) throws IOException, OpsGenieClientException, ParseException {
  return (ChangeNotificationRuleOrderResponse)httpClient.doPostRequest(changeNotificationRuleRequest);
}
Program: 86739
Project: 86739
Buggy source:
/** 
 * check the parameters for validation. It will override by necessary Requests.
 * @throws ValidationException 
 */
public boolean isValid() throws ValidationException {
  if (apiKey == null)   throw new ValidationException("String_Node_Str");
  return true;
}

Fixed version (ground truth):
/** 
 * check the parameters for validation. It will be overridden by necessary Requests.
 * @throws ValidationException 
 */
public boolean isValid() throws ValidationException {
  if (apiKey == null)   throw new ValidationException("String_Node_Str");
  return true;
}
Program: 86740
Project: 86740
Buggy source:
@Override public void fromMap(Map map) throws ParseException {
  setId((String)map.get(OpsGenieClientConstants.API.ID));
  setUsername((String)map.get(OpsGenieClientConstants.API.USERNAME));
  setUserId((String)map.get(OpsGenieClientConstants.API.USER_ID));
  setTo((String)map.get(OpsGenieClientConstants.API.TO));
  setEnabled((Boolean)map.get(OpsGenieClientConstants.API.ENABLED));
  setDisabledReason((String)map.get(OpsGenieClientConstants.API.DISABLED_REASON));
  if (map.containsKey(OpsGenieClientConstants.API.METHOD)) {
    setMethod(Contact.Method.valueOf(((String)map.get(OpsGenieClientConstants.API.METHOD)).toLowerCase()));
  }
}

Fixed version (ground truth):
@Override public void fromMap(Map map) throws ParseException {
  setId((String)map.get(OpsGenieClientConstants.API.ID));
  setTo((String)map.get(OpsGenieClientConstants.API.TO));
  setEnabled((Boolean)map.get(OpsGenieClientConstants.API.ENABLED));
  setDisabledReason((String)map.get(OpsGenieClientConstants.API.DISABLED_REASON));
  if (map.containsKey(OpsGenieClientConstants.API.METHOD)) {
    setMethod(Contact.Method.valueOf(((String)map.get(OpsGenieClientConstants.API.METHOD)).toLowerCase()));
  }
}
Program: 86741
Project: 86741
Buggy source:
@Override public Map<String,Object> toMap(){
  Map<String,Object> json=new HashMap<String,Object>();
  json.put(OpsGenieClientConstants.API.USERNAME,username);
  json.put(OpsGenieClientConstants.API.USER_ID,userId);
  json.put(OpsGenieClientConstants.API.METHOD,getMethod() != null ? getMethod().name() : null);
  json.put(OpsGenieClientConstants.API.ENABLED,getEnabled());
  json.put(OpsGenieClientConstants.API.TO,to);
  json.put(OpsGenieClientConstants.API.DISABLED_REASON,disabledReason);
  return json;
}

Fixed version (ground truth):
@Override public Map<String,Object> toMap(){
  Map<String,Object> json=new HashMap<String,Object>();
  json.put(OpsGenieClientConstants.API.METHOD,getMethod() != null ? getMethod().name() : null);
  json.put(OpsGenieClientConstants.API.ENABLED,getEnabled());
  json.put(OpsGenieClientConstants.API.TO,to);
  json.put(OpsGenieClientConstants.API.DISABLED_REASON,disabledReason);
  return json;
}
Program: 86742
Project: 86742
Buggy source:
@Override public void fromMap(Map map) throws ParseException {
  if (map.containsKey(OpsGenieClientConstants.API.FIELD)) {
    String fieldName=(String)map.get(OpsGenieClientConstants.API.FIELD);
    for (    Field field : Field.values())     if (field.value().equals(fieldName)) {
      setField(field);
      break;
    }
  }
  if (map.containsKey(OpsGenieClientConstants.API.NOT))   this.not=(Boolean)map.get(OpsGenieClientConstants.API.NOT);
  if (map.containsKey(OpsGenieClientConstants.API.EXPECTED_VALUE))   this.expectedValue=(String)map.get(OpsGenieClientConstants.API.EXPECTED_VALUE);
  if (map.containsKey(OpsGenieClientConstants.API.OPERATION)) {
    String operationName=(String)map.get(OpsGenieClientConstants.API.OPERATION);
    for (    Operation operation : Operation.values())     if (field.value().equals(operationName)) {
      setOperation(operation);
      break;
    }
  }
}

Fixed version (ground truth):
@Override public void fromMap(Map map) throws ParseException {
  if (map.containsKey(OpsGenieClientConstants.API.FIELD)) {
    String fieldName=(String)map.get(OpsGenieClientConstants.API.FIELD);
    for (    Field field : Field.values())     if (field.value().equals(fieldName)) {
      setField(field);
      break;
    }
  }
  if (map.containsKey(OpsGenieClientConstants.API.NOT))   this.not=(Boolean)map.get(OpsGenieClientConstants.API.NOT);
  if (map.containsKey(OpsGenieClientConstants.API.EXPECTED_VALUE))   this.expectedValue=(String)map.get(OpsGenieClientConstants.API.EXPECTED_VALUE);
  if (map.containsKey(OpsGenieClientConstants.API.OPERATION)) {
    String operationName=(String)map.get(OpsGenieClientConstants.API.OPERATION);
    for (    Operation operation : Operation.values())     if (operation.value().equals(operationName)) {
      setOperation(operation);
      break;
    }
  }
}
Program: 86743
Project: 86743
Buggy source:
public static File getScriptFile(String action){
  String safeFileName=action.replaceAll("String_Node_Str","String_Node_Str");
  String propertyKey="String_Node_Str" + safeFileName + "String_Node_Str".toLowerCase();
  String fileName=MaridConfig.getInstance().getLowercasedConfiguration().get(propertyKey);
  File scriptsDirectory=ScriptManager.getInstance().getScriptsDirectory();
  if (fileName == null) {
    fileName=safeFileName;
    File[] files=scriptsDirectory.listFiles();
    if (files != null) {
      for (      File file : files) {
        if (StringUtils.substringBeforeLast(file.getName(),"String_Node_Str").equalsIgnoreCase(fileName)) {
          return file;
        }
      }
    }
  }
 else {
    File scriptFile=new File(scriptsDirectory,fileName);
    if (scriptFile.exists()) {
      return scriptFile;
    }
  }
  return null;
}

Fixed version (ground truth):
public static File getScriptFile(String action){
  String safeFileName=action.replaceAll("String_Node_Str","String_Node_Str");
  String propertyKey=("String_Node_Str" + safeFileName + "String_Node_Str").toLowerCase();
  String fileName=MaridConfig.getInstance().getLowercasedConfiguration().get(propertyKey);
  File scriptsDirectory=ScriptManager.getInstance().getScriptsDirectory();
  if (fileName == null) {
    fileName=safeFileName;
    File[] files=scriptsDirectory.listFiles();
    if (files != null) {
      for (      File file : files) {
        if (StringUtils.substringBeforeLast(file.getName(),"String_Node_Str").equalsIgnoreCase(fileName)) {
          return file;
        }
      }
    }
  }
 else {
    File scriptFile=new File(scriptsDirectory,fileName);
    if (scriptFile.exists()) {
      return scriptFile;
    }
  }
  return null;
}
Program: 86744
Project: 86744
Buggy source:
@Override public void fromMap(Map map) throws ParseException {
  participant=(String)map.get(OpsGenieClientConstants.API.PARTICIPANT);
  if (map.containsKey(OpsGenieClientConstants.API.TYPE)) {
    type=Type.valueOf(((String)map.get(OpsGenieClientConstants.API.TYPE)).toLowerCase());
  }
}

Fixed version (ground truth):
@Override public void fromMap(Map map) throws ParseException {
  if (map.containsKey(OpsGenieClientConstants.API.PARTICIPANT)) {
    participant=(String)map.get(OpsGenieClientConstants.API.PARTICIPANT);
  }
 else {
    participant=(String)map.get(OpsGenieClientConstants.API.NAME);
  }
  if (map.containsKey(OpsGenieClientConstants.API.TYPE)) {
    type=Type.valueOf(((String)map.get(OpsGenieClientConstants.API.TYPE)).toLowerCase());
  }
}
Program: 86745
Project: 86745
Buggy source:
public void setScheduleTimeZone(TimeZone scheduleTimeZone){
  this.scheduleTimeZone=scheduleTimeZone;
}

Fixed version (ground truth):
/** 
 * Will be set by schedule
 * @param scheduleTimeZone
 */
public void setScheduleTimeZone(TimeZone scheduleTimeZone){
  this.scheduleTimeZone=scheduleTimeZone;
}
Program: 86747
Project: 86747
Buggy source:
public List<Map> listAlerts(Map params) throws Exception {
  populateCommonProps(params);
  ListAlertsRequest request=new ListAlertsRequest();
  request.setCreatedAfter(ScriptBridgeUtils.getAsLong(params,OpsGenieClientConstants.API.CREATED_AFTER));
  request.setCreatedBefore(ScriptBridgeUtils.getAsLong(params,OpsGenieClientConstants.API.CREATED_BEFORE));
  request.setUpdatedAfter(ScriptBridgeUtils.getAsLong(params,OpsGenieClientConstants.API.UPDATED_AFTER));
  request.setUpdatedBefore(ScriptBridgeUtils.getAsLong(params,OpsGenieClientConstants.API.UPDATED_BEFORE));
  request.setLimit(ScriptBridgeUtils.getAsInt(params,OpsGenieClientConstants.API.LIMIT));
  request.setSortBy(ListAlertsRequest.SortBy.valueOf(ScriptBridgeUtils.getAsString(params,OpsGenieClientConstants.API.SORT_BY)));
  request.setSortOrder(ListAlertsRequest.SortOrder.valueOf(ScriptBridgeUtils.getAsString(params,OpsGenieClientConstants.API.ORDER)));
  request.setStatus(ListAlertsRequest.Status.valueOf(ScriptBridgeUtils.getAsString(params,OpsGenieClientConstants.API.STATUS)));
  request.setCustomerKey(ScriptBridgeUtils.getAsString(params,OpsGenieClientConstants.API.CUSTOMER_KEY));
  return beansToMap(this.opsGenieClient.alert().listAlerts(request).getAlerts());
}

Fixed version (ground truth):
public List<Map> listAlerts(Map params) throws Exception {
  populateCommonProps(params);
  ListAlertsRequest request=new ListAlertsRequest();
  request.setCreatedAfter(ScriptBridgeUtils.getAsLong(params,OpsGenieClientConstants.API.CREATED_AFTER));
  request.setCreatedBefore(ScriptBridgeUtils.getAsLong(params,OpsGenieClientConstants.API.CREATED_BEFORE));
  request.setUpdatedAfter(ScriptBridgeUtils.getAsLong(params,OpsGenieClientConstants.API.UPDATED_AFTER));
  request.setUpdatedBefore(ScriptBridgeUtils.getAsLong(params,OpsGenieClientConstants.API.UPDATED_BEFORE));
  request.setLimit(ScriptBridgeUtils.getAsInt(params,OpsGenieClientConstants.API.LIMIT));
  if (params.containsKey(OpsGenieClientConstants.API.SORT_BY)) {
    request.setSortBy(ListAlertsRequest.SortBy.valueOf(ScriptBridgeUtils.getAsString(params,OpsGenieClientConstants.API.SORT_BY)));
  }
  if (params.containsKey(OpsGenieClientConstants.API.ORDER)) {
    request.setSortOrder(ListAlertsRequest.SortOrder.valueOf(ScriptBridgeUtils.getAsString(params,OpsGenieClientConstants.API.ORDER)));
  }
  if (params.containsKey(OpsGenieClientConstants.API.STATUS)) {
    request.setStatus(ListAlertsRequest.Status.valueOf(ScriptBridgeUtils.getAsString(params,OpsGenieClientConstants.API.STATUS)));
  }
  request.setCustomerKey(ScriptBridgeUtils.getAsString(params,OpsGenieClientConstants.API.CUSTOMER_KEY));
  return beansToMap(this.opsGenieClient.alert().listAlerts(request).getAlerts());
}
Program: 86748
Project: 86748
Buggy source:
public static List<String> getAsList(Map params,String propName){
  Object result=params.get(propName);
  if (result == null)   return null;
  List<String> elements=new ArrayList<String>();
  if (result.getClass().isArray()) {
    int length=Array.getLength(result);
    for (int i=0; i < length; i++) {
      elements.add(String.valueOf(Array.get(result,i)));
    }
  }
  if (result instanceof Collection) {
    for (    Object collElement : (Collection)result) {
      if (collElement == null) {
        elements.add(null);
      }
 else {
        elements.add(String.valueOf(collElement));
      }
    }
  }
 else {
    elements.add(String.valueOf(result));
  }
  return elements;
}

Fixed version (ground truth):
public static List<String> getAsList(Map params,String propName){
  Object result=params.get(propName);
  if (result == null)   return null;
  List<String> elements=new ArrayList<String>();
  if (result.getClass().isArray()) {
    int length=Array.getLength(result);
    for (int i=0; i < length; i++) {
      elements.add(String.valueOf(Array.get(result,i)));
    }
  }
 else   if (result instanceof Collection) {
    for (    Object collElement : (Collection)result) {
      if (collElement == null) {
        elements.add(null);
      }
 else {
        elements.add(String.valueOf(collElement));
      }
    }
  }
 else {
    elements.add(String.valueOf(result));
  }
  return elements;
}
Program: 86750
Project: 86750
Buggy source:
public X509Certificate[] getAcceptedIssuers(){
  return X509_CERTIFICATES;
}

Fixed version (ground truth):
public X509Certificate[] getAcceptedIssuers(){
  return null;
}
Program: 86751
Project: 86751
Buggy source:
public Map getAlert(Map params) throws Exception {
  GetAlertRequest request=new GetAlertRequest();
  request.setAlertId(OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.ALERT_ID));
  request.setAlias(OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.ALIAS));
  request.setCustomerKey(OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.CUSTOMER_KEY));
  GetAlertResponse resp=this.opsGenieClient.getAlert(request);
  Map mapResponse=new HashMap();
  mapResponse.put(OpsGenieClientConstants.API.ACTIONS,resp.getActions());
  mapResponse.put(OpsGenieClientConstants.API.MESSAGE,resp.getMessage());
  mapResponse.put(OpsGenieClientConstants.API.ALERT_ID,resp.getId());
  mapResponse.put(OpsGenieClientConstants.API.ALIAS,resp.getAlias());
  mapResponse.put(OpsGenieClientConstants.API.TAGS,resp.getTags());
  mapResponse.put(OpsGenieClientConstants.API.CREATED_AT,resp.getCreatedAt());
  mapResponse.put(OpsGenieClientConstants.API.DESCRIPTION,resp.getDescription());
  mapResponse.put(OpsGenieClientConstants.API.DETAILS,resp.getDetails());
  mapResponse.put(OpsGenieClientConstants.API.RECIPIENTS,resp.getRecipients());
  mapResponse.put(OpsGenieClientConstants.API.SOURCE,resp.getSource());
  mapResponse.put(OpsGenieClientConstants.API.ENTITY,resp.getEntity());
  mapResponse.put(OpsGenieClientConstants.API.STATUS,resp.getStatus());
  return mapResponse;
}

Fixed version (ground truth):
public Map getAlert(Map params) throws Exception {
  populateCommonProps(params);
  GetAlertRequest request=new GetAlertRequest();
  request.setAlertId(OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.ALERT_ID));
  request.setAlias(OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.ALIAS));
  request.setCustomerKey(OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.CUSTOMER_KEY));
  GetAlertResponse resp=this.opsGenieClient.getAlert(request);
  Map mapResponse=new HashMap();
  mapResponse.put(OpsGenieClientConstants.API.ACTIONS,resp.getActions());
  mapResponse.put(OpsGenieClientConstants.API.MESSAGE,resp.getMessage());
  mapResponse.put(OpsGenieClientConstants.API.ALERT_ID,resp.getId());
  mapResponse.put(OpsGenieClientConstants.API.ALIAS,resp.getAlias());
  mapResponse.put(OpsGenieClientConstants.API.TAGS,resp.getTags());
  mapResponse.put(OpsGenieClientConstants.API.CREATED_AT,resp.getCreatedAt());
  mapResponse.put(OpsGenieClientConstants.API.DESCRIPTION,resp.getDescription());
  mapResponse.put(OpsGenieClientConstants.API.DETAILS,resp.getDetails());
  mapResponse.put(OpsGenieClientConstants.API.RECIPIENTS,resp.getRecipients());
  mapResponse.put(OpsGenieClientConstants.API.SOURCE,resp.getSource());
  mapResponse.put(OpsGenieClientConstants.API.ENTITY,resp.getEntity());
  mapResponse.put(OpsGenieClientConstants.API.STATUS,resp.getStatus());
  return mapResponse;
}
Program: 86752
Project: 86752
Buggy source:
public Map heartbeat(Map params) throws Exception {
  HeartbeatRequest request=new HeartbeatRequest();
  request.setCustomerKey(OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.CUSTOMER_KEY));
  HeartbeatResponse resp=this.opsGenieClient.heartbeat(request);
  Map mapResponse=new HashMap();
  mapResponse.put("String_Node_Str",resp.getHeartbeat());
  return mapResponse;
}

Fixed version (ground truth):
public Map heartbeat(Map params) throws Exception {
  populateCommonProps(params);
  HeartbeatRequest request=new HeartbeatRequest();
  request.setCustomerKey(OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.CUSTOMER_KEY));
  HeartbeatResponse resp=this.opsGenieClient.heartbeat(request);
  Map mapResponse=new HashMap();
  mapResponse.put("String_Node_Str",resp.getHeartbeat());
  return mapResponse;
}
Program: 86753
Project: 86753
Buggy source:
public void executeScript(String script,Map params) throws Exception {
  ExecuteScriptCommand.executeScript(script,opsGenieClient,options,params);
}

Fixed version (ground truth):
public void executeScript(String script,Map params,Map config) throws Exception {
  CommonCommandOptions defaultOptions=options;
  if (config != null) {
    ArrayList<String> user=new ArrayList<String>();
    user.add((String)config.get("String_Node_Str"));
    defaultOptions=new CommonCommandOptions();
    defaultOptions.setCustomerKey((String)config.get("String_Node_Str"));
    defaultOptions.setUser(user);
  }
  ExecuteScriptCommand.executeScript(script,opsGenieClient,defaultOptions,params);
}
Program: 86754
Project: 86754
Buggy source:
private void populateCommonProps(Map params){
  String customerKey=OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.CUSTOMER_KEY);
  if (customerKey == null) {
    params.put(OpsGenieClientConstants.API.CUSTOMER_KEY,options.getCustomerKey());
  }
  String user=OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.USER);
  if (user == null) {
    params.put(OpsGenieClientConstants.API.USER,options.getUser());
  }
}

Fixed version (ground truth):
private void populateCommonProps(CommonCommandOptions options,Map params){
  String customerKey=OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.CUSTOMER_KEY);
  if (customerKey == null) {
    params.put(OpsGenieClientConstants.API.CUSTOMER_KEY,options.getCustomerKey());
  }
  String user=OpsGenieClientScriptingBridgeUtils.getAsString(params,OpsGenieClientConstants.API.USER);
  if (user == null) {
    params.put(OpsGenieClientConstants.API.USER,options.getUser());
  }
}
Program: 86755
Project: 86755
Buggy source:
/** 
 * @see DefinitionMappingHandler#getCreateUrl(Class)
 */
public String getCreateUrl(Class<? extends Definition> type){
  return "String_Node_Str" + type.getName() + "String_Node_Str"+ type.getName();
}

Fixed version (ground truth):
/** 
 * @see DefinitionMappingHandler#getCreateUrl(Class)
 */
public String getCreateUrl(Class<? extends Definition> type){
  DefinitionService svc=DefinitionContext.getDefinitionService(type);
  Class<? extends Definition> parentType=svc.getDefinitionType();
  return "String_Node_Str" + type.getName() + "String_Node_Str"+ parentType.getName();
}
Program: 86756
Project: 86756
Buggy source:
/** 
 * @see CohortDefinitionEvaluator#evaluate(CohortDefinition,EvaluationContext)
 * @should return patients in the specified states before the start date
 * @should return patients in the specified states after the start date
 * @should return patients in the specified states before the end date
 * @should return patients in the specified states after the end date
 * @should find patients in specified states on the before start date if passed in time is at midnight
 * @should find patients in specified states on the before end date if passed in time is at midnight
 */
public EvaluatedCohort evaluate(CohortDefinition cohortDefinition,EvaluationContext context){
  PatientStateCohortDefinition def=(PatientStateCohortDefinition)cohortDefinition;
  HqlQueryBuilder qb=new HqlQueryBuilder();
  qb.select("String_Node_Str");
  qb.from(PatientState.class,"String_Node_Str");
  qb.whereIn("String_Node_Str",def.getStates());
  qb.whereGreaterOrEqualTo("String_Node_Str",def.getStartedOnOrAfter());
  qb.whereLessOrEqualTo("String_Node_Str",def.getStartedOnOrBefore());
  qb.whereGreaterOrEqualTo("String_Node_Str",def.getEndedOnOrAfter());
  qb.whereLessOrEqualTo("String_Node_Str",def.getEndedOnOrBefore());
  qb.whereIn("String_Node_Str",def.getLocationList());
  qb.wherePatientIn("String_Node_Str",context);
  List<Integer> pIds=evaluationService.evaluateToList(qb,Integer.class,context);
  return new EvaluatedCohort(new Cohort(pIds),cohortDefinition,context);
}

Fixed version (ground truth):
/** 
 * @see CohortDefinitionEvaluator#evaluate(CohortDefinition,EvaluationContext)
 * @should return patients in the specified states before the start date
 * @should return patients in the specified states after the start date
 * @should return patients in the specified states before the end date
 * @should return patients in the specified states after the end date
 * @should find patients in specified states on the before start date if passed in time is at midnight
 * @should find patients in specified states on the before end date if passed in time is at midnight
 */
public EvaluatedCohort evaluate(CohortDefinition cohortDefinition,EvaluationContext context){
  PatientStateCohortDefinition def=(PatientStateCohortDefinition)cohortDefinition;
  HqlQueryBuilder qb=new HqlQueryBuilder();
  qb.select("String_Node_Str");
  qb.from(PatientState.class,"String_Node_Str");
  qb.whereIn("String_Node_Str",def.getStates());
  qb.whereGreaterOrEqualTo("String_Node_Str",def.getStartedOnOrAfter());
  qb.whereLessOrEqualTo("String_Node_Str",def.getStartedOnOrBefore());
  qb.whereGreaterOrEqualTo("String_Node_Str",def.getEndedOnOrAfter());
  qb.whereLessOrEqualTo("String_Node_Str",def.getEndedOnOrBefore());
  qb.whereIn("String_Node_Str",def.getLocationList());
  qb.whereEqual("String_Node_Str",false);
  qb.wherePatientIn("String_Node_Str",context);
  List<Integer> pIds=evaluationService.evaluateToList(qb,Integer.class,context);
  return new EvaluatedCohort(new Cohort(pIds),cohortDefinition,context);
}
Program: 86758
Project: 86758
Buggy source:
public HqlQueryBuilder whereLike(String propertyName,Object propertyValue){
  if (propertyValue != null) {
    where(propertyName + "String_Node_Str" + nextPositionIndex()).withValue(propertyValue);
  }
  return this;
}

Fixed version (ground truth):
public HqlQueryBuilder whereLike(String propertyName,Object propertyValue){
  if (propertyValue != null) {
    String s=propertyValue.toString();
    if (s.indexOf("String_Node_Str") == -1) {
      s="String_Node_Str" + s + "String_Node_Str";
    }
    where(propertyName + "String_Node_Str" + nextPositionIndex()).withValue(s);
  }
  return this;
}
Program: 86759
Project: 86759
Buggy source:
/** 
 * @param patientQuery the patientQuery to set
 */
public void setPatientQuery(CohortDefinition patientQuery){
  this.patientQuery=patientQuery;
}

Fixed version (ground truth):
/** 
 * @param patientQuery the patientQuery to set
 */
public void setPatientQuery(CohortDefinition patientQuery){
  this.patientQuery=patientQuery;
  this.setParameters(patientQuery.getParameters());
}
Program: 86760
Project: 86760
Buggy source:
/** 
 * Full Constructor
 */
public PatientEncounterQuery(CohortDefinition patientQuery){
  this.patientQuery=patientQuery;
}

Fixed version (ground truth):
/** 
 * Full Constructor
 */
public PatientEncounterQuery(CohortDefinition patientQuery){
  setPatientQuery(patientQuery);
}
Program: 86761
Project: 86761
Buggy source:
/** 
 * Full Constructor
 */
public PatientPersonQuery(CohortDefinition patientQuery){
  this.patientQuery=patientQuery;
}

Fixed version (ground truth):
/** 
 * Full Constructor
 */
public PatientPersonQuery(CohortDefinition patientQuery){
  setPatientQuery(patientQuery);
}
Program: 86762
Project: 86762
Buggy source:
/** 
 * @param patientQuery the patientQuery to set
 */
public void setPatientQuery(CohortDefinition patientQuery){
  this.patientQuery=patientQuery;
}

Fixed version (ground truth):
/** 
 * @param patientQuery the patientQuery to set
 */
public void setPatientQuery(CohortDefinition patientQuery){
  this.patientQuery=patientQuery;
  this.setParameters(patientQuery.getParameters());
}