nus-yam/ex-repair huggingface dataset:
Program: 40775
Project: 40775
Buggy source:
/** 
 * get ImplementMap frmo the Mapping sheet for single row
 * @param row
 * @return
 */
private ImplementIMap getMap(ListEntry row){
  return new ImplementIMap.Builder().withClientEnvironment(getList(row.getCustomElements().getValue("String_Node_Str"))).withTestData(row.getCustomElements().getValue("String_Node_Str")).withRunStartegy(row.getCustomElements().getValue("String_Node_Str")).build();
}

Fixed version (ground truth):
/** 
 * get ImplementMap frmo the Mapping sheet for single row
 * @param row
 * @return
 */
private ImplementIMap getMap(ListEntry row){
  LOGGER.debug("String_Node_Str");
  return new ImplementIMap.Builder().withClientEnvironment(getList(row.getCustomElements().getValue("String_Node_Str"))).withTestData(row.getCustomElements().getValue("String_Node_Str")).withRunStartegy(row.getCustomElements().getValue("String_Node_Str")).build();
}
Program: 40776
Project: 40776
Buggy source:
private SpreadsheetEntry connect(){
  service=new SpreadsheetService("String_Node_Str");
  try {
    service.setUserCredentials(googleUserName,googlePasswd);
    SPREADSHEET_FEED_URL=new URL("String_Node_Str");
    SpreadsheetFeed feed=service.getFeed(SPREADSHEET_FEED_URL,SpreadsheetFeed.class);
    List<com.google.gdata.data.spreadsheet.SpreadsheetEntry> spreadsheets=feed.getEntries();
    for (    SpreadsheetEntry sheet : spreadsheets) {
      if (sheet.getTitle().getPlainText().equalsIgnoreCase(sheetName)) {
        return sheet;
      }
    }
  }
 catch (  AuthenticationException e) {
    LOGGER.error(e);
  }
catch (  MalformedURLException e) {
    LOGGER.error(e);
  }
catch (  IOException e) {
    LOGGER.error(e);
  }
catch (  ServiceException e) {
    LOGGER.error(e);
  }
  return null;
}

Fixed version (ground truth):
private SpreadsheetEntry connect(){
  service=new SpreadsheetService("String_Node_Str");
  try {
    service.setUserCredentials(googleUserName,googlePasswd);
    spreadSheetFeedUrl=new URL("String_Node_Str");
    SpreadsheetFeed feed=service.getFeed(spreadSheetFeedUrl,SpreadsheetFeed.class);
    List<com.google.gdata.data.spreadsheet.SpreadsheetEntry> spreadsheets=feed.getEntries();
    for (    SpreadsheetEntry sheet : spreadsheets) {
      LOGGER.debug("String_Node_Str" + sheet.getTitle().getPlainText());
      if (sheet.getTitle().getPlainText().equalsIgnoreCase(sheetName)) {
        return sheet;
      }
    }
  }
 catch (  AuthenticationException e) {
    LOGGER.error(e);
  }
catch (  MalformedURLException e) {
    LOGGER.error(e);
  }
catch (  IOException e) {
    LOGGER.error(e);
  }
catch (  ServiceException e) {
    LOGGER.error(e);
  }
  return null;
}
Program: 40777
Project: 40777
Buggy source:
public boolean retry(ITestResult result){
  maxCount=Driver.getBrowserConf().getRetryFailedTestCaseCount();
  LOGGER.debug("String_Node_Str" + maxCount);
  if (count < maxCount) {
    LOGGER.info("String_Node_Str" + result.getName() + "String_Node_Str"+ result.getStatus()+ "String_Node_Str"+ count+ "String_Node_Str");
    count++;
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean retry(ITestResult result){
  IBrowserConf browserConf=Driver.getBrowserConf();
  if (null == browserConf)   browserConf=DefaultBrowserConf.get();
  maxCount=browserConf.getRetryFailedTestCaseCount();
  LOGGER.debug("String_Node_Str" + maxCount);
  if (count < maxCount) {
    LOGGER.info("String_Node_Str" + result.getName() + "String_Node_Str"+ result.getStatus()+ "String_Node_Str"+ count+ "String_Node_Str");
    count++;
    return true;
  }
  return false;
}
Program: 40778
Project: 40778
Buggy source:
private void updateGoogleSheet(String environment){
  checkGoogleUserNameAndPassword();
  ReadGoogle readGoogle=new ReadGoogle(System.getProperty(GoogleSheetConstant.GOOGLEUSERNAME),System.getProperty(GoogleSheetConstant.GOOGLEPASSWD),System.getProperty(GoogleSheetConstant.GOOGLESHEETNAME));
  RefineMappedData refinedData=new RefineMappedData(readGoogle);
  IMappingData mapData=refinedData.getMethodData(method);
  this.browserConfig=readGoogle.getBrowserListForSheet(mapData);
  this.testData=readGoogle.getMethodData(environment,mapData);
  this.runStrategy=mapData.getRunStartegy();
}

Fixed version (ground truth):
private void updateGoogleSheet(String environment){
  checkGoogleUserNameAndPassword();
  ReadGoogle readGoogle=ReadGoogle.getInstance();
  readGoogle.connect(System.getProperty(GoogleSheetConstant.GOOGLEUSERNAME),System.getProperty(GoogleSheetConstant.GOOGLEPASSWD),System.getProperty(GoogleSheetConstant.GOOGLESHEETNAME));
  RefineMappedData refinedData=new RefineMappedData(readGoogle);
  IMappingData mapData=refinedData.getMethodData(method);
  this.browserConfig=readGoogle.getBrowserListForSheet(mapData);
  this.testData=readGoogle.getMethodData(environment,mapData);
  this.runStrategy=mapData.getRunStartegy();
}
Program: 40779
Project: 40779
Buggy source:
/** 
 * get the map with key as methodName and List of   {@link IProperty}
 * @param environment : which should be System.getProperty() it can be null or empty as well
 * @param data
 * @return
 * @throws IOException
 * @throws ServiceException
 */
public List<IProperty> getMethodData(String environment,IMappingData data){
  IMappingData mData=data;
  URL testDataSheetURL;
  ListFeed testDataFeed=null;
  LOGGER.debug("String_Node_Str" + mData.getTestData());
  try {
    testDataSheetURL=getWorkSheet(mData.getTestData()).getListFeedUrl();
    testDataFeed=service.getFeed(testDataSheetURL,ListFeed.class);
  }
 catch (  IOException e) {
    LOGGER.error(e);
  }
catch (  ServiceException e) {
    LOGGER.error(e);
  }
  return getSingleMethodtData(environment,testDataFeed);
}

Fixed version (ground truth):
/** 
 * get the map with key as methodName and List of   {@link IProperty}
 * @param environment : which should be System.getProperty() it can be null or empty as well
 * @param data
 * @return
 * @throws IOException
 * @throws ServiceException
 */
public List<IProperty> getMethodData(String environment,IMappingData data){
  if (!dataBucket.containsKey(data.getTestData())) {
    IMappingData mData=data;
    URL testDataSheetURL;
    ListFeed testDataFeed=null;
    LOGGER.debug("String_Node_Str" + mData.getTestData());
    try {
      testDataSheetURL=getWorkSheet(mData.getTestData()).getListFeedUrl();
      testDataFeed=service.getFeed(testDataSheetURL,ListFeed.class);
    }
 catch (    IOException e) {
      LOGGER.error(e);
    }
catch (    ServiceException e) {
      LOGGER.error(e);
    }
    dataBucket.put(data.getTestData(),getSingleMethodtData(environment,testDataFeed));
  }
  return dataBucket.get(data.getTestData());
}
Program: 40780
Project: 40780
Buggy source:
public DataPerEnvironment(String environmentName){
  LOGGER.debug("String_Node_Str" + environmentName);
  LOGGER.debug("String_Node_Str" + prop.getValue("String_Node_Str"));
  this.environmentName=environmentName;
}

Fixed version (ground truth):
public DataPerEnvironment(String environmentName){
  LOGGER.debug("String_Node_Str" + environmentName);
  this.environmentName=environmentName;
}
Program: 40781
Project: 40781
Buggy source:
/** 
 * return the property list for single methods
 * @param env
 * @param rows
 * @return
 */
private List<IProperty> getSingleMethodtData(String env,ListFeed rows){
  List<DataPerEnvironment> testEnvironmentMap=new ArrayList<ReadGoogle.DataPerEnvironment>();
  Map<String,String> keyValuePair=new HashMap<String,String>();
  DataPerEnvironment testEnvHolder=null;
  for (  ListEntry row : rows.getEntries()) {
    LOGGER.debug("String_Node_Str" + row.getCustomElements().getValue("String_Node_Str") + "String_Node_Str"+ row.getCustomElements().getValue("String_Node_Str"));
    if (row.getCustomElements().getValue("String_Node_Str").contains("String_Node_Str")) {
      if (testEnvHolder != null) {
        testEnvironmentMap.add(testEnvHolder);
      }
      testEnvHolder=new DataPerEnvironment(row.getCustomElements().getValue("String_Node_Str"));
    }
 else {
      testEnvHolder.setTestData(row.getCustomElements().getValue("String_Node_Str"),row.getCustomElements().getValue("String_Node_Str"));
      keyValuePair.put(row.getCustomElements().getValue("String_Node_Str"),row.getCustomElements().getValue("String_Node_Str"));
    }
  }
  testEnvironmentMap.add(testEnvHolder);
  if (StringUtils.isNotBlank(env)) {
    return getConcatentedDataList(env,testEnvironmentMap);
  }
 else {
    return getConcatentedDataList(testEnvironmentMap);
  }
}

Fixed version (ground truth):
/** 
 * return the property list for single methods
 * @param env
 * @param rows
 * @return
 */
private List<IProperty> getSingleMethodtData(String env,ListFeed rows){
  List<DataPerEnvironment> testEnvironmentMap=new ArrayList<ReadGoogle.DataPerEnvironment>();
  Map<String,String> keyValuePair=new HashMap<String,String>();
  DataPerEnvironment testEnvHolder=null;
  for (  ListEntry row : rows.getEntries()) {
    LOGGER.debug("String_Node_Str" + row.getCustomElements().getValue("String_Node_Str") + "String_Node_Str"+ row.getCustomElements().getValue("String_Node_Str"));
    if (row.getCustomElements().getValue("String_Node_Str").contains("String_Node_Str")) {
      if (testEnvHolder != null) {
        testEnvironmentMap.add(testEnvHolder);
      }
      testEnvHolder=new DataPerEnvironment(row.getCustomElements().getValue("String_Node_Str"));
    }
 else {
      testEnvHolder.setTestData(row.getCustomElements().getValue("String_Node_Str"),row.getCustomElements().getValue("String_Node_Str"));
      keyValuePair.put(row.getCustomElements().getValue("String_Node_Str"),row.getCustomElements().getValue("String_Node_Str"));
    }
  }
  testEnvironmentMap.add(testEnvHolder);
  if (StringUtils.isNotBlank(env)) {
    return getConcatenatedDataList(env,testEnvironmentMap);
  }
 else {
    return getConcatentedDataList(testEnvironmentMap);
  }
}
Program: 40782
Project: 40782
Buggy source:
/** 
 * Get the primary data from the Mapping sheet in Google sheet, This would be fed to MappedValue for refinement
 */
@Override public Map<String,IMappingData> getPrimaryData(){
  Map<String,IMappingData> primaryData=new HashMap<String,IMappingData>();
  URL listFeedURL;
  try {
    listFeedURL=getWorkSheet(GoogleSheetConstant.GOOGLE_MAP_SHEET_NAME).getListFeedUrl();
    ListFeed listFeed=service.getFeed(listFeedURL,ListFeed.class);
    for (    ListEntry row : listFeed.getEntries()) {
      primaryData.put(row.getCustomElements().getValue("String_Node_Str"),getMap(row));
    }
  }
 catch (  IOException e) {
    LOGGER.error(e);
  }
catch (  ServiceException e) {
    LOGGER.error(e);
  }
  return primaryData;
}

Fixed version (ground truth):
/** 
 * Get the primary data from the Mapping sheet in Google sheet, This would be fed to MappedValue for refinement
 */
@Override public Map<String,IMappingData> getPrimaryData(){
  if (mappingBucket.isEmpty()) {
    URL listFeedURL;
    try {
      listFeedURL=getWorkSheet(GoogleSheetConstant.GOOGLE_MAP_SHEET_NAME).getListFeedUrl();
      ListFeed listFeed=service.getFeed(listFeedURL,ListFeed.class);
      for (      ListEntry row : listFeed.getEntries()) {
        mappingBucket.put(row.getCustomElements().getValue("String_Node_Str"),getMap(row));
      }
    }
 catch (    IOException e) {
      LOGGER.error(e);
    }
catch (    ServiceException e) {
      LOGGER.error(e);
    }
  }
  return mappingBucket;
}
Program: 40783
Project: 40783
Buggy source:
public ReadGoogle(String googleUserName,String googlePasswd,String sheetName){
  this.googleUserName=googleUserName;
  this.googlePasswd=googlePasswd;
  this.sheetName=sheetName;
  spreadSheet=connect();
}

Fixed version (ground truth):
private ReadGoogle(){
}
Program: 40784
Project: 40784
Buggy source:
/** 
 * Get the map having key as methodName of   {@link IBrowserConf} for therefined data
 * @param data
 * @return
 * @throws IOException
 * @throws ServiceException
 */
public List<IBrowserConf> getBrowserListForSheet(IMappingData data){
  IMappingData methodData=data;
  List<IBrowserConf> browserConfList=new ArrayList<IBrowserConf>();
  URL browserSheetURL;
  String sheetNameHolder=null;
  ListFeed browserFeed;
  for (  String browserSheet : methodData.getClientEnvironment()) {
    sheetNameHolder=browserSheet;
    try {
      browserSheetURL=getWorkSheet(browserSheet).getListFeedUrl();
      browserFeed=service.getFeed(browserSheetURL,ListFeed.class);
      for (      ListEntry row : browserFeed.getEntries()) {
        browserConfList.add(getBrowserConfFromRow(row));
      }
    }
 catch (    NullPointerException ex) {
      LOGGER.error("String_Node_Str" + sheetNameHolder);
      LOGGER.error(ex);
    }
catch (    IOException e) {
      LOGGER.error(e);
    }
catch (    ServiceException e) {
      LOGGER.error(e);
    }
  }
  return browserConfList;
}

Fixed version (ground truth):
/** 
 * Get the map having key as methodName of   {@link IBrowserConf} for therefined data
 * @param data
 * @return
 * @throws IOException
 * @throws ServiceException
 */
public List<IBrowserConf> getBrowserListForSheet(IMappingData data){
  List<IBrowserConf> returnList=new ArrayList<IBrowserConf>();
  IMappingData methodData=data;
  URL browserSheetURL;
  String sheetNameHolder=null;
  ListFeed browserFeed;
  for (  String browserSheet : methodData.getClientEnvironment()) {
    sheetNameHolder=browserSheet;
    if (!browserBucket.containsKey(browserSheet)) {
      try {
        List<IBrowserConf> browserConfLForSingleSheet=new ArrayList<IBrowserConf>();
        browserSheetURL=getWorkSheet(browserSheet).getListFeedUrl();
        browserFeed=service.getFeed(browserSheetURL,ListFeed.class);
        for (        ListEntry row : browserFeed.getEntries()) {
          browserConfLForSingleSheet.add(getBrowserConfFromRow(row));
        }
        browserBucket.put(browserSheet,browserConfLForSingleSheet);
      }
 catch (      NullPointerException ex) {
        LOGGER.error("String_Node_Str" + sheetNameHolder);
        LOGGER.error(ex);
      }
catch (      IOException e) {
        LOGGER.error(e);
      }
catch (      ServiceException e) {
        LOGGER.error(e);
      }
    }
    returnList.addAll(browserBucket.get(browserSheet));
  }
  return returnList;
}
Program: 40785
Project: 40785
Buggy source:
private XmlApplicationData(){
  try {
    builder=factory.newDocumentBuilder();
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private XmlApplicationData(){
  try {
    builder=factory.newDocumentBuilder();
  }
 catch (  ParserConfigurationException e) {
    LOGGER.error(e);
  }
}
Program: 40786
Project: 40786
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null || (obj.getClass() != this.getClass()))   return false;
  BrowserConfR secondObj=(BrowserConfR)obj;
  if (this.isRemoteFlag() == secondObj.isRemoteFlag()) {
    if (this.isRemoteFlag() == true) {
      if (this.isBrowserStackSwitch() == secondObj.isBrowserStackSwitch()) {
        if (this.isBrowserStackSwitch() == true) {
          return (this.getBrowser() == secondObj.getBrowser() && this.getBrowserVersion() == secondObj.getBrowserVersion() && this.getOsName() == secondObj.getOsName() && this.getOsVersion() == secondObj.getOsVersion());
        }
 else {
          return (this.getBrowser() == secondObj.getBrowser());
        }
      }
 else {
        return false;
      }
    }
 else {
      return this.getBrowser() == secondObj.getBrowser();
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null || (obj.getClass() != this.getClass()))   return false;
  BrowserConfR secondObj=(BrowserConfR)obj;
  if (this.isRemoteFlag() == secondObj.isRemoteFlag()) {
    if (this.isRemoteFlag() == true) {
      if (this.isBrowserStackSwitch() == secondObj.isBrowserStackSwitch()) {
        if (this.isBrowserStackSwitch() == true) {
          return (this.getBrowser().equals(secondObj.getBrowser()) && this.getBrowserVersion().equals(secondObj.getBrowserVersion()) && this.getOsName().equals(secondObj.getOsName())&& this.getOsVersion().equals(secondObj.getOsVersion()));
        }
 else {
          return (this.getBrowser().equals(secondObj.getBrowser()));
        }
      }
 else {
        return false;
      }
    }
 else {
      return this.getBrowser().equals(secondObj.getBrowser());
    }
  }
  return false;
}
Program: 40787
Project: 40787
Buggy source:
@Test(enabled=true,description="String_Node_Str") public void checkBrowserConfEquality_RemoteFlagOFF(){
  browserConfValues1.clear();
  browserConfValues2.clear();
  browserConfValues1.put(DriverConfigurations.LocalEnvironmentConfig.browserName.toString(),"String_Node_Str");
  browserConfValues1.put(DriverConfigurations.FrameworkConfig.remoteFlag.toString(),"String_Node_Str");
  browserConfValues2.put(DriverConfigurations.LocalEnvironmentConfig.browserName.toString(),"String_Node_Str");
  browserConfValues2.put(DriverConfigurations.FrameworkConfig.remoteFlag.toString(),"String_Node_Str");
  BrowserConfR obj1=new BrowserConfR(browserConfValues1);
  BrowserConfR obj2=new BrowserConfR(browserConfValues2);
  browserConfList.add(obj1);
  browserConfList.add(obj2);
  Assert.assertEquals(browserConfList.size(),2);
  Set<IBrowserConf> s=new HashSet<IBrowserConf>(browserConfList);
  List<IBrowserConf> newList=new ArrayList<IBrowserConf>(s);
  Assert.assertEquals(obj1,obj2);
  Assert.assertEquals(s.size(),1);
  Assert.assertEquals(newList.size(),1);
}

Fixed version (ground truth):
@Test(enabled=true,description="String_Node_Str") public void checkBrowserConfEquality_RemoteFlagOFF(){
  browserConfValues1.put(DriverConfigurations.LocalEnvironmentConfig.browserName.toString(),new String("String_Node_Str"));
  browserConfValues1.put(DriverConfigurations.FrameworkConfig.remoteFlag.toString(),"String_Node_Str");
  browserConfValues2.put(DriverConfigurations.LocalEnvironmentConfig.browserName.toString(),new String("String_Node_Str"));
  browserConfValues2.put(DriverConfigurations.FrameworkConfig.remoteFlag.toString(),"String_Node_Str");
  IBrowserConf obj1=new BrowserConfR(browserConfValues1);
  IBrowserConf obj2=new BrowserConfR(browserConfValues2);
  browserConfList.add(obj1);
  browserConfList.add(obj2);
  Assert.assertEquals(browserConfList.size(),2);
  Set<IBrowserConf> s=new HashSet<IBrowserConf>(browserConfList);
  List<IBrowserConf> newList=new ArrayList<IBrowserConf>(s);
  Assert.assertEquals(obj1,obj2);
  Assert.assertEquals(s.size(),1);
  Assert.assertEquals(newList.size(),1);
}
Program: 40788
Project: 40788
Buggy source:
/** 
 * wait for tunnel to be up
 * @param waitForMessage
 * @throws IOException
 * @throws InterruptedException
 */
private void waitforTunnelTobeUp(String waitForMessage) throws IOException, InterruptedException {
  is=tunnelProcess.getInputStream();
  br=new BufferedReader(new InputStreamReader(is));
  String t="String_Node_Str";
  while (!waitForMessage.equalsIgnoreCase(t) && t != null)   try {
    t=br.readLine();
    LOGGER.info("String_Node_Str" + t);
  }
 catch (  IOException e) {
    LOGGER.error(e);
  }
}

Fixed version (ground truth):
/** 
 * wait for tunnel to be up
 * @param waitForMessage
 * @throws IOException
 * @throws InterruptedException
 */
private void waitforTunnelTobeUp(String waitForMessage) throws IOException, InterruptedException {
  is=tunnelProcess.getInputStream();
  br=new BufferedReader(new InputStreamReader(is));
  String t="String_Node_Str";
  while (!waitForMessage.equalsIgnoreCase(t) && t != null) {
    try {
      t=br.readLine();
      LOGGER.info("String_Node_Str" + t);
    }
 catch (    IOException e) {
      LOGGER.error(e);
    }
  }
}
Program: 40789
Project: 40789
Buggy source:
/** 
 * Kills the tunnel
 */
public void kill(){
  Process killProcess=null;
  ProcessBuilder killpb=new ProcessBuilder();
  killpb.command(getKillCommand());
  try {
    killProcess=killpb.start();
    killProcess.waitFor();
  }
 catch (  IOException e) {
    LOGGER.error(e);
  }
catch (  InterruptedException e) {
    LOGGER.error(e);
  }
 finally {
    if (killProcess != null)     killProcess.destroy();
  }
}

Fixed version (ground truth):
/** 
 * Kills the tunnel
 */
public void kill(){
  Process killProcess=null;
  ProcessBuilder killpb=new ProcessBuilder();
  killpb.command(getKillCommand());
  try {
    killProcess=killpb.start();
    killProcess.waitFor();
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + browserStackKey + "String_Node_Str"+ e);
  }
catch (  InterruptedException e) {
    LOGGER.error("String_Node_Str" + browserStackKey + "String_Node_Str"+ e);
  }
 finally {
    if (killProcess != null) {
      killProcess.destroy();
    }
  }
}
Program: 40790
Project: 40790
Buggy source:
public static OSN get(){
  LOGGER.debug("String_Node_Str" + OS);
  if (OS.indexOf("String_Node_Str") >= 0)   return OSN.WIN;
 else   if (OS.indexOf("String_Node_Str") >= 0)   return OSN.MAC;
 else   if (OS.indexOf("String_Node_Str") >= 0 || OS.indexOf("String_Node_Str") >= 0 || OS.indexOf("String_Node_Str") > 0)   return OSN.UNIX;
 else   throw new FrameworkException("String_Node_Str" + OS);
}

Fixed version (ground truth):
public static OSN get(){
  LOGGER.debug("String_Node_Str" + OS);
  if (OS.indexOf("String_Node_Str") >= 0) {
    return OSN.WIN;
  }
 else   if (OS.indexOf("String_Node_Str") >= 0) {
    return OSN.MAC;
  }
 else   if (OS.indexOf("String_Node_Str") >= 0 || OS.indexOf("String_Node_Str") >= 0 || OS.indexOf("String_Node_Str") > 0) {
    return OSN.UNIX;
  }
 else {
    throw new FrameworkException("String_Node_Str" + OS);
  }
}
Program: 40791
Project: 40791
Buggy source:
@org.testng.annotations.DataProvider(name="String_Node_Str",parallel=true) public static Object[][] googleSheetDataProvider(Method m){
  String methodName=getFullMethodName(m);
  return getData(methodName);
}

Fixed version (ground truth):
@org.testng.annotations.DataProvider(name="String_Node_Str",parallel=true) public static Object[][] googleSheetDataProvider(Method m){
  String testMethodName=getFullMethodName(m);
  return getData(testMethodName);
}
Program: 40793
Project: 40793
Buggy source:
public Builder withRunStartegy(String runStrategy){
  if ("String_Node_Str".equalsIgnoreCase(runStrategy))   this.runStrat=mapStrategy.Full;
 else   if ("String_Node_Str".equalsIgnoreCase(runStrategy))   this.runStrat=mapStrategy.Optimal;
 else   this.runStrat=mapStrategy.Optimal;
  return this;
}

Fixed version (ground truth):
public Builder withRunStartegy(String runStrategy){
  if ("String_Node_Str".equalsIgnoreCase(runStrategy))   this.runStrat=mapStrategy.Full;
 else   if ("String_Node_Str".equalsIgnoreCase(runStrategy))   this.runStrat=mapStrategy.Optimal;
 else   this.runStrat=null;
  return this;
}
Program: 40794
Project: 40794
Buggy source:
private mapStrategy getRunStrategy(Method method){
  IMappingData methodRunStartegy=primaryDataMap.get(method.getName().toString());
  IMappingData classRunStartegy=primaryDataMap.get(method.getDeclaringClass().getName().toString());
  IMappingData packageRunStartegy=primaryDataMap.get(method.getDeclaringClass().getPackage().getName().toString());
  if (methodRunStartegy != null && methodRunStartegy.getRunStartegy() != null) {
    return methodRunStartegy.getRunStartegy();
  }
 else   if (classRunStartegy != null && classRunStartegy.getRunStartegy() != null) {
    return classRunStartegy.getRunStartegy();
  }
 else   if (packageRunStartegy != null && packageRunStartegy.getRunStartegy() != null) {
    return packageRunStartegy.getRunStartegy();
  }
  return mapStrategy.Optimal;
}

Fixed version (ground truth):
private mapStrategy getRunStrategy(Method method){
  IMappingData methodRunStartegy=primaryDataMap.get(method.getName().toString());
  IMappingData classRunStartegy=primaryDataMap.get(method.getDeclaringClass().getName().toString());
  IMappingData packageRunStartegy=primaryDataMap.get(method.getDeclaringClass().getPackage().getName().toString());
  System.out.println(classRunStartegy.getRunStartegy());
  if (methodRunStartegy != null && methodRunStartegy.getRunStartegy() != null) {
    return methodRunStartegy.getRunStartegy();
  }
 else   if (classRunStartegy != null && classRunStartegy.getRunStartegy() != null) {
    return classRunStartegy.getRunStartegy();
  }
 else   if (packageRunStartegy != null && packageRunStartegy.getRunStartegy() != null) {
    return packageRunStartegy.getRunStartegy();
  }
  return mapStrategy.Optimal;
}
Program: 40795
Project: 40795
Buggy source:
public RefineMappedData(IDataSource dataSource){
  primaryDataMap=dataSource.getPrimaryData();
}

Fixed version (ground truth):
public RefineMappedData(IDataSource dataSource){
  primaryDataMap=dataSource.getPrimaryData();
  for (  String s : primaryDataMap.keySet()) {
    System.out.println("String_Node_Str" + s + "String_Node_Str"+ primaryDataMap.get(s).getRunStartegy());
  }
}
Program: 40796
Project: 40796
Buggy source:
public MappingParserRevisit(String xmlName){
  this.xmlName=xmlName;
  try {
    builder=factory.newDocumentBuilder();
    document=builder.parse("String_Node_Str");
  }
 catch (  ParserConfigurationException e) {
  }
catch (  SAXException e) {
  }
catch (  IOException e) {
  }
}

Fixed version (ground truth):
public MappingParserRevisit(String xmlName){
  this.xmlName=xmlName;
  try {
    builder=factory.newDocumentBuilder();
    document=builder.parse(Utils.getResources(this,xmlName));
  }
 catch (  ParserConfigurationException e) {
  }
catch (  SAXException e) {
  }
catch (  IOException e) {
  }
}
Program: 40797
Project: 40797
Buggy source:
/** 
 * An expectation for checking that an element is either invisible or not present on the DOM.
 * @param locator used to find the element
 */
public static ExpectedCondition<Boolean> invisibilityOfElementLocated(final By locator){
  return new ExpectedCondition<Boolean>(){
    public Boolean apply(    WebDriver driver){
      try {
        return driver.findElements(locator).size() == 0;
      }
 catch (      NoSuchElementException e) {
        return true;
      }
catch (      StaleElementReferenceException e) {
        return true;
      }
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}

Fixed version (ground truth):
/** 
 * An expectation for checking that an element is either invisible or not present on the DOM.
 * @param locator used to find the element
 */
public static ExpectedCondition<Boolean> invisibilityOfElementLocated(final By locator){
  return new ExpectedCondition<Boolean>(){
    public Boolean apply(    WebDriver driver){
      try {
        return driver.findElements(locator).size() == 0;
      }
 catch (      NoSuchElementException e) {
        LOGGER.error(e);
        return true;
      }
catch (      StaleElementReferenceException e) {
        LOGGER.error(e);
        return true;
      }
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}
Program: 40798
Project: 40798
Buggy source:
/** 
 * Check clikability for the list of WebElement
 * @param elements
 * @return
 */
public static ExpectedCondition<Boolean> elementToBeClickable(final List<WebElement> elements){
  final List<Boolean> statusList=new ArrayList<Boolean>();
  return new ExpectedCondition<Boolean>(){
    public Boolean apply(    WebDriver driver){
      if (elements.size() == 0)       return false;
      statusList.clear();
      for (      WebElement w : elements) {
        try {
          if (w != null && w.isEnabled() && w.isDisplayed()) {
            statusList.add(true);
          }
 else {
            return false;
          }
        }
 catch (        StaleElementReferenceException e) {
          return false;
        }
      }
      LOGGER.debug("String_Node_Str" + elements.size() + "String_Node_Str"+ statusList.size());
      return statusList.size() == elements.size() ? true : false;
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Check clikability for the list of WebElement
 * @param elements
 * @return
 */
public static ExpectedCondition<Boolean> elementToBeClickable(final List<WebElement> elements){
  final List<Boolean> statusList=new ArrayList<Boolean>();
  return new ExpectedCondition<Boolean>(){
    public Boolean apply(    WebDriver driver){
      if (elements.size() == 0)       return false;
      statusList.clear();
      for (      WebElement w : elements) {
        try {
          if (w != null && w.isEnabled() && w.isDisplayed()) {
            statusList.add(true);
          }
 else {
            return false;
          }
        }
 catch (        StaleElementReferenceException e) {
          LOGGER.error(e);
          return false;
        }
      }
      LOGGER.debug("String_Node_Str" + elements.size() + "String_Node_Str"+ statusList.size());
      return statusList.size() == elements.size() ? true : false;
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}
Program: 40799
Project: 40799
Buggy source:
public Boolean apply(WebDriver driver){
  for (  WebElement w : elements) {
    try {
      if (w != null && w.isDisplayed()) {
        statusList.add(true);
      }
 else {
        return null;
      }
    }
 catch (    StaleElementReferenceException e) {
      return null;
    }
  }
  return statusList.size() == elements.size() ? true : false;
}

Fixed version (ground truth):
public Boolean apply(WebDriver driver){
  for (  WebElement w : elements) {
    try {
      if (w != null && w.isDisplayed()) {
        statusList.add(true);
      }
 else {
        return null;
      }
    }
 catch (    StaleElementReferenceException e) {
      LOGGER.error(e);
      return null;
    }
  }
  return statusList.size() == elements.size() ? true : false;
}
Program: 40800
Project: 40800
Buggy source:
/** 
 * This method accepts n number of WebElements and check for click ability if any of the WebElement is not click able will return false
 * @param elements
 * @return
 */
public static ExpectedCondition<Boolean> elementsToBeClickable(final WebElement... elements){
  final List<Boolean> statusList=new ArrayList<Boolean>();
  return new ExpectedCondition<Boolean>(){
    final StringBuilder sb=new StringBuilder();
    public Boolean apply(    WebDriver driver){
      for (      WebElement w : elements) {
        try {
          if (w.isDisplayed() && w.isEnabled()) {
            statusList.add(true);
          }
 else {
            statusList.add(false);
          }
        }
 catch (        StaleElementReferenceException e) {
          statusList.add(false);
        }
      }
      if (statusList.contains(false)) {
        statusList.clear();
        return false;
      }
      return true;
    }
    @Override public String toString(){
      return "String_Node_Str" + sb;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * This method accepts n number of WebElements and check for click ability if any of the WebElement is not click able will return false
 * @param elements
 * @return
 */
public static ExpectedCondition<Boolean> elementsToBeClickable(final WebElement... elements){
  final List<Boolean> statusList=new ArrayList<Boolean>();
  return new ExpectedCondition<Boolean>(){
    final StringBuilder sb=new StringBuilder();
    public Boolean apply(    WebDriver driver){
      for (      WebElement w : elements) {
        try {
          if (w.isDisplayed() && w.isEnabled()) {
            statusList.add(true);
          }
 else {
            statusList.add(false);
          }
        }
 catch (        StaleElementReferenceException e) {
          LOGGER.error(e);
          statusList.add(false);
        }
      }
      if (statusList.contains(false)) {
        statusList.clear();
        return false;
      }
      return true;
    }
    @Override public String toString(){
      return "String_Node_Str" + sb;
    }
  }
;
}
Program: 40801
Project: 40801
Buggy source:
/** 
 * Check if all the element in the List are displayed
 * @param elements
 * @return
 */
public static ExpectedCondition<Boolean> elementToBeDisplayed(final List<WebElement> elements){
  final List<Boolean> statusList=new ArrayList<Boolean>();
  return new ExpectedCondition<Boolean>(){
    public Boolean apply(    WebDriver driver){
      for (      WebElement w : elements) {
        try {
          if (w != null && w.isDisplayed()) {
            statusList.add(true);
          }
 else {
            return null;
          }
        }
 catch (        StaleElementReferenceException e) {
          return null;
        }
      }
      return statusList.size() == elements.size() ? true : false;
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Check if all the element in the List are displayed
 * @param elements
 * @return
 */
public static ExpectedCondition<Boolean> elementToBeDisplayed(final List<WebElement> elements){
  final List<Boolean> statusList=new ArrayList<Boolean>();
  return new ExpectedCondition<Boolean>(){
    public Boolean apply(    WebDriver driver){
      for (      WebElement w : elements) {
        try {
          if (w != null && w.isDisplayed()) {
            statusList.add(true);
          }
 else {
            return null;
          }
        }
 catch (        StaleElementReferenceException e) {
          LOGGER.error(e);
          return null;
        }
      }
      return statusList.size() == elements.size() ? true : false;
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}
Program: 40802
Project: 40802
Buggy source:
/** 
 * This method return full path of the resource file name using class loader Can be used to upload files on website
 * @param className : Class which is calling this method
 * @param fileName
 * @return
 */
public static String getResources(Object className,String fileName){
  LOGGER.debug("String_Node_Str" + fileName);
  String returFilePath=null;
  try {
switch (OSName.get()) {
case UNIX:
      returFilePath=className.getClass().getResource("String_Node_Str" + fileName).getPath();
    break;
case WIN:
  returFilePath=className.getClass().getResource("String_Node_Str" + fileName).getPath().substring(1).replace("String_Node_Str","String_Node_Str");
break;
case MAC:
returFilePath=className.getClass().getResource("String_Node_Str" + fileName).getPath();
break;
default :
break;
}
if (LOGGER.isDebugEnabled()) LOGGER.debug("String_Node_Str" + returFilePath);
return returFilePath;
}
 catch (NullPointerException e) {
LOGGER.error("String_Node_Str" + fileName + "String_Node_Str"+ className.toString()+ "String_Node_Str");
return null;
}
}

Fixed version (ground truth):
/** 
 * This method return full path of the resource file name using class loader Can be used to upload files on website
 * @param className : Class which is calling this method
 * @param fileName
 * @return
 */
public static String getResources(Object className,String fileName){
  LOGGER.debug("String_Node_Str" + fileName);
  String returFilePath=null;
  try {
switch (OSName.get()) {
case UNIX:
      returFilePath=className.getClass().getResource("String_Node_Str" + fileName).getPath();
    break;
case WIN:
  returFilePath=className.getClass().getResource("String_Node_Str" + fileName).getPath().substring(1).replace("String_Node_Str","String_Node_Str");
break;
case MAC:
returFilePath=className.getClass().getResource("String_Node_Str" + fileName).getPath();
break;
default :
break;
}
if (LOGGER.isDebugEnabled()) LOGGER.debug("String_Node_Str" + returFilePath);
return returFilePath;
}
 catch (NullPointerException e) {
LOGGER.error("String_Node_Str" + fileName + "String_Node_Str"+ className.toString()+ "String_Node_Str");
LOGGER.error(e);
return null;
}
}
Program: 40803
Project: 40803
Buggy source:
/** 
 * return the value of the key passed for the properties file passed in constructor of the class
 */
public String getValue(String key){
  String value;
  try {
    value=propertiesValue.get(key);
    if (value == null)     throw new NullPointerException();
    return value;
  }
 catch (  NullPointerException e) {
    throw new FrameworkException("String_Node_Str" + key + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * return the value of the key passed for the properties file passed in constructor of the class
 */
public String getValue(String key){
  String value;
  try {
    value=propertiesValue.get(key);
    if (value == null)     throw new NullPointerException();
    return value;
  }
 catch (  NullPointerException e) {
    LOGGER.error(e);
    throw new FrameworkException("String_Node_Str" + key + "String_Node_Str");
  }
}
Program: 40804
Project: 40804
Buggy source:
/** 
 * Get the map having key as methodName of   {@link IBrowserConf} for therefined data
 * @param data
 * @return
 * @throws IOException
 * @throws ServiceException
 */
public List<IBrowserConf> getBrowserListForSheet(IMappingData data){
  IMappingData methodData=data;
  List<IBrowserConf> browserConfList=new ArrayList<IBrowserConf>();
  URL browserSheetURL;
  String sheetNameHolder=null;
  ListFeed browserFeed;
  for (  String browserSheet : methodData.getClientEnvironment()) {
    sheetNameHolder=browserSheet;
    try {
      browserSheetURL=getWorkSheet(browserSheet).getListFeedUrl();
      browserFeed=service.getFeed(browserSheetURL,ListFeed.class);
      for (      ListEntry row : browserFeed.getEntries()) {
        browserConfList.add(getBrowserConfFromRow(row));
      }
    }
 catch (    NullPointerException ex) {
      System.out.println("String_Node_Str" + sheetNameHolder);
      LOGGER.error(ex);
    }
catch (    IOException e) {
      LOGGER.error(e);
    }
catch (    ServiceException e) {
      LOGGER.error(e);
    }
  }
  return browserConfList;
}

Fixed version (ground truth):
/** 
 * Get the map having key as methodName of   {@link IBrowserConf} for therefined data
 * @param data
 * @return
 * @throws IOException
 * @throws ServiceException
 */
public List<IBrowserConf> getBrowserListForSheet(IMappingData data){
  IMappingData methodData=data;
  List<IBrowserConf> browserConfList=new ArrayList<IBrowserConf>();
  URL browserSheetURL;
  String sheetNameHolder=null;
  ListFeed browserFeed;
  for (  String browserSheet : methodData.getClientEnvironment()) {
    sheetNameHolder=browserSheet;
    try {
      browserSheetURL=getWorkSheet(browserSheet).getListFeedUrl();
      browserFeed=service.getFeed(browserSheetURL,ListFeed.class);
      for (      ListEntry row : browserFeed.getEntries()) {
        browserConfList.add(getBrowserConfFromRow(row));
      }
    }
 catch (    NullPointerException ex) {
      LOGGER.error("String_Node_Str" + sheetNameHolder);
      LOGGER.error(ex);
    }
catch (    IOException e) {
      LOGGER.error(e);
    }
catch (    ServiceException e) {
      LOGGER.error(e);
    }
  }
  return browserConfList;
}
Program: 40805
Project: 40805
Buggy source:
public MappingParserRevisit(String xmlName){
  this.xmlName=xmlName;
  try {
    builder=factory.newDocumentBuilder();
    document=builder.parse(Utils.getResources(this,xmlName));
  }
 catch (  ParserConfigurationException e) {
  }
catch (  SAXException e) {
  }
catch (  IOException e) {
  }
}

Fixed version (ground truth):
public MappingParserRevisit(String xmlName){
  this.xmlName=xmlName;
  try {
    builder=factory.newDocumentBuilder();
    document=builder.parse(Utils.getResources(this,xmlName));
  }
 catch (  ParserConfigurationException e) {
    LOGGER.error(e);
  }
catch (  SAXException e) {
    LOGGER.error(e);
  }
catch (  IOException e) {
    LOGGER.error(e);
  }
}
Program: 40806
Project: 40806
Buggy source:
/** 
 * Generic waitFor Function which waits for condition to be successful else return null
 * @param expectedCondition:ExpectedCondition<T>
 * @param driver:WebDriver
 * @param timeout in seconds
 * @return <T> or null
 */
public static <T>T waitFor(ExpectedCondition<T> expectedCondition,WebDriver driver,int timeOutInSeconds){
  Stopwatch stopwatch=new Stopwatch();
  stopwatch.start();
  driver.manage().timeouts().implicitlyWait(0,TimeUnit.SECONDS);
  try {
    T returnValue=new WebDriverWait(driver,timeOutInSeconds).pollingEvery(500,TimeUnit.MILLISECONDS).until(expectedCondition);
    return returnValue;
  }
 catch (  TimeoutException e) {
    return null;
  }
 finally {
    driver.manage().timeouts().implicitlyWait(Driver.getBrowserConf().getDriverTimeOut(),TimeUnit.SECONDS);
    stopwatch.stop();
    LOGGER.debug("String_Node_Str" + stopwatch.elapsedTime(TimeUnit.SECONDS));
  }
}

Fixed version (ground truth):
/** 
 * Generic waitFor Function which waits for condition to be successful else return null
 * @param expectedCondition:ExpectedCondition<T>
 * @param driver:WebDriver
 * @param timeout in seconds
 * @return <T> or null
 */
public static <T>T waitFor(ExpectedCondition<T> expectedCondition,WebDriver driver,int timeOutInSeconds){
  Stopwatch stopwatch=new Stopwatch();
  stopwatch.start();
  driver.manage().timeouts().implicitlyWait(0,TimeUnit.SECONDS);
  try {
    T returnValue=new WebDriverWait(driver,timeOutInSeconds).pollingEvery(500,TimeUnit.MILLISECONDS).until(expectedCondition);
    return returnValue;
  }
 catch (  TimeoutException e) {
    LOGGER.error(e);
    return null;
  }
 finally {
    driver.manage().timeouts().implicitlyWait(Driver.getBrowserConf().getDriverTimeOut(),TimeUnit.SECONDS);
    stopwatch.stop();
    LOGGER.debug("String_Node_Str" + stopwatch.elapsedTime(TimeUnit.SECONDS));
  }
}
Program: 40807
Project: 40807
Buggy source:
/** 
 * Select Value from Drop Down with visible Text ,if no Such Element Found <br> Select default index
 * @param webElement :Select WebElement
 * @param visibleText :String to be Selected
 * @param defaultIndex :index to be selected by if value with string is not found
 * @author kapilA
 */
public static void selectDropDown(WebElement webElement,String visibleText,Integer defaultIndex){
  checkArgument(visibleText != null && !visibleText.isEmpty(),"String_Node_Str");
  Select s=new Select(webElement);
  try {
    s.selectByVisibleText(visibleText);
  }
 catch (  NoSuchElementException e) {
    s.selectByIndex(defaultIndex);
  }
}

Fixed version (ground truth):
/** 
 * Select Value from Drop Down with visible Text ,if no Such Element Found <br> Select default index
 * @param webElement :Select WebElement
 * @param visibleText :String to be Selected
 * @param defaultIndex :index to be selected by if value with string is not found
 * @author kapilA
 */
public static void selectDropDown(WebElement webElement,String visibleText,Integer defaultIndex){
  checkArgument(visibleText != null && !visibleText.isEmpty(),"String_Node_Str");
  Select s=new Select(webElement);
  try {
    s.selectByVisibleText(visibleText);
  }
 catch (  NoSuchElementException e) {
    LOGGER.error(e);
    s.selectByIndex(defaultIndex);
  }
}
Program: 40808
Project: 40808
Buggy source:
/** 
 * Return key values pair for the the tag ClientEnvironment of the Browser Xml
 * @param keyElement
 * @return
 */
private HashMap<String,String> getKeyValue(Element keyElement){
  HashMap<String,String> browserData=new HashMap<String,String>();
  Element element=keyElement;
  HashMap<String,String> f_map=new HashMap<String,String>();
  for (  DriverConfigurations.LocalEnvironmentConfig localConfig : DriverConfigurations.LocalEnvironmentConfig.values()) {
    browserData.put(localConfig.toString(),element.getAttribute(localConfig.toString()));
  }
  for (  DriverConfigurations.BrowserStackConfig bsConfig : DriverConfigurations.BrowserStackConfig.values()) {
    browserData.put(bsConfig.toString(),element.getAttribute(bsConfig.toString()));
  }
  for (  DriverConfigurations.HubConfig hubConfig : DriverConfigurations.HubConfig.values()) {
    browserData.put(hubConfig.toString(),element.getAttribute(hubConfig.toString()));
  }
  for (  DriverConfigurations.FrameworkConfig frameworkConfig : DriverConfigurations.FrameworkConfig.values()) {
    browserData.put(frameworkConfig.toString(),element.getAttribute(frameworkConfig.toString()));
  }
  return browserData;
}

Fixed version (ground truth):
/** 
 * Return key values pair for the the tag ClientEnvironment of the Browser Xml
 * @param keyElement
 * @return
 */
private HashMap<String,String> getKeyValue(Element keyElement){
  HashMap<String,String> browserData=new HashMap<String,String>();
  Element element=keyElement;
  for (  DriverConfigurations.LocalEnvironmentConfig localConfig : DriverConfigurations.LocalEnvironmentConfig.values()) {
    browserData.put(localConfig.toString(),element.getAttribute(localConfig.toString()));
  }
  for (  DriverConfigurations.BrowserStackConfig bsConfig : DriverConfigurations.BrowserStackConfig.values()) {
    browserData.put(bsConfig.toString(),element.getAttribute(bsConfig.toString()));
  }
  for (  DriverConfigurations.HubConfig hubConfig : DriverConfigurations.HubConfig.values()) {
    browserData.put(hubConfig.toString(),element.getAttribute(hubConfig.toString()));
  }
  for (  DriverConfigurations.FrameworkConfig frameworkConfig : DriverConfigurations.FrameworkConfig.values()) {
    browserData.put(frameworkConfig.toString(),element.getAttribute(frameworkConfig.toString()));
  }
  return browserData;
}
Program: 40809
Project: 40809
Buggy source:
/** 
 * Get the Body of the Email message
 */
@Override public String getEmailBody(Message message){
  String line;
  StringBuffer messageBody=new StringBuffer();
  try {
    folder.open(Folder.READ_ONLY);
    BufferedReader br=new BufferedReader(new InputStreamReader(message.getInputStream()));
    while ((line=br.readLine()) != null) {
      messageBody.append(line);
    }
    folder.close(true);
  }
 catch (  IOException e) {
    LOGGER.error(e);
  }
catch (  MessagingException e) {
    LOGGER.error(e);
  }
  return messageBody.toString();
}

Fixed version (ground truth):
/** 
 * Get the Body of the Email message
 */
@Override public String getEmailBody(Message message){
  String line;
  StringBuffer messageBody=new StringBuffer();
  BufferedReader br=null;
  try {
    folder.open(Folder.READ_ONLY);
    br=new BufferedReader(new InputStreamReader(message.getInputStream()));
    while ((line=br.readLine()) != null) {
      messageBody.append(line);
    }
    br.close();
    folder.close(true);
  }
 catch (  IOException e) {
    LOGGER.error(e);
  }
catch (  MessagingException e) {
    LOGGER.error(e);
  }
  return messageBody.toString();
}
Program: 40810
Project: 40810
Buggy source:
@Override public List<IMethodInstance> intercept(List<IMethodInstance> methods,ITestContext context){
  if (!testDataPrepared) {
    PrettyMessage prettyMessage=new PrettyMessage();
    Thread t=new Thread(prettyMessage);
    t.start();
    String evironment=System.getProperty("String_Node_Str");
    for (    IMethodInstance method : methods) {
      String dataProviderName=method.getMethod().getConstructorOrMethod().getMethod().getAnnotation(org.testng.annotations.Test.class).dataProvider();
      Method methodReflect=method.getMethod().getConstructorOrMethod().getMethod();
      if (dataProviderName.equals("String_Node_Str")) {
        updateGooglSheet(methodReflect,evironment);
      }
 else       if (dataProviderName.equals("String_Node_Str")) {
        updateXml(methodReflect,evironment);
      }
    }
    prettyMessage.swtichOffLogging();
    try {
      t.join();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    testDataPrepared=true;
  }
  return methods;
}

Fixed version (ground truth):
@Override public List<IMethodInstance> intercept(List<IMethodInstance> methods,ITestContext context){
  if (!testDataPrepared) {
    PrettyMessage prettyMessage=new PrettyMessage();
    Thread t=new Thread(prettyMessage);
    t.start();
    String evironment=System.getProperty("String_Node_Str");
    for (    IMethodInstance method : methods) {
      String dataProviderName=method.getMethod().getConstructorOrMethod().getMethod().getAnnotation(org.testng.annotations.Test.class).dataProvider();
      Method methodReflect=method.getMethod().getConstructorOrMethod().getMethod();
      if (dataProviderName.equals("String_Node_Str")) {
        updateGooglSheet(methodReflect,evironment);
      }
 else       if (dataProviderName.equals("String_Node_Str")) {
        updateXml(methodReflect,evironment);
      }
    }
    prettyMessage.swtichOffLogging();
    try {
      t.join();
    }
 catch (    InterruptedException e) {
      LOGGER.error(e);
    }
    testDataPrepared=true;
  }
  return methods;
}