nus-yam/ex-repair huggingface dataset:
Program: 36950
Project: 36950
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  mHandler=new Handler();
  mToneGenerator=new ToneGenerator(AudioManager.STREAM_VOICE_CALL,SipConstants.RINGING_VOLUME);
  mBroadcastManager=LocalBroadcastManager.getInstance(this);
  PhoneAccount phoneAccount=new JsonStorage<PhoneAccount>(this).get(PhoneAccount.class);
  if (phoneAccount != null) {
    loadPjsip();
    mEndpoint=createEndpoint(pjsip_transport_type_e.PJSIP_TRANSPORT_UDP,createTransportConfig(getResources().getInteger(R.integer.sip_port)));
    if (mEndpoint != null) {
      setCodecPrio();
      AuthCredInfo credInfo=new AuthCredInfo("String_Node_Str","String_Node_Str",phoneAccount.getAccountId(),0,phoneAccount.getPassword());
      AccountConfig accountConfig=createAccountConfig(SipUri.build(this,phoneAccount.getAccountId()),SipUri.buildRegistrar(this),credInfo);
      mSipAccount=createSipAccount(accountConfig,this,this);
      setupCallInteractionReceiver();
      setupKeyPadInteractionReceiver();
    }
 else {
      Log.e(TAG,"String_Node_Str");
    }
  }
 else {
    broadcast(SipConstants.SIP_SERVICE_HAS_NO_ACCOUNT);
    stopSelf();
  }
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  mHandler=new Handler();
  mToneGenerator=new ToneGenerator(AudioManager.STREAM_VOICE_CALL,SipConstants.RINGING_VOLUME);
  mBroadcastManager=LocalBroadcastManager.getInstance(this);
  PhoneAccount phoneAccount=new JsonStorage<PhoneAccount>(this).get(PhoneAccount.class);
  if (phoneAccount != null) {
    loadPjsip();
    pjsip_transport_type_e transportType=pjsip_transport_type_e.PJSIP_TRANSPORT_UDP;
    String sipTransport=this.getString(R.string.sip_transport_type);
    String tcp="String_Node_Str";
    if (sipTransport.equals("String_Node_Str")) {
      transportType=pjsip_transport_type_e.PJSIP_TRANSPORT_TCP;
      tcp="String_Node_Str";
    }
    mEndpoint=createEndpoint(transportType,createTransportConfig(getResources().getInteger(R.integer.sip_port)));
    if (mEndpoint != null) {
      setCodecPrio();
      AuthCredInfo credInfo=new AuthCredInfo(this.getString(R.string.sip_auth_scheme),this.getString(R.string.sip_auth_realm),phoneAccount.getAccountId(),0,phoneAccount.getPassword());
      String sipAccountRegId=SipUri.sipAddress(this,phoneAccount.getAccountId()) + tcp;
      String sipRegistratUri=SipUri.prependSIPUri(this,this.getString(R.string.sip_host)) + tcp;
      AccountConfig accountConfig=createAccountConfig(sipAccountRegId,sipRegistratUri,credInfo);
      mSipAccount=createSipAccount(accountConfig,this,this);
      setupCallInteractionReceiver();
      setupKeyPadInteractionReceiver();
    }
 else {
      Log.e(TAG,"String_Node_Str");
    }
  }
 else {
    broadcast(SipConstants.SIP_SERVICE_HAS_NO_ACCOUNT);
    stopSelf();
  }
}
Program: 36951
Project: 36951
Buggy source:
private AccountConfig createAccountConfig(Uri idUri,Uri registrarUri,AuthCredInfo credInfo){
  AccountConfig config=new AccountConfig();
  config.setIdUri(idUri.toString());
  config.getRegConfig().setRegistrarUri(registrarUri.toString());
  config.getSipConfig().getAuthCreds().add(credInfo);
  return config;
}

Fixed version (ground truth):
private AccountConfig createAccountConfig(String idUri,String registrarUri,AuthCredInfo credInfo){
  AccountConfig config=new AccountConfig();
  config.setIdUri(idUri);
  config.getRegConfig().setRegistrarUri(registrarUri);
  config.getSipConfig().getAuthCreds().add(credInfo);
  config.getSipConfig().getProxies().add(registrarUri);
  return config;
}
Program: 36952
Project: 36952
Buggy source:
private void callVisibleForUser(Call call,String type,String number,String callerId){
  Intent intent=new Intent(this,CallActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  intent.setDataAndType(SipUri.build(this,number),type);
  intent.putExtra(CallActivity.CONTACT_NAME,callerId);
  intent.putExtra(CallActivity.PHONE_NUMBER,number);
  startActivity(intent);
}

Fixed version (ground truth):
private void callVisibleForUser(Call call,String type,String number,String callerId){
  Intent intent=new Intent(this,CallActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  Uri sipAddressUri=SipUri.sipAddressUri(this,PhoneNumberUtils.format(number));
  intent.setDataAndType(sipAddressUri,type);
  intent.putExtra(CallActivity.CONTACT_NAME,callerId);
  intent.putExtra(CallActivity.PHONE_NUMBER,number);
  startActivity(intent);
}
Program: 36953
Project: 36953
Buggy source:
/** 
 * Setup a call using SIP
 * @param number
 * @param contactName
 */
private void callWithSip(String number,String contactName){
  Intent intent=new Intent(mContext,SipService.class);
  intent.setAction(SipConstants.ACTION_VIALER_OUTGOING);
  intent.setData(SipUri.build(mContext,number));
  intent.putExtra(SipConstants.EXTRA_PHONE_NUMBER,number);
  intent.putExtra(SipConstants.EXTRA_CONTACT_NAME,contactName);
  mContext.startService(intent);
  mAnalyticsHelper.send(mContext.getString(R.string.analytics_dimension),mContext.getString(R.string.analytics_event_category_call),mContext.getString(R.string.analytics_event_action_outbound),mContext.getString(R.string.analytics_event_label_sip));
}

Fixed version (ground truth):
/** 
 * Setup a call using SIP
 * @param number
 * @param contactName
 */
private void callWithSip(String number,String contactName){
  Intent intent=new Intent(mContext,SipService.class);
  intent.setAction(SipConstants.ACTION_VIALER_OUTGOING);
  Uri sipAddressUri=SipUri.sipAddressUri(mContext,PhoneNumberUtils.format(number));
  intent.setData(sipAddressUri);
  intent.putExtra(SipConstants.EXTRA_PHONE_NUMBER,number);
  intent.putExtra(SipConstants.EXTRA_CONTACT_NAME,contactName);
  mContext.startService(intent);
  mAnalyticsHelper.send(mContext.getString(R.string.analytics_dimension),mContext.getString(R.string.analytics_event_category_call),mContext.getString(R.string.analytics_event_action_outbound),mContext.getString(R.string.analytics_event_label_sip));
}
Program: 36954
Project: 36954
Buggy source:
/** 
 * Function to get the phone linked to the user.
 * @return PhoneAccount object or null.
 */
public PhoneAccount getLinkedPhoneAccount(){
  Call<SystemUser> call=mApi.systemUser();
  PhoneAccount phoneAccount=null;
  try {
    Response<SystemUser> response=call.execute();
    if (response.isSuccess() && response.body() != null) {
      SystemUser systemUser=response.body();
      mPreferences.setSipPermission(systemUser.hasSipPermission());
      String phoneAccountId=systemUser.getPhoneAccountId();
      if (phoneAccountId != null) {
        Call<PhoneAccount> phoneAccountCall=mApi.phoneAccount(phoneAccountId);
        Response<PhoneAccount> phoneAccountResponse=phoneAccountCall.execute();
        if (phoneAccountResponse.isSuccess() && phoneAccountResponse.body() != null) {
          phoneAccount=phoneAccountResponse.body();
        }
      }
    }
  }
 catch (  IOException e) {
    return phoneAccount;
  }
  return phoneAccount;
}

Fixed version (ground truth):
/** 
 * Function to get the phone linked to the user.
 * @return PhoneAccount object or null.
 */
public PhoneAccount getLinkedPhoneAccount(){
  Call<SystemUser> call=mApi.systemUser();
  PhoneAccount phoneAccount=null;
  try {
    Response<SystemUser> response=call.execute();
    if (response.isSuccess() && response.body() != null) {
      SystemUser systemUser=response.body();
      mPreferences.setSipPermission(systemUser.hasSipPermission());
      String phoneAccountId=systemUser.getPhoneAccountId();
      if (phoneAccountId != null) {
        Call<PhoneAccount> phoneAccountCall=mApi.phoneAccount(phoneAccountId);
        Response<PhoneAccount> phoneAccountResponse=phoneAccountCall.execute();
        if (phoneAccountResponse.isSuccess() && phoneAccountResponse.body() != null) {
          phoneAccount=phoneAccountResponse.body();
        }
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return phoneAccount;
}
Program: 36956
Project: 36956
Buggy source:
public static void main(String[] args){
  GetContentFeaturesARFF sp=new GetContentFeaturesARFF();
  int[] table_array={7,36,115,394,428,440,464,765,766,771,799,944,1062,1091,1098,1102,1111,1112,1127,1170,1181,1209,1217,1243,1274,1277,1279,1280,1285,1296,1297,1309,1390,1423,1424,1425,1465,1466,1486,1515,1517,1544,1551,1585,1618,1624,1635,1664,1676,1764,1792,1800,1838,1871,1875,1916,1930,1947,1951,1958,1959,1962,1963,1978,2013,2027,2045,2066,2161,2171,2249,2279,2286,2295,2316,2338,2374,2406,2532,2662,2699,2750,2778,2782,2885,2888,2923,3155,3156,3162,3176,3251,3333,3338,3369,3371,3378,3379,3391,3399,3400,3419,3420,3478,3479,3484,3514,3543,3558,3592,3661,3736,3762,3766,3811,3829,3848,3849,3888,3931,3979,4004,4019,4025,4028,4055,4068,4093,4111,4136,4163,4202,4205,4206,4209,4223,4227,4312,4350,4351,4359,4379,4380,4385,4406,4442,4485,4496,4532,4552,4559,4588,4589,4594,4595,4596,4610,4615,4617,4625,4629,4650,4664,4672,4673,4674,4675,4682,4726,4781,4798,4850,4859,4882,4883,4923,4947,4963,4973,4975,4987,4988,4999,5000,5063,5092,5093,5106,5186,5226,5240,5243,5284,5305,5322,8049,8071,8107,8117,8139,8148,293,653,1048,1658,1862,2466,2467,3272,3985,3986,4127,4868,4901,4951,5292,5602,6186,6857,7052,7103,7104,7105,7506,7507,7508,7509,7961,8163,8446,9505,11072,12375,12465,12466,12519,12559};
  sp.ProcessTables(table_array);
}

Fixed version (ground truth):
public static void main(String[] args){
  GetContentFeaturesARFF sp=new GetContentFeaturesARFF();
  int[] table_array={8929,5409,3286,3623,3020,3357,8266,1887,2914,5230,9895,9271,11081,5396,12031,8454,3472,2588,2186,6461,12513,4319,11237,169,262,2544,6936,7798,4505,4787,585,10154,4090,7574,1282,10317,11573,4838,9745,795,5905,8141,6466,1496,8121,10681,12193,5049,4429,7906,12621,7455,1463,5753,8516,604,1645,6212,7154,4271,5652,3777,4949,11019,6066,4120,821,5287,6403,1940,3421,845,1074,3236,11668,12249,7641,3219,4176,6310,7979,10274,1939,151,8912,10566,12663,2904,2747,5175,10258,9669,11743,3469,9870,7296,6597,1941,6677,538,9700,3505,7815,2473,6435,3717,11334,4220,11252,11300,1331,4151,5556,4875,7155,3041,4234,7712,12040,6712,8259,5729,481,8377,4092,8947,9528,2538,1328,1773,3619,1034,11430,2922,8663,10376,2647,4449,3704,6338,7500,5417,879,3493,11560,8416,8513,4243,9400,4037,4919,11843,7535,5707,2015,1257,4075,5919,647,6539,6886,7635,6732,8662,2207,3573,7060,8799,8198,1018,498,3962,411,4018,8485,801,7224,3168,5354,8369,4493,10290,3614,6877,7091,132,2090,10429,7348,1859,732,6385,424,220,11978,1136,546,5765,2883,8543,8666,7947,16,4519,8076,11375,12771,3101,5080,1808,1493,2050,11525,5318,3821};
  sp.ProcessTables(table_array);
}
Program: 36957
Project: 36957
Buggy source:
/** 
 * Read table caption.
 * @param tablexmlNode the tablexml node
 * @return the string
 */
public String readTableCaption(Element tablexmlNode){
  String caption="String_Node_Str";
  List<Element> nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  Elements inDivChild=tablexmlNode.parent().getAllElements().first().children();
  for (int i=0; i < inDivChild.size(); i++) {
    Element el=inDivChild.get(i);
    if (i + 1 < inDivChild.size()) {
      Element tableel=inDivChild.get(i + 1);
      if (tableel.tagName().equals("String_Node_Str")) {
        caption=el.text();
      }
    }
  }
  nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  return caption;
}

Fixed version (ground truth):
/** 
 * Read table caption.
 * @param tablexmlNode the tablexml node
 * @return the string
 */
public String readTableCaption(Element tablexmlNode){
  String caption="String_Node_Str";
  boolean captionFound=false;
  List<Element> nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  Elements inDivChild=tablexmlNode.parent().getAllElements().first().children();
  for (int i=0; i < inDivChild.size(); i++) {
    Element el=inDivChild.get(i);
    if (i + 1 < inDivChild.size()) {
      Element tableel=inDivChild.get(i + 1);
      if (tableel.tagName().equals("String_Node_Str") && captionFound == false && tableel.equals(tablexmlNode)) {
        caption=el.text();
        captionFound=true;
      }
    }
  }
  nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  return caption;
}
Program: 36958
Project: 36958
Buggy source:
/** 
 * Read table footer.
 * @param tablesxmlNode the tablesxml node
 * @return the string
 */
public String ReadTableFooter(Element tablesxmlNode){
  String caption="String_Node_Str";
  List<Element> nl=getChildrenByTagName(tablesxmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  nl=getChildrenByTagName(tablesxmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    for (int i=0; i < nl.size(); i++) {
      caption+=Utilities.getString(nl.get(i)) + '\n';
    }
  }
  Elements inDivChild=tablesxmlNode.parent().getAllElements().first().children();
  boolean isafterTable=false;
  for (int i=0; i < inDivChild.size(); i++) {
    Element el=inDivChild.get(i);
    if (el.tagName().equals("String_Node_Str")) {
      isafterTable=true;
      continue;
    }
    if (isafterTable) {
      caption+=el.text() + '\n';
    }
  }
  nl=getChildrenByTagName(tablesxmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  return caption;
}

Fixed version (ground truth):
/** 
 * Read table footer.
 * @param tablesxmlNode the tablesxml node
 * @return the string
 */
public String ReadTableFooter(Element tablesxmlNode){
  String caption="String_Node_Str";
  List<Element> nl=getChildrenByTagName(tablesxmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  nl=getChildrenByTagName(tablesxmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    for (int i=0; i < nl.size(); i++) {
      caption+=Utilities.getString(nl.get(i)) + '\n';
    }
  }
  Elements inDivChild=tablesxmlNode.parent().getAllElements().first().children();
  boolean isafterTable=false;
  for (int i=0; i < inDivChild.size(); i++) {
    Element el=inDivChild.get(i);
    if (el.tagName().equals("String_Node_Str") && el.equals(tablesxmlNode)) {
      isafterTable=true;
      continue;
    }
    if (isafterTable && !el.tagName().equals("String_Node_Str")) {
      caption+=el.text() + '\n';
    }
    if (el.tagName().equals("String_Node_Str")) {
      isafterTable=false;
    }
  }
  nl=getChildrenByTagName(tablesxmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  return caption;
}
Program: 36964
Project: 36964
Buggy source:
/** 
 * Extract information from simple tables.
 * @param art the art
 */
public void ExtractData(Article art){
  if (art == null)   return;
  TablInExMain.linkedData.AddArticle(art);
  Table[] tables=art.getTables();
  for (int i=0; i < tables.length; i++) {
    if (tables[i] == null || tables[i].cells == null || tables[i].cells.length == 0)     continue;
    String tableFileName="String_Node_Str" + tables[i].getDocumentFileName() + tables[i].getTable_title()+ "String_Node_Str"+ tables[i].tableInTable;
    getFullHeaderValues(tables[i]);
    Cell[][] cells=tables[i].cells;
    if (isMultiTable(cells,tables[i])) {
      tables[i]=processMultiTable(cells,tables[i],art,tableFileName);
    }
    if (tables[i].getTableStructureType() != null && tables[i].getTableStructureType().equals(Table.StructureType.MULTI))     continue;
    tables[i]=processListTable(cells,tables[i],art,tableFileName);
    tables[i]=processTableWithSubheadersWithoutHeader(cells,tables[i],art,tableFileName);
    if (!isListTable(cells,tables[i]) && !hasTableSubheader(cells,tables[i])) {
      tables[i]=processRegularTable(cells,tables,art,tableFileName,i);
    }
  }
  art.setTables(tables);
}

Fixed version (ground truth):
/** 
 * Extract information from simple tables.
 * @param art the art
 */
public void ExtractData(Article art){
  if (art == null)   return;
  TablInExMain.linkedData.AddArticle(art);
  Table[] tables=art.getTables();
  for (int i=0; i < tables.length; i++) {
    if (tables[i] == null || tables[i].cells == null || tables[i].cells.length == 0)     continue;
    String tableFileName="String_Node_Str" + tables[i].getDocumentFileName() + tables[i].getTable_title()+ "String_Node_Str"+ tables[i].tableInTable;
    getFullHeaderValues(tables[i]);
    Cell[][] cells=tables[i].cells;
    if (isMultiTable(cells,tables[i])) {
      tables[i]=processMultiTable(cells,tables[i],art,tableFileName);
    }
    if (tables[i].getTableStructureType() != null && tables[i].getTableStructureType().equals(Table.StructureType.MULTI))     continue;
    tables[i]=processListTable(cells,tables[i],art,tableFileName);
    tables[i]=processTableWithSubheaders(cells,tables[i],art,tableFileName);
    if (!isListTable(cells,tables[i]) && !hasTableSubheader(cells,tables[i])) {
      tables[i]=processRegularTable(cells,tables,art,tableFileName,i);
    }
  }
  art.setTables(tables);
}
Program: 36965
Project: 36965
Buggy source:
private Cell[][] markMultiTableHeaders(Cell[][] cells){
  if (cells == null)   return cells;
  for (int i=0; i < cells.length; i++) {
    if (cells[i][0].isBreakingLineOverRow()) {
      if (i - 2 >= 0 && !cells[i - 2][0].isIs_header() && !isSequentiallyBreakingLine(cells,i - 2,0) && cells[i - 2][0].isBreakingLineOverRow()) {
        for (int j=0; j < cells[i].length; j++) {
          cells[i][j].setIs_header(true);
        }
        for (int j=0; j < cells[i].length; j++) {
          cells[i - 1][j].setIs_header(true);
        }
        for (int j=0; j < cells[i].length; j++) {
          cells[i - 2][j].setIs_header(true);
        }
      }
    }
  }
  return cells;
}

Fixed version (ground truth):
private Cell[][] markMultiTableHeaders(Cell[][] cells){
  if (cells == null)   return cells;
  for (int i=0; i < cells.length; i++) {
    if (cells[i][0].isBreakingLineOverRow()) {
      if (i - 2 >= 0 && !cells[i - 2][0].isIs_header() && !isSequentiallyBreakingLine(cells,i - 2,0) && cells[i - 2][0].isBreakingLineOverRow() && Utilities.isOneCellFilledRow(cells[i - 1])) {
        for (int j=0; j < cells[i].length; j++) {
        }
        for (int j=0; j < cells[i].length; j++) {
          cells[i - 1][j].setIs_subheader(true);
        }
        for (int j=0; j < cells[i].length; j++) {
        }
      }
 else       if (i - 2 >= 0 && !cells[i - 2][0].isIs_header() && !isSequentiallyBreakingLine(cells,i - 2,0) && cells[i - 2][0].isBreakingLineOverRow()) {
        for (int j=0; j < cells[i].length; j++) {
          cells[i][j].setIs_header(true);
        }
        for (int j=0; j < cells[i].length; j++) {
          cells[i - 1][j].setIs_header(true);
        }
        for (int j=0; j < cells[i].length; j++) {
          cells[i - 2][j].setIs_header(true);
        }
      }
    }
  }
  return cells;
}
Program: 36966
Project: 36966
Buggy source:
/** 
 * Checks if is row subheader.
 * @param cells the cells
 * @param table the table
 * @return true, if is row subheader
 */
public boolean isRowSubheader(Cell[] cells,Table table){
  boolean emptyLine=true;
  for (int h=0; h < cells.length; h++) {
    if (!Utilities.isSpaceOrEmpty(cells[h].getCell_content())) {
      emptyLine=false;
      break;
    }
  }
  if (emptyLine)   return false;
  boolean isSubheader=false;
  if (cells[0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[0].getCells_columnspanning() >= table.getNum_of_columns() && !cells[0].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !cells[0].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !(((int)cells[0].getCell_content().trim().charAt(0)) == 160)) {
    isSubheader=true;
  }
  boolean emptyCells=true;
  for (int j=1; j < cells.length; j++) {
    if (cells[j].getCell_content() == null) {
      cells[j].setCell_content("String_Node_Str");
    }
    if ((!Utilities.isSpaceOrEmpty(cells[0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[j].getCell_content())) || (Utilities.isSpaceOrEmpty(cells[0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[j].getCell_content()))) {
      emptyCells=false;
    }
  }
  if (emptyCells == true) {
    isSubheader=true;
  }
  return isSubheader;
}

Fixed version (ground truth):
public boolean isRowSubheader(Cell[][] cellsAll,int row,Cell[] cells,Table table){
  boolean emptyLine=true;
  for (int h=0; h < cells.length; h++) {
    if (!Utilities.isSpaceOrEmpty(cells[h].getCell_content())) {
      emptyLine=false;
      break;
    }
  }
  if (emptyLine)   return false;
  boolean isSubheader=false;
  if (cells[0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[0].getCells_columnspanning() >= table.getNum_of_columns() && !cells[0].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !cells[0].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !(((int)cells[0].getCell_content().trim().charAt(0)) == 160)) {
    isSubheader=true;
  }
  boolean emptyCells=true;
  for (int j=1; j < cells.length; j++) {
    if (cells[j].getCell_content() == null) {
      cells[j].setCell_content("String_Node_Str");
    }
    if ((!Utilities.isSpaceOrEmpty(cells[0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[j].getCell_content())) || (Utilities.isSpaceOrEmpty(cells[0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[j].getCell_content()))) {
      emptyCells=false;
    }
  }
  if (emptyCells == true) {
    isSubheader=true;
  }
  if (cellsAll.length > row + 1 && cellsAll[row + 1][0].getCell_content().length() > 0 && Utilities.numOfBegeningSpaces(cellsAll[row + 1][0].getCell_content()) > Utilities.numOfBegeningSpaces(cellsAll[row][0].getCell_content())) {
    isSubheader=true;
  }
  return isSubheader;
}
Program: 36967
Project: 36967
Buggy source:
/** 
 * Checks for table subheader.
 * @param cells the cells
 * @param table the table
 * @return true, if successful
 */
public boolean hasTableSubheader(Cell[][] cells,Table table){
  boolean hasSubheader=false;
  if (table.getNum_of_columns() < 2)   return false;
  for (int i=1; i < cells.length; i++) {
    if (cells[i][0].isIs_header())     continue;
    if (cells[i][0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[i][0].getCells_columnspanning() >= table.getNum_of_columns() && !Utilities.isSpaceOrEmpty(cells[i][0].getCell_content())) {
      hasSubheader=true;
      break;
    }
    if (Utilities.numOfBegeningSpaces(cells[i][0].getCell_content()) > 0) {
      hasSubheader=true;
      break;
    }
    boolean emptyCells=true;
    for (int j=1; j < cells[i].length; j++) {
      if (cells[i][j].getCell_content() == null) {
        cells[i][j].setCell_content("String_Node_Str");
      }
      if ((!Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[i][j].getCell_content())) || (Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && Utilities.isSpaceOrEmpty(cells[i][j].getCell_content()))) {
        emptyCells=false;
      }
    }
    if (emptyCells == true && table.getNum_of_columns() > 2) {
      hasSubheader=true;
      break;
    }
  }
  return hasSubheader;
}

Fixed version (ground truth):
/** 
 * Checks for table subheader.
 * @param cells the cells
 * @param table the table
 * @return true, if successful
 */
public boolean hasTableSubheader(Cell[][] cells,Table table){
  boolean hasSubheader=false;
  if (table.getNum_of_columns() < 2)   return false;
  for (int i=1; i < cells.length; i++) {
    if (cells[i][0].isIs_header())     continue;
    if (cells[i][0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[i][0].getCells_columnspanning() >= table.getNum_of_columns() && !Utilities.isSpaceOrEmpty(cells[i][0].getCell_content())) {
      hasSubheader=true;
      break;
    }
    if (cells[i][0].isIs_subheader()) {
      hasSubheader=true;
      break;
    }
    if (Utilities.numOfBegeningSpaces(cells[i][0].getCell_content()) > 0) {
      hasSubheader=true;
      break;
    }
    boolean emptyCells=true;
    for (int j=1; j < cells[i].length; j++) {
      if (cells[i][j].getCell_content() == null) {
        cells[i][j].setCell_content("String_Node_Str");
      }
      if ((!Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[i][j].getCell_content())) || (Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && Utilities.isSpaceOrEmpty(cells[i][j].getCell_content()))) {
        emptyCells=false;
      }
    }
    if (emptyCells == true && table.getNum_of_columns() > 2) {
      hasSubheader=true;
      break;
    }
  }
  return hasSubheader;
}
Program: 36969
Project: 36969
Buggy source:
public boolean isMultiTable(Cell[][] cells,Table table){
  if (cells == null)   return false;
  for (int i=0; i < cells.length; i++) {
    if (cells[i][0].isBreakingLineOverRow()) {
      if (i - 2 >= 0 && !cells[i - 2][0].isIs_header() && !isSequentiallyBreakingLine(cells,i - 2,0) && cells[i - 2][0].isBreakingLineOverRow())       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean isMultiTable(Cell[][] cells,Table table){
  if (cells == null)   return false;
  table.original_cells=markMultiTableHeaders(table.original_cells);
  table.cells=markMultiTableHeaders(table.cells);
  for (int i=0; i < cells.length; i++) {
    if (cells[i][0].isBreakingLineOverRow()) {
      if (i - 2 >= 0 && !cells[i - 2][0].isIs_header() && !isSequentiallyBreakingLine(cells,i - 2,0) && cells[i - 2][0].isBreakingLineOverRow() && !Utilities.isOneCellFilledRow(cells[i - 1]))       return true;
    }
  }
  return false;
}
Program: 36970
Project: 36970
Buggy source:
/** 
 * Checks for table subheader.
 * @param cells the cells
 * @param table the table
 * @return true, if successful
 */
public boolean hasTableSubheader(Cell[][] cells,Table table){
  boolean hasSubheader=false;
  if (table.getNum_of_columns() < 2)   return false;
  for (int i=1; i < cells.length; i++) {
    if (cells[i][0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[i][0].getCells_columnspanning() >= table.getNum_of_columns() && !Utilities.isSpaceOrEmpty(cells[i][0].getCell_content())) {
      hasSubheader=true;
      break;
    }
    if (Utilities.numOfBegeningSpaces(cells[i][0].getCell_content()) > 0) {
      hasSubheader=true;
      break;
    }
    boolean emptyCells=true;
    for (int j=1; j < cells[i].length; j++) {
      if (cells[i][j].getCell_content() == null) {
        cells[i][j].setCell_content("String_Node_Str");
      }
      if ((!Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[i][j].getCell_content())) || (Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && Utilities.isSpaceOrEmpty(cells[i][j].getCell_content()))) {
        emptyCells=false;
      }
    }
    if (emptyCells == true && table.getNum_of_columns() > 2) {
      hasSubheader=true;
      break;
    }
  }
  return hasSubheader;
}

Fixed version (ground truth):
/** 
 * Checks for table subheader.
 * @param cells the cells
 * @param table the table
 * @return true, if successful
 */
public boolean hasTableSubheader(Cell[][] cells,Table table){
  boolean hasSubheader=false;
  if (table.getNum_of_columns() < 2)   return false;
  for (int i=1; i < cells.length; i++) {
    if (cells[i][0].isIs_header())     continue;
    if (cells[i][0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[i][0].getCells_columnspanning() >= table.getNum_of_columns() && !Utilities.isSpaceOrEmpty(cells[i][0].getCell_content())) {
      hasSubheader=true;
      break;
    }
    if (Utilities.numOfBegeningSpaces(cells[i][0].getCell_content()) > 0) {
      hasSubheader=true;
      break;
    }
    boolean emptyCells=true;
    for (int j=1; j < cells[i].length; j++) {
      if (cells[i][j].getCell_content() == null) {
        cells[i][j].setCell_content("String_Node_Str");
      }
      if ((!Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[i][j].getCell_content())) || (Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && Utilities.isSpaceOrEmpty(cells[i][j].getCell_content()))) {
        emptyCells=false;
      }
    }
    if (emptyCells == true && table.getNum_of_columns() > 2) {
      hasSubheader=true;
      break;
    }
  }
  return hasSubheader;
}
Program: 36971
Project: 36971
Buggy source:
public void SetUnderSubheaderRow(Cell[] row){
  for (int i=0; i < row.length; i++) {
    row[i].setUnderSubheader(true);
  }
}

Fixed version (ground truth):
public Cell[] SetUnderSubheaderRow(Cell[] row,String superRowIndex){
  for (int i=0; i < row.length; i++) {
    row[i].setUnderSubheader(true);
    row[i].setSuperRowIndex(superRowIndex);
  }
  return row;
}
Program: 36973
Project: 36973
Buggy source:
public static int numOfSpaceOrBullets(String s){
  int num=0;
  if (s == null)   return 0;
  if (s.length() == 0)   return 0;
  for (int i=0; i < s.length(); i++) {
    char ch=s.charAt(i);
    if (((int)ch) == 8195 || (int)ch == 160 || (int)ch == ' ' || (int)ch == 8194 || (int)ch == 8201 || (int)ch == '-' || (int)ch == '�') {
      num++;
    }
 else     break;
  }
  return num;
}

Fixed version (ground truth):
public static int numOfSpaceOrBullets(String s){
  int num=0;
  if (s == null)   return 0;
  if (s.length() == 0)   return 0;
  for (int i=0; i < s.length(); i++) {
    char ch=s.charAt(i);
    if (((int)ch) == 8195 || (int)ch == 160 || (int)ch == ' ' || (int)ch == 8194 || (int)ch == 8201 || (int)ch == '-' || (int)ch == '•') {
      num++;
    }
 else     break;
  }
  return num;
}
Program: 36981
Project: 36981
Buggy source:
public String getCellType(){
  if (Utilities.isNumeric(this.getCell_content())) {
    return "String_Node_Str";
  }
  int numbers=0;
  int chars=0;
  String tempCellVal=this.getCell_content().replaceAll("String_Node_Str","String_Node_Str");
  for (int i=0; i < tempCellVal.length(); i++) {
    if (Utilities.isNumeric(tempCellVal.substring(i,i + 1))) {
      numbers++;
    }
 else {
      chars++;
    }
  }
  float proportion=(float)numbers / (chars + numbers);
  if (proportion > 0.49 && !Utilities.isNumeric(this.getCell_content())) {
    return "String_Node_Str";
  }
  if (proportion <= 0.49 && !Utilities.isNumeric(this.getCell_content())) {
    return "String_Node_Str";
  }
  if (Utilities.isSpaceOrEmpty(this.getCell_content())) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getCellType(){
  if (this.getCell_content() == null) {
    this.setCell_content("String_Node_Str");
  }
  if (Utilities.isNumeric(this.getCell_content())) {
    return "String_Node_Str";
  }
  int numbers=0;
  int chars=0;
  String tempCellVal=this.getCell_content().replaceAll("String_Node_Str","String_Node_Str");
  for (int i=0; i < tempCellVal.length(); i++) {
    if (Utilities.isNumeric(tempCellVal.substring(i,i + 1))) {
      numbers++;
    }
 else {
      chars++;
    }
  }
  float proportion=(float)numbers / (chars + numbers);
  if (proportion > 0.49 && !Utilities.isNumeric(this.getCell_content())) {
    return "String_Node_Str";
  }
  if (proportion <= 0.49 && !Utilities.isNumeric(this.getCell_content())) {
    return "String_Node_Str";
  }
  if (Utilities.isSpaceOrEmpty(this.getCell_content())) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}
Program: 36983
Project: 36983
Buggy source:
/** 
 * Inits the complexity classification.
 * @param initFolder the init folder
 */
public static void initComplexity(String initFolder){
  setFolder(initFolder);
  SimplestFolder=initFolder + "String_Node_Str";
  SimpleFolder=initFolder + "String_Node_Str";
  MediumFolder=initFolder + "String_Node_Str";
  ComplexFolder=initFolder + "String_Node_Str";
  Utilities.DeleteFolderWithContent(SimplestFolder);
  Utilities.DeleteFolderWithContent(SimpleFolder);
  Utilities.DeleteFolderWithContent(MediumFolder);
  Utilities.DeleteFolderWithContent(ComplexFolder);
  Utilities.MakeDirectory(SimplestFolder);
  Utilities.MakeDirectory(SimpleFolder);
  Utilities.MakeDirectory(MediumFolder);
  Utilities.MakeDirectory(ComplexFolder);
}

Fixed version (ground truth):
/** 
 * Inits the complexity classification.
 * @param initFolder the init folder
 */
public static void initComplexity(String initFolder){
  setFolder(initFolder);
  SimplestFolder=initFolder + "String_Node_Str";
  SimpleFolder=initFolder + "String_Node_Str";
  MediumFolder=initFolder + "String_Node_Str";
  ComplexFolder=initFolder + "String_Node_Str";
  ListFolder=initFolder + "String_Node_Str";
  MatrixFolder=initFolder + "String_Node_Str";
  SuperRowFolder=initFolder + "String_Node_Str";
  ;
  MultiTableFolder=initFolder + "String_Node_Str";
  ;
  Utilities.DeleteFolderWithContent(SimplestFolder);
  Utilities.DeleteFolderWithContent(SimpleFolder);
  Utilities.DeleteFolderWithContent(MediumFolder);
  Utilities.DeleteFolderWithContent(ComplexFolder);
  Utilities.DeleteFolderWithContent(ListFolder);
  Utilities.DeleteFolderWithContent(MatrixFolder);
  Utilities.DeleteFolderWithContent(SuperRowFolder);
  Utilities.DeleteFolderWithContent(MultiTableFolder);
  Utilities.MakeDirectory(SimplestFolder);
  Utilities.MakeDirectory(SimpleFolder);
  Utilities.MakeDirectory(MediumFolder);
  Utilities.MakeDirectory(ComplexFolder);
  Utilities.MakeDirectory(ListFolder);
  Utilities.MakeDirectory(MatrixFolder);
  Utilities.MakeDirectory(SuperRowFolder);
  Utilities.MakeDirectory(MultiTableFolder);
}
Program: 36984
Project: 36984
Buggy source:
/** 
 * Classify table by complexity.
 * @param t the t
 */
public static void ClassifyTableByComplexity(Table t){
  if (t == null)   return;
  String tableFileName="String_Node_Str" + t.getDocumentFileName() + t.getTable_title()+ "String_Node_Str";
  if (t.stat.getNum_of_header_rows() < 5 && t.isHasHeader() && !t.isNoXMLTable() && t.stat.getNum_of_empty_cells() == 0 && t.stat.getNum_of_part_numeric_cells() == 0) {
    if (t.getStructureClass() == 0)     t.setStructureClass(1);
    Utilities.WriteFile(SimplestFolder + tableFileName,t.getXml());
  }
 else   if (t.stat.getNum_of_header_rows() < 15 && (t.stat.getNum_of_empty_cells() == t.stat.getHeader_empty_cells() || t.isEmptyOnlyHeaders) && t.isHasHeader() && !t.isNoXMLTable()) {
    t.setStructureClass(2);
    Utilities.WriteFile(SimpleFolder + tableFileName,t.getXml());
  }
 else   if (t.isHasHeader() && !t.isNoXMLTable()) {
    if (t.getStructureClass() == 0)     t.setStructureClass(3);
    Utilities.WriteFile(MediumFolder + tableFileName,t.getXml());
  }
 else {
    if (t.getStructureClass() == 0)     t.setStructureClass(4);
    Utilities.WriteFile(ComplexFolder + tableFileName,t.getXml());
  }
}

Fixed version (ground truth):
/** 
 * Classify table by complexity.
 * @param t the t
 */
public static void ClassifyTableByComplexity(Table t){
  if (t == null)   return;
  String tableFileName="String_Node_Str" + t.getDocumentFileName() + t.getTable_title()+ "String_Node_Str";
  if (t.getTableStructureType() == StructureType.LIST) {
    Utilities.WriteFile(ListFolder + tableFileName,t.getXml());
  }
  if (t.getTableStructureType() == StructureType.MATRIX) {
    Utilities.WriteFile(MatrixFolder + tableFileName,t.getXml());
  }
  if (t.getTableStructureType() == StructureType.SUBHEADER) {
    Utilities.WriteFile(SuperRowFolder + tableFileName,t.getXml());
  }
  if (t.getTableStructureType() == StructureType.MULTI) {
    Utilities.WriteFile(MultiTableFolder + tableFileName,t.getXml());
  }
  if (t.stat.getNum_of_header_rows() < 5 && t.isHasHeader() && !t.isNoXMLTable() && t.stat.getNum_of_empty_cells() == 0 && t.stat.getNum_of_part_numeric_cells() == 0) {
    if (t.getStructureClass() == 0)     t.setStructureClass(1);
    Utilities.WriteFile(SimplestFolder + tableFileName,t.getXml());
  }
 else   if (t.stat.getNum_of_header_rows() < 15 && (t.stat.getNum_of_empty_cells() == t.stat.getHeader_empty_cells() || t.isEmptyOnlyHeaders) && t.isHasHeader() && !t.isNoXMLTable()) {
    t.setStructureClass(2);
    Utilities.WriteFile(SimpleFolder + tableFileName,t.getXml());
  }
 else   if (t.isHasHeader() && !t.isNoXMLTable()) {
    if (t.getStructureClass() == 0)     t.setStructureClass(3);
    Utilities.WriteFile(MediumFolder + tableFileName,t.getXml());
  }
 else {
    if (t.getStructureClass() == 0)     t.setStructureClass(4);
    Utilities.WriteFile(ComplexFolder + tableFileName,t.getXml());
  }
}
Program: 36985
Project: 36985
Buggy source:
public String[] GetAuthors(Document parse){
  NodeList authors=parse.getElementsByTagName("String_Node_Str");
  String[] auths=new String[authors.getLength()];
  for (int j=0; j < authors.getLength(); j++) {
    String givenName="String_Node_Str";
    String surname="String_Node_Str";
    NodeList name=authors.item(j).getChildNodes().item(0).getChildNodes();
    if (name.item(1) != null)     surname=name.item(0).getTextContent();
    if (name.item(1) != null)     givenName=name.item(1).getTextContent();
    auths[j]=surname + "String_Node_Str" + givenName;
  }
  return auths;
}

Fixed version (ground truth):
public String[] GetAuthors(Document parse){
  NodeList authors=parse.getElementsByTagName("String_Node_Str");
  String[] auths=new String[authors.getLength()];
  for (int j=0; j < authors.getLength(); j++) {
    String givenName="String_Node_Str";
    String surname="String_Node_Str";
    NodeList name=authors.item(j).getChildNodes().item(0).getChildNodes();
    if (name.item(1) != null)     surname=Utilities.getString(name.item(0));
    if (name.item(1) != null)     givenName=Utilities.getString(name.item(1));
    auths[j]=surname + "String_Node_Str" + givenName;
  }
  return auths;
}
Program: 36986
Project: 36986
Buggy source:
/** 
 * Read table caption.
 * @param tablexmlNode the tablexml node
 * @return the string
 */
public String readTableCaption(Node tablexmlNode){
  String caption="String_Node_Str";
  List<Node> nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=nl.get(0).getTextContent();
  }
  nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=nl.get(0).getTextContent();
  }
  nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=nl.get(0).getTextContent();
  }
  return caption;
}

Fixed version (ground truth):
/** 
 * Read table caption.
 * @param tablexmlNode the tablexml node
 * @return the string
 */
public String readTableCaption(Node tablexmlNode){
  String caption="String_Node_Str";
  List<Node> nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    caption=Utilities.getString(nl.get(0));
  }
  return caption;
}
Program: 36987
Project: 36987
Buggy source:
/** 
 * Read table footer.
 * @param tablesxmlNode the tablesxml node
 * @return the string
 */
public String ReadTableFooter(Node tablesxmlNode){
  String foot="String_Node_Str";
  List<Node> nl=getChildrenByTagName(tablesxmlNode,"String_Node_Str");
  if (nl.size() >= 1) {
    foot=nl.get(0).getTextContent();
  }
  return foot;
}

Fixed version (ground truth):
/** 
 * Read table footer.
 * @param tablesxmlNode the tablesxml node
 * @return the string
 */
public String ReadTableFooter(Node tablesxmlNode){
  String foot="String_Node_Str";
  List<Node> nl=getChildrenByTagName(tablesxmlNode,"String_Node_Str");
  if (nl.size() >= 1) {
    foot=Utilities.getString(nl.get(0));
  }
  return foot;
}
Program: 36988
Project: 36988
Buggy source:
/** 
 * Gets the affiliations of authors.
 * @param parse the parse
 * @return the string[]
 */
public String[] GetAffiliations(Document parse){
  NodeList affis=parse.getElementsByTagName("String_Node_Str");
  String[] affilis=new String[affis.getLength()];
  for (int j=0; j < affis.getLength(); j++) {
    String affiliation=affis.item(j).getTextContent();
    affilis[j]=affiliation;
    System.out.println("String_Node_Str" + affiliation);
  }
  return affilis;
}

Fixed version (ground truth):
/** 
 * Gets the affiliations of authors.
 * @param parse the parse
 * @return the string[]
 */
public String[] GetAffiliations(Document parse){
  NodeList affis=parse.getElementsByTagName("String_Node_Str");
  String[] affilis=new String[affis.getLength()];
  for (int j=0; j < affis.getLength(); j++) {
    String affiliation=Utilities.getString(affis.item(j));
    affilis[j]=affiliation;
    System.out.println("String_Node_Str" + affiliation);
  }
  return affilis;
}
Program: 36989
Project: 36989
Buggy source:
/** 
 * Read table label.
 * @param tablexmlNode the tablexml node
 * @return the string
 */
public String readTableLabel(Node tablexmlNode){
  String label="String_Node_Str";
  List<Node> nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    label=nl.get(0).getTextContent();
  }
  return label;
}

Fixed version (ground truth):
/** 
 * Read table label.
 * @param tablexmlNode the tablexml node
 * @return the string
 */
public String readTableLabel(Node tablexmlNode){
  String label="String_Node_Str";
  List<Node> nl=getChildrenByTagName(tablexmlNode,"String_Node_Str");
  if (nl.size() > 0) {
    label=Utilities.getString(nl.get(0));
  }
  return label;
}
Program: 36992
Project: 36992
Buggy source:
/** 
 * Prints the help.
 */
public static void printHelp(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Prints the help.
 */
public static void printHelp(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
}
Program: 36994
Project: 36994
Buggy source:
public MetaMapping() throws MalformedURLException {
  api=new MetaMapApiImpl();
  api.setHost("String_Node_Str");
  api.setPort(8066);
  List<String> theOptions=new ArrayList<String>();
  theOptions.add("String_Node_Str");
  theOptions.add("String_Node_Str");
  theOptions.add("String_Node_Str");
  for (  String opt : theOptions)   api.setOptions(opt);
  try {
    SemanticTypes=new HashMap<String,String>();
    BufferedReader br=new BufferedReader(new FileReader("String_Node_Str"));
    String line;
    while ((line=br.readLine()) != null) {
      String[] splitted=line.split("String_Node_Str");
      SemanticTypes.put(splitted[0],splitted[2]);
    }
    br.close();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public MetaMapping() throws MalformedURLException {
  List<String> theOptions=new ArrayList<String>();
  ;
  try {
    String HostName="String_Node_Str";
    int PortNumber=0;
    String[] options=new String[0];
    BufferedReader bropt=new BufferedReader(new FileReader("String_Node_Str"));
    String linea;
    while ((linea=bropt.readLine()) != null) {
      if (linea.contains("String_Node_Str")) {
        HostName=linea.substring(5);
      }
      if (linea.contains("String_Node_Str")) {
        PortNumber=Integer.parseInt(linea.substring(5));
      }
      if (linea.contains("String_Node_Str")) {
        String opt=linea.substring(8);
        options=opt.split("String_Node_Str");
      }
    }
    api=new MetaMapApiImpl();
    api.setHost(HostName);
    api.setPort(PortNumber);
    for (int i=0; i < options.length; i++) {
      theOptions.add(options[i]);
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  for (  String opt : theOptions)   api.setOptions(opt);
  try {
    SemanticTypes=new HashMap<String,String>();
    BufferedReader br=new BufferedReader(new FileReader("String_Node_Str"));
    String line;
    while ((line=br.readLine()) != null) {
      String[] splitted=line.split("String_Node_Str");
      SemanticTypes.put(splitted[0],splitted[2]);
    }
    br.close();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
Program: 36995
Project: 36995
Buggy source:
/** 
 * Checks for table subheader.
 * @param cells the cells
 * @param table the table
 * @return true, if successful
 */
public boolean hasTableSubheader(Cell[][] cells,Table table){
  boolean hasSubheader=false;
  if (table.getNum_of_columns() < 2)   return false;
  for (int i=1; i < cells.length; i++) {
    if (cells[i][0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[i][0].getCells_columnspanning() >= table.getNum_of_columns() && !cells[i][0].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !cells[i][0].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !(((int)cells[i][0].getCell_content().trim().charAt(0)) == 160)) {
      hasSubheader=true;
      break;
    }
    boolean emptyCells=true;
    for (int j=1; j < cells[i].length; j++) {
      if (cells[i][j].getCell_content() == null) {
        cells[i][j].setCell_content("String_Node_Str");
      }
      if (!cells[i][0].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !cells[i][0].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !(((int)cells[i][0].getCell_content().trim().charAt(0)) == 160)&& (!cells[i][j].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !cells[i][j].getCell_content().trim().equalsIgnoreCase("String_Node_Str") && !(((int)cells[i][j].getCell_content().trim().charAt(0)) == 160))) {
        emptyCells=false;
      }
    }
    if (emptyCells == true) {
      hasSubheader=true;
      break;
    }
  }
  return hasSubheader;
}

Fixed version (ground truth):
/** 
 * Checks for table subheader.
 * @param cells the cells
 * @param table the table
 * @return true, if successful
 */
public boolean hasTableSubheader(Cell[][] cells,Table table){
  boolean hasSubheader=false;
  if (table.getNum_of_columns() < 2)   return false;
  for (int i=1; i < cells.length; i++) {
    if (cells[i][0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[i][0].getCells_columnspanning() >= table.getNum_of_columns() && !Utilities.isSpaceOrEmpty(cells[i][0].getCell_content())) {
      hasSubheader=true;
      break;
    }
    if (Utilities.numOfBegeningSpaces(cells[i][0].getCell_content()) > 0) {
      hasSubheader=true;
      break;
    }
    boolean emptyCells=true;
    for (int j=1; j < cells[i].length; j++) {
      if (cells[i][j].getCell_content() == null) {
        cells[i][j].setCell_content("String_Node_Str");
      }
      if (!Utilities.isSpaceOrEmpty(cells[i][0].getCell_content()) && !Utilities.isSpaceOrEmpty(cells[i][j].getCell_content())) {
        emptyCells=false;
      }
    }
    if (emptyCells == true) {
      hasSubheader=true;
      break;
    }
  }
  return hasSubheader;
}