nus-yam/ex-repair huggingface dataset:
Program: 29279
Project: 29279
Buggy source:
/** 
 * Decrypt string to numbers
 * @param hash the encrypt string
 * @return decryped numbers
 */
public String decodeHex(String hash){
  String result="String_Node_Str";
  long[] numbers=this.decrypt(hash);
  for (  long number : numbers) {
    result+=Long.toHexString(number).substring(1);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Decrypt string to numbers
 * @param hash the encrypt string
 * @return decryped numbers
 */
public String decodeHex(String hash){
  String result="String_Node_Str";
  long[] numbers=this.decode(hash);
  for (  long number : numbers) {
    result+=Long.toHexString(number).substring(1);
  }
  return result;
}
Program: 29280
Project: 29280
Buggy source:
/** 
 * @deprecated should use decode() since v1.0
 */
@Deprecated public long[] decrypt(String hash){
  return decode(hash);
}

Fixed version (ground truth):
/** 
 * @deprecated should use decode() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public long[] decrypt(String hash){
  return decode(hash);
}
Program: 29281
Project: 29281
Buggy source:
private long[] _decode(String hash,String alphabet){
  ArrayList<Long> ret=new ArrayList<Long>();
  int i=0;
  String regexp="String_Node_Str" + this.guards + "String_Node_Str";
  String hashBreakdown=hash.replaceAll(regexp,"String_Node_Str");
  String[] hashArray=hashBreakdown.split("String_Node_Str");
  if (hashArray.length == 3 || hashArray.length == 2) {
    i=1;
  }
  hashBreakdown=hashArray[i];
  char lottery=hashBreakdown.toCharArray()[0];
  hashBreakdown=hashBreakdown.substring(1);
  hashBreakdown=hashBreakdown.replaceAll("String_Node_Str" + this.seps + "String_Node_Str","String_Node_Str");
  hashArray=hashBreakdown.split("String_Node_Str");
  String subHash, buffer;
  for (  String aHashArray : hashArray) {
    subHash=aHashArray;
    buffer=lottery + this.salt + alphabet;
    alphabet=this.consistentShuffle(alphabet,buffer.substring(0,alphabet.length()));
    ret.add(this.unhash(subHash,alphabet));
  }
  long[] arr=new long[ret.size()];
  for (int k=0; k < arr.length; k++) {
    arr[k]=ret.get(k);
  }
  return arr;
}

Fixed version (ground truth):
private long[] _decode(String hash,String alphabet){
  ArrayList<Long> ret=new ArrayList<Long>();
  int i=0;
  String regexp="String_Node_Str" + this.guards + "String_Node_Str";
  String hashBreakdown=hash.replaceAll(regexp,"String_Node_Str");
  String[] hashArray=hashBreakdown.split("String_Node_Str");
  if (hashArray.length == 3 || hashArray.length == 2) {
    i=1;
  }
  hashBreakdown=hashArray[i];
  char lottery=hashBreakdown.toCharArray()[0];
  hashBreakdown=hashBreakdown.substring(1);
  hashBreakdown=hashBreakdown.replaceAll("String_Node_Str" + this.seps + "String_Node_Str","String_Node_Str");
  hashArray=hashBreakdown.split("String_Node_Str");
  String subHash, buffer;
  for (  String aHashArray : hashArray) {
    subHash=aHashArray;
    buffer=lottery + this.salt + alphabet;
    alphabet=this.consistentShuffle(alphabet,buffer.substring(0,alphabet.length()));
    ret.add(this.unhash(subHash,alphabet));
  }
  long[] arr=new long[ret.size()];
  for (int k=0; k < arr.length; k++) {
    arr[k]=ret.get(k);
  }
  if (!this._encode(arr).equals(hash)) {
    arr=new long[0];
  }
  return arr;
}
Program: 29282
Project: 29282
Buggy source:
@Test public void test_large_nummber(){
  String res;
  long num_to_hash=9007199254740992L;
  Hashids a=new Hashids("String_Node_Str");
  res=a.encode(num_to_hash);
  long[] b=a.decode(res);
  Assert.assertEquals(num_to_hash,b[0]);
}

Fixed version (ground truth):
@Test public void test_large_nummber(){
  long num_to_hash=9007199254740992L;
  Hashids a=new Hashids("String_Node_Str");
  String res=a.encode(num_to_hash);
  long[] b=a.decode(res);
  Assert.assertEquals(num_to_hash,b[0]);
}
Program: 29283
Project: 29283
Buggy source:
private long[] _decode(String hash,String alphabet){
  ArrayList<Long> ret=new ArrayList<Long>();
  int i=0;
  String regexp="String_Node_Str" + this.guards + "String_Node_Str";
  String hashBreakdown=hash.replaceAll(regexp,"String_Node_Str");
  String[] hashArray=hashBreakdown.split("String_Node_Str");
  if (hashArray.length == 3 || hashArray.length == 2) {
    i=1;
  }
  hashBreakdown=hashArray[i];
  char lottery=hashBreakdown.toCharArray()[0];
  hashBreakdown=hashBreakdown.substring(1);
  hashBreakdown=hashBreakdown.replaceAll("String_Node_Str" + this.seps + "String_Node_Str","String_Node_Str");
  hashArray=hashBreakdown.split("String_Node_Str");
  String subHash, buffer;
  for (  String aHashArray : hashArray) {
    subHash=aHashArray;
    buffer=lottery + this.salt + alphabet;
    alphabet=Hashids.consistentShuffle(alphabet,buffer.substring(0,alphabet.length()));
    ret.add(Hashids.unhash(subHash,alphabet));
  }
  long[] arr=new long[ret.size()];
  for (int k=0; k < arr.length; k++) {
    arr[k]=ret.get(k);
  }
  if (!this._encode(arr).equals(hash)) {
    arr=new long[0];
  }
  return arr;
}

Fixed version (ground truth):
private long[] _decode(String hash,String alphabet){
  ArrayList<Long> ret=new ArrayList<Long>();
  int i=0;
  String regexp="String_Node_Str" + this.guards + "String_Node_Str";
  String hashBreakdown=hash.replaceAll(regexp,"String_Node_Str");
  String[] hashArray=hashBreakdown.split("String_Node_Str");
  if (hashArray.length == 3 || hashArray.length == 2) {
    i=1;
  }
  hashBreakdown=hashArray[i];
  if (!hashBreakdown.isEmpty()) {
    char lottery=hashBreakdown.toCharArray()[0];
    hashBreakdown=hashBreakdown.substring(1);
    hashBreakdown=hashBreakdown.replaceAll("String_Node_Str" + this.seps + "String_Node_Str","String_Node_Str");
    hashArray=hashBreakdown.split("String_Node_Str");
    String subHash, buffer;
    for (    String aHashArray : hashArray) {
      subHash=aHashArray;
      buffer=lottery + this.salt + alphabet;
      alphabet=Hashids.consistentShuffle(alphabet,buffer.substring(0,alphabet.length()));
      ret.add(Hashids.unhash(subHash,alphabet));
    }
  }
  long[] arr=new long[ret.size()];
  for (int k=0; k < arr.length; k++) {
    arr[k]=ret.get(k);
  }
  if (!this._encode(arr).equals(hash)) {
    arr=new long[0];
  }
  return arr;
}
Program: 29285
Project: 29285
Buggy source:
/** 
 * @deprecated should use encodeHex() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public String encryptHex(String hexa){
  return encodeHex(hexa);
}

Fixed version (ground truth):
/** 
 * @param hexa the hexa to encrypt
 * @return the encrypt string
 * @deprecated should use encodeHex() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public String encryptHex(String hexa){
  return encodeHex(hexa);
}
Program: 29286
Project: 29286
Buggy source:
/** 
 * @deprecated should use decodeHex() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public String decryptHex(String hash){
  return decodeHex(hash);
}

Fixed version (ground truth):
/** 
 * @param hash the encrypt string
 * @return decryped numbers
 * @deprecated should use decodeHex() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public String decryptHex(String hash){
  return decodeHex(hash);
}
Program: 29287
Project: 29287
Buggy source:
/** 
 * @deprecated should use encode() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public String encrypt(long... numbers){
  return encode(numbers);
}

Fixed version (ground truth):
/** 
 * @param numbers the numbers to encrypt
 * @return the encrypt string
 * @deprecated should use encode() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public String encrypt(long... numbers){
  return encode(numbers);
}
Program: 29288
Project: 29288
Buggy source:
/** 
 * @deprecated should use decode() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public long[] decrypt(String hash){
  return decode(hash);
}

Fixed version (ground truth):
/** 
 * @param hash the encrypt string
 * @return decryped numbers 
 * @deprecated should use decode() since v1.0
 */
@Deprecated @SuppressWarnings("String_Node_Str") public long[] decrypt(String hash){
  return decode(hash);
}
Program: 29290
Project: 29290
Buggy source:
@Test public void test_one_number(){
  Hashids a=null;
  String expected="String_Node_Str", res="String_Node_Str";
  long num_to_hash=1983L;
  try {
    a=new Hashids("String_Node_Str");
    res=a.encrypt(num_to_hash);
    Assert.assertEquals(res,expected);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Test public void test_one_number(){
  Hashids a=null;
  String expected="String_Node_Str", res="String_Node_Str";
  long num_to_hash=12345L;
  long[] res2;
  try {
    a=new Hashids("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  res=a.encrypt(num_to_hash);
  Assert.assertEquals(res,expected);
  res2=a.decrypt(expected);
  Assert.assertEquals(res2.length,1);
  Assert.assertEquals(res2[0],num_to_hash);
}
Program: 29291
Project: 29291
Buggy source:
@Test public void test_serveral_numbers(){
  Hashids a=null;
  String expected="String_Node_Str", res="String_Node_Str";
  long[] num_to_hash={1983L,1984L,2005L};
  try {
    a=new Hashids("String_Node_Str");
    res=a.encrypt(num_to_hash);
    Assert.assertEquals(res,expected);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Test public void test_serveral_numbers(){
  Hashids a=null;
  String expected="String_Node_Str", res="String_Node_Str";
  long[] num_to_hash={683L,94108L,123L,5L}, res2;
  try {
    a=new Hashids("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  res=a.encrypt(num_to_hash);
  Assert.assertEquals(res,expected);
  res2=a.decrypt(expected);
  Assert.assertEquals(res2.length,num_to_hash.length);
  Assert.assertTrue(Arrays.equals(res2,num_to_hash));
}
Program: 29292
Project: 29292
Buggy source:
protected final Long insertOrUpdate(T entity,SQLiteDatabase db,ContentValues values){
  if (entity.id == null) {
    entity.id=db.insert(getTableName(),null,values);
  }
 else {
    db.update(getTableName(),values,"String_Node_Str" + BaseColumns._ID + "String_Node_Str",new String[]{entity.id.toString()});
  }
  return entity.id;
}

Fixed version (ground truth):
protected final Long insertOrUpdate(T entity,SQLiteDatabase db,ContentValues values){
  if (entity.id == null) {
    entity.id=db.insert(getTableName(),null,values);
  }
 else {
    db.update(getTableName(),values,BaseColumns._ID + "String_Node_Str",new String[]{entity.id.toString()});
  }
  return entity.id;
}
Program: 29293
Project: 29293
Buggy source:
protected abstract String[] getPartArgs();

Fixed version (ground truth):
protected String[] getPartArgs(){
  return null;
}
Program: 29294
Project: 29294
Buggy source:
protected abstract String getPartSql();

Fixed version (ground truth):
protected String getPartSql(){
  return null;
}
Program: 29295
Project: 29295
Buggy source:
@Override public final String[] getArgs(){
  if (mParent != null) {
    return ArrayUtils.addAll(mParent.getArgs(),getPartArgs());
  }
  return getPartArgs();
}

Fixed version (ground truth):
@Override public final String[] getArgs(){
  if (mParent != null) {
    return join(mParent.getArgs(),getPartArgs());
  }
  return getPartArgs();
}
Program: 29296
Project: 29296
Buggy source:
@Override public <T extends Model>T fetchSingle(){
  return (T)Ollie.rawQuery(mTable,getSql(),getArgs());
}

Fixed version (ground truth):
@Override public <T extends Model>T fetchSingle(){
  List<T> results=(List<T>)Ollie.rawQuery(mTable,getSql(),getArgs());
  if (!results.isEmpty()) {
    return results.get(0);
  }
  return null;
}
Program: 29297
Project: 29297
Buggy source:
/** 
 * Tries to format the contents of the last contents appropriately based on the type of cell and the discovered numeric format.
 * @return
 */
Supplier formattedContents(){
switch (currentCell.getType()) {
case "String_Node_Str":
    if (!lastContents.isEmpty()) {
      int idx=Integer.parseInt(lastContents);
      return new StringSupplier(new XSSFRichTextString(sst.getEntryAt(idx)).toString());
    }
  return new StringSupplier(lastContents);
case "String_Node_Str":
return new StringSupplier(new XSSFRichTextString(lastContents).toString());
case "String_Node_Str":
return new StringSupplier('"' + lastContents + '"');
case "String_Node_Str":
return new StringSupplier("String_Node_Str" + lastContents);
case "String_Node_Str":
if (currentCell.getNumericFormat() != null && lastContents.length() > 0) {
final String currentLastContents=lastContents;
final int currentNumericFormatIndex=currentCell.getNumericFormatIndex();
final String currentNumericFormat=currentCell.getNumericFormat();
return new Supplier(){
String cachedContent;
@Override public Object getContent(){
if (cachedContent == null) {
  cachedContent=dataFormatter.formatRawCellContents(Double.parseDouble(currentLastContents),currentNumericFormatIndex,currentNumericFormat);
}
return cachedContent;
}
}
;
}
 else {
return new StringSupplier(lastContents);
}
default :
return new StringSupplier(lastContents);
}
}

Fixed version (ground truth):
/** 
 * Tries to format the contents of the last contents appropriately based on the type of cell and the discovered numeric format.
 * @return
 */
Supplier formattedContents(){
  return getFormatterForType(currentCell.getType());
}
Program: 29298
Project: 29298
Buggy source:
@Test public void testFormulaCells() throws Exception {
  try (InputStream is=new FileInputStream(new File("String_Node_Str"));Workbook workbook=StreamingReader.builder().open(is)){
    assertEquals(1,workbook.getNumberOfSheets());
    Sheet sheet=workbook.getSheetAt(0);
    Iterator<Row> rowIterator=sheet.rowIterator();
    rowIterator.next();
    rowIterator.next();
    Row row3=rowIterator.next();
    Cell A3=row3.getCell(0);
    assertEquals("String_Node_Str",CellType.FORMULA,A3.getCellTypeEnum());
    assertEquals("String_Node_Str",CellType.NUMERIC,A3.getCachedFormulaResultTypeEnum());
    assertEquals("String_Node_Str","String_Node_Str",A3.getCellFormula());
  }
 }

Fixed version (ground truth):
@Test public void testFormulaCells() throws Exception {
  try (Workbook workbook=openWorkbook("String_Node_Str")){
    assertEquals(1,workbook.getNumberOfSheets());
    Sheet sheet=workbook.getSheetAt(0);
    Iterator<Row> rowIterator=sheet.rowIterator();
    Cell A1=getCellFromNextRow(rowIterator,0);
    Cell A2=getCellFromNextRow(rowIterator,0);
    Cell A3=getCellFromNextRow(rowIterator,0);
    expectType(A3,FORMULA);
    expectCachedType(A3,NUMERIC);
    expectFormula(A3,"String_Node_Str");
    expectStringContent(A1,"String_Node_Str");
    expectStringContent(A2,"String_Node_Str");
    expectStringContent(A3,"String_Node_Str");
  }
 }
Program: 29300
Project: 29300
Buggy source:
/** 
 * Closes the streaming resource, attempting to clean up any temporary files created.
 */
@Override public void close(){
  if (tmp != null) {
    log.debug("String_Node_Str" + tmp.getAbsolutePath() + "String_Node_Str");
    tmp.delete();
  }
}

Fixed version (ground truth):
/** 
 * Closes the streaming resource, attempting to clean up any temporary files created.
 */
@Override public void close(){
  try {
    parser.close();
  }
 catch (  XMLStreamException e) {
    throw new CloseException(e);
  }
  if (tmp != null) {
    log.debug("String_Node_Str" + tmp.getAbsolutePath() + "String_Node_Str");
    tmp.delete();
  }
}
Program: 29301
Project: 29301
Buggy source:
@Override public final void handleWindow(Window window,int eventID){
  LoginManager.loginManager().setLoginFrame((JFrame)window);
  try {
    if (!initialise(window,eventID))     return;
    if (!setFields(window,eventID))     return;
    if (!preLogin(window,eventID))     return;
    doLogin(window);
  }
 catch (  IBControllerException e) {
    Utils.logError("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Override public final void handleWindow(Window window,int eventID){
  LoginManager.loginManager().setLoginFrame((JFrame)window);
  try {
    if (!initialise(window,eventID))     return;
    if (!setFields(window,eventID))     return;
    if (!preLogin(window,eventID))     return;
    doLogin(window);
  }
 catch (  IBControllerException e) {
    Utils.logError("String_Node_Str" + e.getMessage());
    System.exit(1);
  }
}
Program: 29302
Project: 29302
Buggy source:
private static void startTws(){
  if (Settings.settings().getBoolean("String_Node_Str",false)) {
    Utils.showTradesLogWindow();
  }
  String[] twsArgs=new String[1];
  twsArgs[0]=getTWSSettingsDirectory();
  try {
    jclient.LoginFrame.main(twsArgs);
  }
 catch (  Throwable t) {
    Utils.logError("String_Node_Str");
    t.printStackTrace(Utils.getErrStream());
    System.exit(1);
  }
}

Fixed version (ground truth):
private static void startTws(){
  ensureJtsIniExists();
  if (Settings.settings().getBoolean("String_Node_Str",false)) {
    Utils.showTradesLogWindow();
  }
  String[] twsArgs=new String[1];
  twsArgs[0]=getTWSSettingsDirectory();
  Utils.logToConsole("String_Node_Str" + twsArgs[0]);
  try {
    jclient.LoginFrame.main(twsArgs);
  }
 catch (  Throwable t) {
    Utils.logError("String_Node_Str");
    t.printStackTrace(Utils.getErrStream());
    System.exit(1);
  }
}
Program: 29303
Project: 29303
Buggy source:
private static void startGateway(){
  String[] twsArgs=new String[1];
  twsArgs[0]=getTWSSettingsDirectory();
  try {
    ibgateway.GWClient.main(twsArgs);
  }
 catch (  Throwable t) {
    Utils.logError("String_Node_Str");
    t.printStackTrace(Utils.getErrStream());
    System.exit(1);
  }
}

Fixed version (ground truth):
private static void startGateway(){
  String[] twsArgs=new String[1];
  twsArgs[0]=getTWSSettingsDirectory();
  Utils.logToConsole("String_Node_Str" + twsArgs[0]);
  try {
    ibgateway.GWClient.main(twsArgs);
  }
 catch (  Throwable t) {
    Utils.logError("String_Node_Str");
    t.printStackTrace(Utils.getErrStream());
    System.exit(1);
  }
}
Program: 29304
Project: 29304
Buggy source:
private static String getTWSSettingsDirectory(){
  String dir=Settings.settings().getString("String_Node_Str",System.getProperty("String_Node_Str"));
  Utils.logToConsole("String_Node_Str" + dir);
  return dir;
}

Fixed version (ground truth):
private static String getTWSSettingsDirectory(){
  return Settings.settings().getString("String_Node_Str",System.getProperty("String_Node_Str"));
}
Program: 29305
Project: 29305
Buggy source:
private static void rewriteExistingFile(){
  Utils.logToConsole("String_Node_Str" + jtsIniFile.getPath());
  boolean foundLogon=false;
  boolean foundIBGateway=false;
  try (BufferedWriter w=new BufferedWriter(new FileWriter(jtsIniFile))){
    ListIterator<String> it=lines.listIterator();
    int index=0;
    while (it.hasNext()) {
      index++;
      String l=it.next();
      if (l.compareTo(LogonSectionHeader) == 0) {
        foundLogon=true;
        index=processSection(lines,index,new String[]{S3storeTrueSetting,S3storeFalseSetting},w);
        it=lines.listIterator(index);
      }
 else       if (l.compareTo(IBGatewaySectionHeader) == 0) {
        foundIBGateway=true;
        index=processSection(lines,index,new String[]{ApiOnlyTrueSetting},w);
        it=lines.listIterator(index);
      }
 else {
        w.write(l);
        w.newLine();
      }
    }
    if (!foundLogon) {
      writeLogonSectionHeader(w);
      writeS3store(w);
    }
    if (!foundIBGateway) {
      writeIBGatewaySectionHeader(w);
      writeApiOnly(w);
    }
  }
 catch (  IOException e) {
    Utils.logError("String_Node_Str" + jtsIniFile.getPath() + "String_Node_Str"+ e.getMessage());
    System.exit(1);
  }
}

Fixed version (ground truth):
private static void rewriteExistingFile(){
  Utils.logToConsole("String_Node_Str" + jtsIniFile.getPath());
  boolean foundLogon=false;
  boolean foundIBGateway=false;
  try (BufferedWriter w=new BufferedWriter(new FileWriter(jtsIniFile))){
    ListIterator<String> it=lines.listIterator();
    int index=0;
    while (it.hasNext()) {
      index++;
      String l=it.next();
      if (l.compareTo(LogonSectionHeader) == 0) {
        writeIniFileLine(l,w);
        foundLogon=true;
        index=processSection(lines,index,new String[]{S3storeTrueSetting,S3storeFalseSetting},w);
        it=lines.listIterator(index);
      }
 else       if (l.compareTo(IBGatewaySectionHeader) == 0) {
        writeIniFileLine(l,w);
        foundIBGateway=true;
        index=processSection(lines,index,new String[]{ApiOnlyTrueSetting},w);
        it=lines.listIterator(index);
      }
 else {
        writeIniFileLine(l,w);
      }
    }
    if (!foundLogon) {
      writeLogonSectionHeader(w);
      writeS3store(w);
    }
    if (!foundIBGateway) {
      writeIBGatewaySectionHeader(w);
      writeApiOnly(w);
    }
  }
 catch (  IOException e) {
    Utils.logError("String_Node_Str" + jtsIniFile.getPath() + "String_Node_Str"+ e.getMessage());
    System.exit(1);
  }
}
Program: 29306
Project: 29306
Buggy source:
private static void writeApiOnly(BufferedWriter w) throws IOException {
  w.write(ApiOnlySetting);
  w.newLine();
}

Fixed version (ground truth):
private static void writeApiOnly(BufferedWriter w) throws IOException {
  writeIniFileLine(ApiOnlyTrueSetting,w);
}
Program: 29307
Project: 29307
Buggy source:
private static int processSection(List<String> lines,int startIndex,String[] settings,BufferedWriter w) throws IOException {
  int index=startIndex;
  boolean found=false;
  ListIterator<String> it=lines.listIterator(index);
  while (it.hasNext()) {
    index++;
    String l=it.next();
    for (    String s : settings) {
      if (l.compareTo(s) == 0) {
        found=true;
        break;
      }
    }
    if (l.startsWith("String_Node_Str")) {
      if (!found)       w.write(settings[0]);
      break;
    }
 else {
      w.write(l);
      w.newLine();
    }
  }
  return index;
}

Fixed version (ground truth):
private static int processSection(List<String> lines,int startIndex,String[] settings,BufferedWriter w) throws IOException {
  int index=startIndex;
  boolean found=false;
  ListIterator<String> it=lines.listIterator(index);
  while (it.hasNext()) {
    String l=it.next();
    for (    String s : settings) {
      if (l.compareTo(s) == 0) {
        found=true;
        break;
      }
    }
    if (l.isEmpty()) {
      index++;
    }
 else     if (l.startsWith("String_Node_Str")) {
      break;
    }
 else {
      writeIniFileLine(l,w);
      index++;
    }
  }
  if (!found)   writeIniFileLine(settings[0],w);
  writeIniFileLine("String_Node_Str",w);
  return index;
}
Program: 29308
Project: 29308
Buggy source:
private static boolean existingFileOk(){
  return (findSettingInSection(LogonSectionHeader,S3storeFalseSetting) || findSettingInSection(LogonSectionHeader,S3storeTrueSetting)) && findSettingInSection(IBGatewaySectionHeader,ApiOnlyTrueSetting);
}

Fixed version (ground truth):
private static boolean existingFileOk(){
  return (findSettingInSection(LogonSectionHeader,S3storeFalseSetting) || findSettingInSection(LogonSectionHeader,S3storeTrueSetting)) & findSettingInSection(IBGatewaySectionHeader,ApiOnlyTrueSetting);
}
Program: 29309
Project: 29309
Buggy source:
private static void writeLogonSectionHeader(BufferedWriter w) throws IOException {
  w.write(LogonSectionHeader);
  w.newLine();
}

Fixed version (ground truth):
private static void writeLogonSectionHeader(BufferedWriter w) throws IOException {
  writeIniFileLine(LogonSectionHeader,w);
}
Program: 29310
Project: 29310
Buggy source:
private static boolean findSettingInSection(String section,String setting){
  ListIterator<String> it=lines.listIterator();
  boolean error=false;
  while (it.hasNext() && !error) {
    String l=it.next();
    if (l.compareTo(section) == 0) {
      Utils.logToConsole("String_Node_Str" + section);
      while (it.hasNext() && !error) {
        l=it.next();
        if (l.startsWith("String_Node_Str")) {
          error=true;
        }
 else         if (l.compareTo(setting) == 0) {
          Utils.logToConsole("String_Node_Str" + setting);
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean findSettingInSection(String section,String setting){
  ListIterator<String> it=lines.listIterator();
  while (it.hasNext()) {
    String l=it.next();
    if (l.compareTo(section) == 0) {
      Utils.logToConsole("String_Node_Str" + section);
      while (it.hasNext()) {
        l=it.next();
        if (l.startsWith("String_Node_Str")) {
          break;
        }
 else         if (l.compareTo(setting) == 0) {
          Utils.logToConsole("String_Node_Str" + setting);
          return true;
        }
      }
      Utils.logToConsole("String_Node_Str" + setting);
      return false;
    }
  }
  Utils.logToConsole("String_Node_Str" + section);
  return false;
}
Program: 29311
Project: 29311
Buggy source:
private static void writeS3store(BufferedWriter w) throws IOException {
  w.write(S3storeTrueSetting);
  w.newLine();
}

Fixed version (ground truth):
private static void writeS3store(BufferedWriter w) throws IOException {
  writeIniFileLine(S3storeTrueSetting,w);
}
Program: 29312
Project: 29312
Buggy source:
private static void writeIBGatewaySectionHeader(BufferedWriter w) throws IOException {
  w.write(IBGatewaySectionHeader);
  w.newLine();
}

Fixed version (ground truth):
private static void writeIBGatewaySectionHeader(BufferedWriter w) throws IOException {
  writeIniFileLine(IBGatewaySectionHeader,w);
}
Program: 29313
Project: 29313
Buggy source:
protected final void setTradingModeCombo(final Window window){
  if (SwingUtils.findLabel(window,"String_Node_Str") != null) {
    JComboBox<?> tradingModeCombo=SwingUtils.findComboBox(window,0);
    if (tradingModeCombo != null) {
      String tradingMode=TradingModeManager.tradingModeManager().getTradingMode();
      Utils.logToConsole("String_Node_Str" + tradingMode);
      if (tradingMode.equalsIgnoreCase(TradingModeManager.TRADING_MODE_LIVE)) {
        tradingModeCombo.setSelectedItem("String_Node_Str");
      }
 else {
        tradingModeCombo.setSelectedItem("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
protected final void setTradingModeCombo(final Window window){
  if (SwingUtils.findLabel(window,"String_Node_Str") != null) {
    JComboBox<?> tradingModeCombo;
    if (Settings.settings().getBoolean("String_Node_Str",false)) {
      tradingModeCombo=SwingUtils.findComboBox(window,1);
    }
 else {
      tradingModeCombo=SwingUtils.findComboBox(window,0);
    }
    if (tradingModeCombo != null) {
      String tradingMode=TradingModeManager.tradingModeManager().getTradingMode();
      Utils.logToConsole("String_Node_Str" + tradingMode);
      if (tradingMode.equalsIgnoreCase(TradingModeManager.TRADING_MODE_LIVE)) {
        tradingModeCombo.setSelectedItem("String_Node_Str");
      }
 else {
        tradingModeCombo.setSelectedItem("String_Node_Str");
      }
    }
  }
}
Program: 29314
Project: 29314
Buggy source:
static void setupDefaultEnvironment(final String[] args,final boolean isGateway) throws Exception {
  Environment.load(new Callable<Settings>(){
    @Override public Settings call(){
      return new DefaultSettings(getSettingsPath(args));
    }
  }
,new Callable<LoginManager>(){
    @Override public LoginManager call(){
      return new DefaultLoginManager(args);
    }
  }
,new Callable<MainWindowManager>(){
    @Override public MainWindowManager call(){
      return new DefaultMainWindowManager(isGateway);
    }
  }
,new Callable<ConfigDialogManager>(){
    @Override public ConfigDialogManager call(){
      return new DefaultConfigDialogManager(isGateway);
    }
  }
,new Callable<TradingModeManager>(){
    @Override public TradingModeManager call(){
      return new DefaultTradingModeManager(args);
    }
  }
);
}

Fixed version (ground truth):
static void setupDefaultEnvironment(final String[] args,final boolean isGateway) throws Exception {
  Environment.load(new Callable<Settings>(){
    @Override public Settings call(){
      return new DefaultSettings(getSettingsPath(args));
    }
  }
,new Callable<LoginManager>(){
    @Override public LoginManager call(){
      return new DefaultLoginManager(args);
    }
  }
,new Callable<MainWindowManager>(){
    @Override public MainWindowManager call(){
      return new DefaultMainWindowManager(isGateway);
    }
  }
,new Callable<ConfigDialogManager>(){
    @Override public ConfigDialogManager call(){
      return new DefaultConfigDialogManager();
    }
  }
,new Callable<TradingModeManager>(){
    @Override public TradingModeManager call(){
      return new DefaultTradingModeManager(args);
    }
  }
);
}
Program: 29315
Project: 29315
Buggy source:
/** 
 * starts up the TWS app.
 * @param args -If length == 1, then args[0] is the path to the ini file. If length == 0, we assume that the ini file is located in the current user directory in a file called "IBController.ini". If length == 2 and args[0] is "encrypt", we print out the encryption of args[1].
 * @throws java.lang.Exception
 */
public static void main(final String[] args) throws Exception {
  checkArguments(args);
  setupDefaultEnvironment(args,false);
  load(false);
}

Fixed version (ground truth):
public static void main(final String[] args) throws Exception {
  checkArguments(args);
  setupDefaultEnvironment(args,false);
  load();
}
Program: 29316
Project: 29316
Buggy source:
public static void load(boolean isGateway){
  printProperties();
  Environment.verify();
  startIBControllerServer(isGateway);
  startShutdownTimerIfRequired(isGateway);
  createToolkitListener();
  startSavingTwsSettingsAutomatically();
  startTwsOrGateway(isGateway);
}

Fixed version (ground truth):
public static void load(){
  printProperties();
  Environment.verify();
  boolean isGateway=Environment.mainWindowManager().isGateway();
  startIBControllerServer(isGateway);
  startShutdownTimerIfRequired(isGateway);
  createToolkitListener();
  startSavingTwsSettingsAutomatically();
  startTwsOrGateway(isGateway);
}
Program: 29317
Project: 29317
Buggy source:
public IBController(){
  super();
}

Fixed version (ground truth):
/** 
 * starts up the TWS app.
 * @param args -If length == 1, then args[0] is the path to the ini file. If length == 0, we assume that the ini file is located in the current user directory in a file called "IBController.ini". If length == 2 and args[0] is "encrypt", we print out the encryption of args[1].
 * @throws java.lang.Exception
 */
private IBController(){
}
Program: 29318
Project: 29318
Buggy source:
public static void main(String[] args) throws Exception {
  checkArguments(args);
  setupDefaultEnvironment(args,true);
  IBController.load(true);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  checkArguments(args);
  setupDefaultEnvironment(args,true);
  IBController.load();
}
Program: 29320
Project: 29320
Buggy source:
@Override protected void doGen(CodeBuilder cb){
  Label noLogger=new Label();
  hasLogger.gen(cb);
  cb.ifZCmp(EQ,noLogger);
  enterStatement.gen(cb);
  if (hasLogonlyExpression) {
    Label bodyLabel=new Label();
    cb.goTo(bodyLabel);
    cb.mark(noLogger);
    logonlyExpression.gen(cb);
    cb.ifZCmp(EQ,bodyLabel);
    cb.throwException(BytecodeUtils.ILLEGAL_STATE_EXCEPTION_TYPE,"String_Node_Str");
    cb.mark(bodyLabel);
  }
 else {
    cb.mark(noLogger);
  }
  body.gen(cb);
  Label end=new Label();
  hasLogger.gen(cb);
  cb.ifZCmp(EQ,end);
  exitStatement.gen(cb);
  cb.mark(end);
}

Fixed version (ground truth):
@Override protected void doGen(CodeBuilder cb){
  cb.mark(restartPoint);
  logonlyExpression.gen(cb);
  Label noLogger=new Label();
  hasLogger.gen(cb);
  cb.ifZCmp(EQ,noLogger);
  cb.pushLong(node.getLoggingId());
  cb.dup2X1();
  cb.pop2();
  configExpression.gen(cb);
  cb.swap();
  MethodRef.LOG_STATEMENT_CREATE.invokeUnchecked(cb);
  appendable.gen(cb);
  cb.swap();
  AppendableExpression.ENTER_LOGGABLE_STATEMENT.invokeUnchecked(cb);
  cb.pop();
  Label bodyLabel=new Label();
  cb.goTo(bodyLabel);
  cb.mark(noLogger);
  cb.ifZCmp(EQ,bodyLabel);
  cb.throwException(BytecodeUtils.ILLEGAL_STATE_EXCEPTION_TYPE,"String_Node_Str");
  cb.mark(bodyLabel);
  body.gen(cb);
  exitStatement.gen(cb);
}
Program: 29321
Project: 29321
Buggy source:
/** 
 * Return whether the given root node is a constant expression or not. Pure functions are considered constant iff their parameter is a constant expression.
 * @param rootSoyNode the root of the expression tree.
 * @return {@code true} if the expression is constant in evaluation, {@code false} otherwise.
 */
public static boolean isConstantExpr(ExprNode rootSoyNode){
class ConstantNodeVisitor implements NodeVisitor<Node,VisitDirective> {
    boolean isConstant=true;
    @Override public VisitDirective exec(    Node node){
switch (((ExprNode)node).getKind()) {
case VAR_REF_NODE:
        isConstant=false;
      return VisitDirective.ABORT;
case FUNCTION_NODE:
    FunctionNode fn=(FunctionNode)node;
  if (fn.getSoyFunction() != null && fn.getSoyFunction().getClass().isAnnotationPresent(SoyPureFunction.class)) {
    return VisitDirective.CONTINUE;
  }
 else {
    return VisitDirective.ABORT;
  }
default :
return VisitDirective.CONTINUE;
}
}
}
ConstantNodeVisitor visitor=new ConstantNodeVisitor();
visitAllNodes(rootSoyNode,visitor);
return visitor.isConstant;
}

Fixed version (ground truth):
/** 
 * Return whether the given root node is a constant expression or not. Pure functions are considered constant iff their parameter is a constant expression.
 * @param rootSoyNode the root of the expression tree.
 * @return {@code true} if the expression is constant in evaluation, {@code false} otherwise.
 */
public static boolean isConstantExpr(ExprNode rootSoyNode){
class ConstantNodeVisitor implements NodeVisitor<Node,VisitDirective> {
    boolean isConstant=true;
    @Override public VisitDirective exec(    Node node){
switch (((ExprNode)node).getKind()) {
case VAR_REF_NODE:
        isConstant=false;
      return VisitDirective.ABORT;
case FUNCTION_NODE:
    FunctionNode fn=(FunctionNode)node;
  if (fn.getSoyFunction() != null && fn.getSoyFunction().getClass().isAnnotationPresent(SoyPureFunction.class)) {
    return VisitDirective.CONTINUE;
  }
 else {
    isConstant=false;
    return VisitDirective.ABORT;
  }
default :
return VisitDirective.CONTINUE;
}
}
}
ConstantNodeVisitor visitor=new ConstantNodeVisitor();
visitAllNodes(rootSoyNode,visitor);
return visitor.isConstant;
}
Program: 29322
Project: 29322
Buggy source:
@Override public VisitDirective exec(Node node){
switch (((ExprNode)node).getKind()) {
case VAR_REF_NODE:
    isConstant=false;
  return VisitDirective.ABORT;
case FUNCTION_NODE:
FunctionNode fn=(FunctionNode)node;
if (fn.getSoyFunction() != null && fn.getSoyFunction().getClass().isAnnotationPresent(SoyPureFunction.class)) {
return VisitDirective.CONTINUE;
}
 else {
return VisitDirective.ABORT;
}
default :
return VisitDirective.CONTINUE;
}
}

Fixed version (ground truth):
@Override public VisitDirective exec(Node node){
switch (((ExprNode)node).getKind()) {
case VAR_REF_NODE:
    isConstant=false;
  return VisitDirective.ABORT;
case FUNCTION_NODE:
FunctionNode fn=(FunctionNode)node;
if (fn.getSoyFunction() != null && fn.getSoyFunction().getClass().isAnnotationPresent(SoyPureFunction.class)) {
return VisitDirective.CONTINUE;
}
 else {
isConstant=false;
return VisitDirective.ABORT;
}
default :
return VisitDirective.CONTINUE;
}
}
Program: 29323
Project: 29323
Buggy source:
@Test public final void testIsNonConstantExpr() throws Exception {
  String testFileContent="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  SoyFileSetNode soyTree=SoyFileSetParserBuilder.forFileContents(testFileContent).addSoyFunction(ASSERT_IS_NONCONST_FUNCTION).parse().fileSet();
  assertIsConsts(soyTree);
}

Fixed version (ground truth):
@Test public final void testIsNonConstantExpr() throws Exception {
  String testFileContent="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  SoyFileSetNode soyTree=SoyFileSetParserBuilder.forFileContents(testFileContent).addSoyFunction(ASSERT_IS_NONCONST_FUNCTION).addSoyFunction(NONPURE_FUNCTION).parse().fileSet();
  assertIsConsts(soyTree);
}
Program: 29324
Project: 29324
Buggy source:
/** 
 * Converts the parameter to a   {@link SoyMap}. 
 */
public static SoyMap legacyObjectMapToMap(SoyLegacyObjectMap map){
  ImmutableMap.Builder<SoyValue,SoyValueProvider> builder=ImmutableMap.builder();
  for (  SoyValue key : map.getItemKeys()) {
    builder.put(key,map.getItemProvider(key));
  }
  return SoyMapImpl.forProviderMap(builder.build());
}

Fixed version (ground truth):
/** 
 * Converts the parameter to a   {@link SoyMap}. 
 */
public static SoyMap legacyObjectMapToMap(SoyLegacyObjectMap map){
  Map<SoyValue,SoyValueProvider> newMap=new LinkedHashMap<>();
  for (  SoyValue key : map.getItemKeys()) {
    newMap.put(key,map.getItemProvider(key));
  }
  return SoyMapImpl.forProviderMap(newMap);
}
Program: 29325
Project: 29325
Buggy source:
private SoyMapImpl(Map<? extends SoyValue,? extends SoyValueProvider> providerMap){
  this.providerMap=ImmutableMap.copyOf(checkNotNull(providerMap));
}

Fixed version (ground truth):
private SoyMapImpl(Map<? extends SoyValue,? extends SoyValueProvider> providerMap){
  checkNotNull(providerMap);
  if (providerMap.containsKey(null)) {
    throw new IllegalArgumentException(String.format("String_Node_Str",providerMap.get(null)));
  }
  this.providerMap=Collections.unmodifiableMap(providerMap);
}
Program: 29326
Project: 29326
Buggy source:
@Override public int hashCode(){
  return getValue().hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  return stringValue().hashCode();
}
Program: 29328
Project: 29328
Buggy source:
@Test public void testUnsanitizedText(){
  assertThat(SanitizedContents.unsanitizedText("String_Node_Str")).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.TEXT,null));
}

Fixed version (ground truth):
@Test public void testUnsanitizedText(){
  SanitizedContent unsanitized=SanitizedContents.unsanitizedText("String_Node_Str");
  assertThat(unsanitized.getContent()).isEqualTo("String_Node_Str");
  assertThat(unsanitized.getContentKind()).isEqualTo(ContentKind.TEXT);
  assertThat(unsanitized.getContentDirection()).isEqualTo(null);
}
Program: 29329
Project: 29329
Buggy source:
@Test public void testOrdainAsSafeWithDir(){
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.TEXT,Dir.LTR)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.TEXT,Dir.LTR));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.TEXT,Dir.RTL)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.TEXT,Dir.RTL));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.TEXT,Dir.NEUTRAL)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.TEXT,Dir.NEUTRAL));
}

Fixed version (ground truth):
@Test public void testOrdainAsSafeWithDir(){
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.TEXT,Dir.LTR)).isEqualTo(SanitizedContents.unsanitizedText("String_Node_Str",Dir.LTR));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.TEXT,Dir.RTL)).isEqualTo(SanitizedContents.unsanitizedText("String_Node_Str",Dir.RTL));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.TEXT,Dir.NEUTRAL)).isEqualTo(SanitizedContents.unsanitizedText("String_Node_Str",Dir.NEUTRAL));
}
Program: 29330
Project: 29330
Buggy source:
@Test public void testOrdainAsSafe(){
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.TEXT)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.TEXT,null));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.HTML)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.HTML,null));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.JS)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.JS,Dir.LTR));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.CSS)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.CSS,Dir.LTR));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.URI)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.URI,Dir.LTR));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.ATTRIBUTES)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.ATTRIBUTES,Dir.LTR));
}

Fixed version (ground truth):
@Test public void testOrdainAsSafe(){
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.TEXT)).isEqualTo(SanitizedContents.unsanitizedText("String_Node_Str",null));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.HTML)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.HTML,null));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.JS)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.JS,Dir.LTR));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.CSS)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.CSS,Dir.LTR));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.URI)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.URI,Dir.LTR));
  assertThat(UnsafeSanitizedContentOrdainer.ordainAsSafe("String_Node_Str",ContentKind.ATTRIBUTES)).isEqualTo(SanitizedContent.create("String_Node_Str",ContentKind.ATTRIBUTES,Dir.LTR));
}
Program: 29331
Project: 29331
Buggy source:
/** 
 * Helper for   {@code setSoyDoc()} and {@code setHeaderDecls()}. This method is intended to be called at most once for SoyDoc params and at most once for header params.
 * @param params The params to add.
 */
public TemplateNodeBuilder addParams(Iterable<? extends TemplateParam> newParams){
  Set<String> seenParamKeys=new HashSet<>();
  boolean hasTemplateHeaderParams=false;
  if (this.params == null) {
    this.params=ImmutableList.copyOf(newParams);
  }
 else {
    for (    TemplateParam oldParam : this.params) {
      seenParamKeys.add(oldParam.name());
      hasTemplateHeaderParams|=oldParam.declLoc() == TemplateParam.DeclLoc.HEADER;
    }
    this.params=ImmutableList.<TemplateParam>builder().addAll(this.params).addAll(newParams).build();
  }
  for (  TemplateParam param : newParams) {
    hasTemplateHeaderParams|=param.declLoc() == TemplateParam.DeclLoc.HEADER;
    if (param.name().equals("String_Node_Str")) {
      errorReporter.report(param.nameLocation(),INVALID_PARAM_NAMED_IJ);
    }
    if (!seenParamKeys.add(param.name())) {
      errorReporter.report(param.nameLocation(),PARAM_ALREADY_DECLARED,param.name());
    }
  }
  if (hasTemplateHeaderParams) {
    for (    TemplateParam param : this.params) {
      if (param.declLoc() == TemplateParam.DeclLoc.SOY_DOC) {
        errorReporter.report(param.nameLocation(),MIXED_PARAM_STYLES);
      }
    }
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Helper for   {@code setSoyDoc()} and {@code setHeaderDecls()}. This method is intended to be called at most once for SoyDoc params and at most once for header params.
 * @param params The params to add.
 */
public TemplateNodeBuilder addParams(Iterable<? extends TemplateParam> newParams){
  Set<String> seenParamKeys=new HashSet<>();
  boolean hasTemplateHeaderParams=false;
  if (this.params == null) {
    this.params=ImmutableList.copyOf(newParams);
  }
 else {
    for (    TemplateParam oldParam : this.params) {
      seenParamKeys.add(oldParam.name());
      hasTemplateHeaderParams|=oldParam.declLoc() == TemplateParam.DeclLoc.HEADER;
    }
    this.params=ImmutableList.<TemplateParam>builder().addAll(this.params).addAll(newParams).build();
  }
  for (  TemplateParam param : newParams) {
    hasTemplateHeaderParams|=param.declLoc() == TemplateParam.DeclLoc.HEADER;
    if (param.name().equals("String_Node_Str")) {
      errorReporter.report(param.nameLocation(),INVALID_PARAM_NAMED_IJ);
    }
    if (!seenParamKeys.add(param.name())) {
      errorReporter.report(param.nameLocation(),PARAM_ALREADY_DECLARED,param.name());
    }
  }
  if (hasTemplateHeaderParams) {
    for (    TemplateParam param : this.params) {
      if (param.declLoc() == TemplateParam.DeclLoc.SOY_DOC && !DISABLE_MIXED_PARAMS_ERROR_FOR_MIGRATION) {
        errorReporter.report(param.nameLocation(),MIXED_PARAM_STYLES,param.nameLocation().getFilePath());
      }
    }
  }
  return this;
}
Program: 29332
Project: 29332
Buggy source:
/** 
 * Sets the internal state to   {@link Type#MAP}. If the state has already been set, throws an exception.
 */
public void maybeSetMapType(){
  if (type == Type.UNKNOWN) {
    type=Type.MAP;
  }
 else   if (type == Type.LEGACY_OBJECT_MAP_OR_RECORD) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Sets the internal state to   {@link Type#MAP}. If the state has already been set, throws an exception.
 */
public void maybeSetMapType(){
  if (type == Type.UNKNOWN) {
    type=Type.MAP;
  }
 else   if (type == Type.LEGACY_OBJECT_MAP_OR_RECORD) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
}
Program: 29333
Project: 29333
Buggy source:
/** 
 * Sets the internal state to   {@link Type#LEGACY_OBJECT_MAP_OR_RECORD}. If the state has already been set, throws an exception.
 */
public void maybeSetLegacyObjectMapOrRecordType(){
  if (type == Type.UNKNOWN) {
    type=Type.LEGACY_OBJECT_MAP_OR_RECORD;
  }
 else   if (type == Type.MAP) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Sets the internal state to   {@link Type#LEGACY_OBJECT_MAP_OR_RECORD}. If the state has already been set, throws an exception.
 */
public void maybeSetLegacyObjectMapOrRecordType(){
  if (type == Type.UNKNOWN) {
    type=Type.LEGACY_OBJECT_MAP_OR_RECORD;
  }
 else   if (type == Type.MAP) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
}
Program: 29334
Project: 29334
Buggy source:
@Test public void testMapInteroperability(){
  Map<String,SoyValueProvider> providerMap=new HashMap<>();
  DictImpl dict=DictImpl.forProviderMap(providerMap,RuntimeMapTypeTracker.Type.UNKNOWN);
  assertThat(dict.size()).isEqualTo(0);
  try {
    dict.getItemCnt();
    fail();
  }
 catch (  IllegalStateException e) {
    assertThat(e).hasMessageThat().isEqualTo("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  }
  dict=DictImpl.forProviderMap(providerMap,RuntimeMapTypeTracker.Type.UNKNOWN);
  assertThat(dict.getItemCnt()).isEqualTo(0);
  try {
    dict.keys();
    fail();
  }
 catch (  IllegalStateException e) {
    assertThat(e).hasMessageThat().isEqualTo("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void testMapInteroperability(){
  Map<String,SoyValueProvider> providerMap=new HashMap<>();
  DictImpl dict=DictImpl.forProviderMap(providerMap,RuntimeMapTypeTracker.Type.UNKNOWN);
  assertThat(dict.size()).isEqualTo(0);
  try {
    dict.getItemCnt();
    fail();
  }
 catch (  IllegalStateException e) {
    assertThat(e).hasMessageThat().isEqualTo("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  dict=DictImpl.forProviderMap(providerMap,RuntimeMapTypeTracker.Type.UNKNOWN);
  assertThat(dict.getItemCnt()).isEqualTo(0);
  try {
    dict.keys();
    fail();
  }
 catch (  IllegalStateException e) {
    assertThat(e).hasMessageThat().isEqualTo("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
}
Program: 29335
Project: 29335
Buggy source:
/** 
 * Returns what kind of type this is. 
 */
Kind getKind();

Fixed version (ground truth):
/** 
 * Returns what kind of type this is. 
 */
public abstract Kind getKind();