nus-yam/ex-repair huggingface dataset:
Program: 8419
Project: 8419
Buggy source:
/** 
 * This is a public constructor to create an input stream and YAML instance for the input file.
 * @param fileName the name of the YAML data file.
 * @throws IOException
 */
public YamlV2Reader(String fileName) throws IOException {
  FileSystemResource resource=new FileSystemResource(fileName);
  processPage(resource);
}

Fixed version (ground truth):
/** 
 * This is a public constructor to create an input stream and YAML instance for the input file.
 * @param fileName the name of the YAML data file.
 * @throws IOException
 */
public YamlV2Reader(String fileName) throws IOException {
  super();
  FileSystemResource resource=new FileSystemResource(fileName);
  processPage(resource);
}
Program: 8420
Project: 8420
Buggy source:
/** 
 * @param request a  {@link RegistrationRequest} request which represents the basic information that is to be consumed bythe grid when it is registering a new node.
 * @param registry a  {@link Registry} object that represent's the Grid's registry.
 * @throws IOException
 */
public SeLionRemoteProxy(RegistrationRequest request,Registry registry) throws IOException {
  super(request,registry);
  StringBuffer info=new StringBuffer();
  maxSessionsAllowed=getUniqueSessionCount();
  machine=getRemoteHost().getHost();
  SimpleLoggerSettings loggerSettings=new SimpleLoggerSettings();
  loggerSettings.setUserLogFileName(machine + "String_Node_Str");
  loggerSettings.setLogsDir(SeLionGridConstants.LOGS_DIR);
  loggerSettings.setDevLevel(Level.OFF);
  loggerSettings.setLoggerName(SeLionRemoteProxy.class.getCanonicalName());
  loggerSettings.setClassName(SeLionRemoteProxy.class.getSimpleName());
  loggerSettings.setIdentifier(SeLionBuildInfo.getBuildValue(SeLionBuildProperty.SELION_VERSION));
  loggerSettings.setMaxFileCount(1);
  loggerSettings.setMaxFileSize(5);
  proxyLogger=SimpleLogger.getLogger(loggerSettings);
  info.append("String_Node_Str").append(machine);
  proxyLogger.info(info.toString());
  info=new StringBuffer();
  info.append("String_Node_Str");
  info.append(machine).append("String_Node_Str").append(maxSessionsAllowed).append("String_Node_Str");
  proxyLogger.info(info.toString());
}

Fixed version (ground truth):
/** 
 * @param request a  {@link RegistrationRequest} request which represents the basic information that is to be consumed bythe grid when it is registering a new node.
 * @param registry a  {@link Registry} object that represent's the Grid's registry.
 * @throws IOException
 */
public SeLionRemoteProxy(RegistrationRequest request,Registry registry) throws IOException {
  super(request,registry);
  StringBuffer info=new StringBuffer();
  maxSessionsAllowed=getUniqueSessionCount();
  machine=getRemoteHost().getHost();
  SimpleLoggerSettings loggerSettings=new SimpleLoggerSettings();
  loggerSettings.setUserLogFileName(machine + "String_Node_Str");
  loggerSettings.setLogsDir(SeLionGridConstants.LOGS_DIR);
  loggerSettings.setDevLevel(Level.OFF);
  loggerSettings.setLoggerName(machine);
  loggerSettings.setClassName(SeLionRemoteProxy.class.getSimpleName());
  loggerSettings.setIdentifier(SeLionBuildInfo.getBuildValue(SeLionBuildProperty.SELION_VERSION));
  loggerSettings.setMaxFileCount(1);
  loggerSettings.setMaxFileSize(5);
  proxyLogger=SimpleLogger.getLogger(loggerSettings);
  info.append("String_Node_Str").append(machine);
  proxyLogger.info(info.toString());
  info=new StringBuffer();
  info.append("String_Node_Str");
  info.append(machine).append("String_Node_Str").append(maxSessionsAllowed).append("String_Node_Str");
  proxyLogger.info(info.toString());
}
Program: 8421
Project: 8421
Buggy source:
@Override public void afterInvocation(IInvokedMethod method,ITestResult testResult){
  logger.entering(new Object[]{method,testResult});
  if (ListenerManager.executeCurrentMethod(this) == false) {
    logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
    return;
  }
  if (Reporter.getCurrentTestResult() != null) {
    SeLionSoftAssert sa=(SeLionSoftAssert)Reporter.getCurrentTestResult().getAttribute(SeLionSoftAssert.SOFT_ASSERT_ATTRIBUTE_NAME);
    if (sa != null) {
      sa.assertAll();
    }
  }
}

Fixed version (ground truth):
@Override public void afterInvocation(IInvokedMethod method,ITestResult testResult){
  logger.entering(new Object[]{method,testResult});
  try {
    if (ListenerManager.executeCurrentMethod(this) == false) {
      logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
      return;
    }
    if (Reporter.getCurrentTestResult() != null) {
      SeLionSoftAssert sa=(SeLionSoftAssert)Reporter.getCurrentTestResult().getAttribute(SeLionSoftAssert.SOFT_ASSERT_ATTRIBUTE_NAME);
      if (sa != null) {
        sa.assertAll();
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + e.getMessage(),e);
  }
}
Program: 8422
Project: 8422
Buggy source:
@Override public void beforeInvocation(IInvokedMethod method,ITestResult testResult){
  logger.entering(new Object[]{method,testResult});
  if (ListenerManager.executeCurrentMethod(this) == false) {
    logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
    return;
  }
  SeLionSoftAssert softAsserts=new SeLionSoftAssert();
  testResult.setAttribute(SeLionSoftAssert.SOFT_ASSERT_ATTRIBUTE_NAME,softAsserts);
}

Fixed version (ground truth):
@Override public void beforeInvocation(IInvokedMethod method,ITestResult testResult){
  logger.entering(new Object[]{method,testResult});
  try {
    if (ListenerManager.executeCurrentMethod(this) == false) {
      logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
      return;
    }
    SeLionSoftAssert softAsserts=new SeLionSoftAssert();
    testResult.setAttribute(SeLionSoftAssert.SOFT_ASSERT_ATTRIBUTE_NAME,softAsserts);
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + e.getMessage(),e);
  }
}
Program: 8423
Project: 8423
Buggy source:
/** 
 * Executes when test case is finished<br> Identify if webtest wants to have session open, otherwise close session<br> <b>sample</b><br> &#064;webtest(browser="*firefox", <b>keepSessionOpen = true</b>)<br> Analyzes failure if any
 * @see org.testng.IInvokedMethodListener#afterInvocation(org.testng.IInvokedMethod,org.testng.ITestResult)
 */
@Override public void afterInvocation(IInvokedMethod method,ITestResult testResult){
  logger.entering(new Object[]{method,testResult});
  if (ListenerManager.executeCurrentMethod(this) == false) {
    logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
    return;
  }
  if (!method.isTestMethod()) {
    return;
  }
  boolean isWebTestClass=method.getTestMethod().getInstance().getClass().getAnnotation(WebTest.class) != null;
  boolean isMobileTestClass=method.getTestMethod().getInstance().getClass().getAnnotation(MobileTest.class) != null;
  if ((isWebTestClass || isMobileTestClass) && !isHighPriority(method)) {
    return;
  }
  AbstractTestSession testSession=Grid.getTestSession();
  testSession.closeSession();
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * Executes when test case is finished<br> Identify if webtest wants to have session open, otherwise close session<br> <b>sample</b><br> &#064;webtest(browser="*firefox", <b>keepSessionOpen = true</b>)<br> Analyzes failure if any
 * @see org.testng.IInvokedMethodListener#afterInvocation(org.testng.IInvokedMethod,org.testng.ITestResult)
 */
@Override public void afterInvocation(IInvokedMethod method,ITestResult testResult){
  logger.entering(new Object[]{method,testResult});
  try {
    if (ListenerManager.executeCurrentMethod(this) == false) {
      logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
      return;
    }
    if (!method.isTestMethod()) {
      return;
    }
    Class<?> cls=method.getTestMethod().getInstance().getClass();
    boolean isWebTestClass=cls.getAnnotation(WebTest.class) != null;
    boolean isMobileTestClass=cls.getAnnotation(MobileTest.class) != null;
    if ((isWebTestClass || isMobileTestClass) && !isHighPriority(method)) {
      return;
    }
    AbstractTestSession testSession=Grid.getTestSession();
    testSession.closeSession();
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + e.getMessage(),e);
  }
  logger.exiting();
}
Program: 8424
Project: 8424
Buggy source:
/** 
 * Identifies which version and name of browser to start if it specified in &#064;webtest <br> <b>sample</b><br> &#064;webtest(<b>browser="*firefox"</b>)<br>
 * @see org.testng.IInvokedMethodListener#beforeInvocation(org.testng.IInvokedMethod,org.testng.ITestResult)
 */
@Override public void beforeInvocation(IInvokedMethod method,ITestResult testResult){
  logger.entering(new Object[]{method,testResult});
  if (ListenerManager.executeCurrentMethod(this) == false) {
    logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
    return;
  }
  if (!method.isTestMethod()) {
    return;
  }
  boolean isWebTestClass=method.getTestMethod().getInstance().getClass().getAnnotation(WebTest.class) != null;
  boolean isMobileTestClass=method.getTestMethod().getInstance().getClass().getAnnotation(MobileTest.class) != null;
  if ((isWebTestClass || isMobileTestClass)) {
    if (isLowPriority(method)) {
      testSessionSharingRules(method);
    }
 else {
      return;
    }
  }
  AbstractTestSession testSession=TestSessionFactory.newInstance(method);
  Grid.getThreadLocalTestSession().set(testSession);
  InvokedMethodInformation methodInfo=TestNGUtils.getInvokedMethodInformation(method,testResult);
  testSession.initializeTestSession(methodInfo);
  if (!(testSession instanceof BasicTestSession)) {
    LocalGridManager.spawnLocalHub(testSession);
  }
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * Identifies which version and name of browser to start if it specified in &#064;webtest <br> <b>sample</b><br> &#064;webtest(<b>browser="*firefox"</b>)<br>
 * @see org.testng.IInvokedMethodListener#beforeInvocation(org.testng.IInvokedMethod,org.testng.ITestResult)
 */
@Override public void beforeInvocation(IInvokedMethod method,ITestResult testResult){
  logger.entering(new Object[]{method,testResult});
  try {
    if (ListenerManager.executeCurrentMethod(this) == false) {
      logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
      return;
    }
    if (!method.isTestMethod()) {
      return;
    }
    Class<?> cls=method.getTestMethod().getInstance().getClass();
    boolean isWebTestClass=cls.getAnnotation(WebTest.class) != null;
    boolean isMobileTestClass=cls.getAnnotation(MobileTest.class) != null;
    if ((isWebTestClass || isMobileTestClass)) {
      if (isLowPriority(method)) {
        testSessionSharingRules(method);
      }
 else {
        return;
      }
    }
    AbstractTestSession testSession=TestSessionFactory.newInstance(method);
    Grid.getThreadLocalTestSession().set(testSession);
    InvokedMethodInformation methodInfo=TestNGUtils.getInvokedMethodInformation(method,testResult);
    testSession.initializeTestSession(methodInfo);
    if (!(testSession instanceof BasicTestSession)) {
      LocalGridManager.spawnLocalHub(testSession);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + e.getMessage(),e);
  }
  logger.exiting();
}
Program: 8425
Project: 8425
Buggy source:
@Override public void afterInvocation(IInvokedMethod method,ITestResult testResult){
  if (ListenerManager.executeCurrentMethod(this) == false) {
    logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
    return;
  }
}

Fixed version (ground truth):
@Override public void afterInvocation(IInvokedMethod method,ITestResult testResult){
  try {
    if (ListenerManager.executeCurrentMethod(this) == false) {
      logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
      return;
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + e.getMessage(),e);
  }
}
Program: 8426
Project: 8426
Buggy source:
@Override public void beforeInvocation(IInvokedMethod method,ITestResult testResult){
  if (ListenerManager.executeCurrentMethod(this) == false) {
    logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
    return;
  }
  Test testMethod=method.getTestMethod().getConstructorOrMethod().getMethod().getAnnotation(Test.class);
  if (testMethod != null) {
    String testName=testMethod.testName();
    if (StringUtils.isNotEmpty(testName)) {
      testResult.setAttribute(TEST_NAME_KEY,testName);
    }
  }
}

Fixed version (ground truth):
@Override public void beforeInvocation(IInvokedMethod method,ITestResult testResult){
  try {
    if (ListenerManager.executeCurrentMethod(this) == false) {
      logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
      return;
    }
    Test testMethod=method.getTestMethod().getConstructorOrMethod().getMethod().getAnnotation(Test.class);
    if (testMethod != null) {
      String testName=testMethod.testName();
      if (StringUtils.isNotEmpty(testName)) {
        testResult.setAttribute(TEST_NAME_KEY,testName);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + e.getMessage(),e);
  }
}
Program: 8427
Project: 8427
Buggy source:
/** 
 * This method is used to insert test method details based on the methods suite, test, groups and class name.
 * @param suite - suite name of the test method.
 * @param test - test name of the test method.
 * @param packages - group name of the test method. If the test method doesn't belong to any group then we should pass null.
 * @param classname - class name of the test method.
 * @param result - ITestResult instance of the test method.
 */
public synchronized void insertTestMethod(String suite,String test,String packages,String classname,ITestResult result){
  logger.entering(new Object[]{suite,test,packages,classname,result});
  TestMethodInfo test1=new TestMethodInfo(suite,test,packages,classname,result);
  if (result.getStatus() == ITestResult.STARTED) {
    runningTest.add(test1);
    return;
  }
  for (  TestMethodInfo temp : runningTest) {
    if (temp.getResult().equals(result)) {
      runningTest.remove(temp);
      appendFile(jsonCompletedTest,test1.toJson().concat("String_Node_Str"));
      break;
    }
  }
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * This method is used to insert test method details based on the methods suite, test, groups and class name.
 * @param suite - suite name of the test method.
 * @param test - test name of the test method.
 * @param packages - group name of the test method. If the test method doesn't belong to any group then we should pass null.
 * @param classname - class name of the test method.
 * @param result - ITestResult instance of the test method.
 */
public synchronized void insertTestMethod(String suite,String test,String packages,String classname,ITestResult result){
  logger.entering(new Object[]{suite,test,packages,classname,result});
  TestMethodInfo test1=new TestMethodInfo(suite,test,packages,classname,result);
  if (result.getStatus() == ITestResult.STARTED) {
    runningTest.add(test1);
    return;
  }
  for (  TestMethodInfo temp : runningTest) {
    if (temp.getResult().getMethod().equals(result.getMethod())) {
      runningTest.remove(temp);
      appendFile(jsonCompletedTest,test1.toJson().concat("String_Node_Str"));
      break;
    }
  }
  logger.exiting();
}
Program: 8429
Project: 8429
Buggy source:
/** 
 * A method that helps in closing off the current session.
 */
public final void closeSession(){
  logger.entering();
  if (isStarted() && Grid.driver() != null) {
    new SauceLabsHelper().embedSauceLabsJobUrlToTestReport();
    try {
      ITestResult testResult=Reporter.getCurrentTestResult();
      if (testResult.getStatus() == ITestResult.FAILURE && (testResult.getThrowable() instanceof WebDriverException || testResult.getThrowable() instanceof AssertionError)) {
        warnUserOfTestFailures(testResult);
      }
      Grid.driver().quit();
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str" + e.getMessage(),e);
    }
  }
  Grid.getThreadLocalWebDriver().set(null);
  Grid.getThreadLocalTestSession().set(null);
  this.isStarted=false;
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * A method that helps in closing off the current session.
 */
public final void closeSession(){
  logger.entering();
  ITestResult testResult=Reporter.getCurrentTestResult();
  if (isStarted() && Grid.driver() != null) {
    new SauceLabsHelper().embedSauceLabsJobUrlToTestReport();
    try {
      if (testResult.getStatus() == ITestResult.FAILURE && (testResult.getThrowable() instanceof WebDriverException || testResult.getThrowable() instanceof AssertionError)) {
        warnUserOfTestFailures(testResult);
      }
      Grid.driver().quit();
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str" + e.getMessage(),e);
    }
  }
  Grid.getThreadLocalWebDriver().set(null);
  Grid.getThreadLocalTestSession().set(null);
  this.isStarted=false;
  testResult.setAttribute(JsonRuntimeReporterHelper.IS_COMPLETED,true);
  logger.exiting();
}
Program: 8430
Project: 8430
Buggy source:
/** 
 * This method is used to insert test method details based on the methods suite, test, groups and class name.
 * @param suite - suite name of the test method.
 * @param test - test name of the test method.
 * @param packages - group name of the test method. If the test method doesn't belong to any group then we should pass null.
 * @param classname - class name of the test method.
 * @param result - ITestResult instance of the test method.
 */
public synchronized void insertTestMethod(String suite,String test,String packages,String classname,ITestResult result){
  logger.entering(new Object[]{suite,test,packages,classname,result});
  TestMethodInfo test1=new TestMethodInfo(suite,test,packages,classname,result);
  if (result.getStatus() == ITestResult.STARTED) {
    runningTest.add(test1);
    return;
  }
  for (  TestMethodInfo temp : runningTest) {
    if (temp.getResult().getMethod().equals(result.getMethod())) {
      runningTest.remove(temp);
      appendFile(jsonCompletedTest,test1.toJson().concat("String_Node_Str"));
      break;
    }
  }
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * This method is used to insert test method details based on the methods suite, test, groups and class name.
 * @param suite - suite name of the test method.
 * @param test - test name of the test method.
 * @param packages - group name of the test method. If the test method doesn't belong to any group then we should pass null.
 * @param classname - class name of the test method.
 * @param result - ITestResult instance of the test method.
 */
public synchronized void insertTestMethod(String suite,String test,String packages,String classname,ITestResult result){
  logger.entering(new Object[]{suite,test,packages,classname,result});
  TestMethodInfo test1=new TestMethodInfo(suite,test,packages,classname,result);
  if (result.getStatus() == ITestResult.STARTED) {
    runningTest.add(test1);
    return;
  }
  for (  TestMethodInfo temp : runningTest) {
    if (temp.getResult().getMethod().equals(result.getMethod())) {
      runningTest.remove(temp);
      completedTest.add(test1);
      break;
    }
  }
  logger.exiting();
}
Program: 8431
Project: 8431
Buggy source:
public JsonArray getCompletedTestContent() throws JsonParseException {
  return loadJSONArray(jsonCompletedTest);
}

Fixed version (ground truth):
/** 
 * Get list of test methods.
 * @return A list of {@link TestMethodInfo}.
 */
public List<TestMethodInfo> getCompletedTestContent(){
  return completedTest;
}
Program: 8432
Project: 8432
Buggy source:
/** 
 * This method will generate local Configuration summary by fetching the details from ReportDataGenerator
 * @param suiteName - suite name of the test method.
 * @param testName - test name of the test method.
 */
public void generateLocalConfigSummary(String suiteName,String testName){
  logger.entering(new Object[]{suiteName,testName});
  try {
    Map<String,String> testLocalConfigValues=ConfigSummaryData.getLocalConfigSummary(testName);
    JsonObject json=new JsonObject();
    if (testLocalConfigValues == null) {
      json.addProperty(ReporterDateFormatter.CURRENTDATE,ReporterDateFormatter.getISO8601String(new Date()));
    }
 else {
      for (      Entry<String,String> temp : testLocalConfigValues.entrySet()) {
        json.addProperty(temp.getKey(),temp.getValue());
      }
    }
    json.addProperty("String_Node_Str",suiteName);
    json.addProperty("String_Node_Str",testName);
    this.testJsonLocalConfigSummary.add(json);
  }
 catch (  JsonParseException e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    throw new ReporterException(e);
  }
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * This method will generate local Configuration summary by fetching the details from ReportDataGenerator
 * @param suiteName - suite name of the test method.
 * @param testName - test name of the test method.
 */
public void generateLocalConfigSummary(String suiteName,String testName){
  logger.entering(new Object[]{suiteName,testName});
  try {
    Map<String,String> testLocalConfigValues=ConfigSummaryData.getLocalConfigSummary(testName);
    JsonObject json=new JsonObject();
    if (testLocalConfigValues == null) {
      json.addProperty(ReporterDateFormatter.CURRENTDATE,ReporterDateFormatter.getISO8601String(new Date()));
    }
 else {
      for (      Entry<String,String> temp : testLocalConfigValues.entrySet()) {
        json.addProperty(temp.getKey(),temp.getValue());
      }
    }
    json.addProperty("String_Node_Str",suiteName);
    json.addProperty("String_Node_Str",testName);
synchronized (this) {
      this.testJsonLocalConfigSummary.add(json);
    }
  }
 catch (  JsonParseException e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    throw new ReporterException(e);
  }
  logger.exiting();
}
Program: 8433
Project: 8433
Buggy source:
/** 
 * Generate the final report.json from the completed test and completed configuration temporary files.
 * @param outputDirectory - output directory
 * @param bForceWrite - setting true will forcibly generate the report.json
 */
public synchronized void writeJSON(String outputDirectory,boolean bForceWrite){
  logger.entering(new Object[]{outputDirectory,bForceWrite});
  long currentTime=System.currentTimeMillis();
  if (!bForceWrite) {
    if (currentTime - previousTime < ONE_MINUTE) {
      return;
    }
  }
  previousTime=currentTime;
  generateReports(outputDirectory);
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * Generate the final report.json from the completed test and completed configuration temporary files.
 * @param outputDirectory - output directory
 * @param bForceWrite - setting true will forcibly generate the report.json
 */
public synchronized void writeJSON(String outputDirectory,boolean bForceWrite){
  logger.entering(new Object[]{outputDirectory,bForceWrite});
  long currentTime=System.currentTimeMillis();
  if (!bForceWrite) {
    if (currentTime - previousTime < ONE_MINUTE) {
      return;
    }
  }
  previousTime=currentTime;
  parseCompletedTest();
  generateReports(outputDirectory);
  logger.exiting();
}
Program: 8434
Project: 8434
Buggy source:
/** 
 * Construct the JSON report for report generation
 * @return
 */
private JsonObject buildJSONReport(){
  logger.entering();
  Gson gson=new GsonBuilder().setPrettyPrinting().create();
  JsonArray testObjects=loadJSONArray(jsonCompletedTest);
  for (  TestMethodInfo temp : runningTest) {
    testObjects.add(gson.fromJson(temp.toJson(),JsonElement.class));
  }
  JsonArray configObjects=loadJSONArray(jsonCompletedConfig);
  for (  ConfigMethodInfo temp : runningConfig) {
    configObjects.add(gson.fromJson(temp.toJson(),JsonElement.class));
  }
  JsonObject summary=new JsonObject();
  summary.add("String_Node_Str",getReportSummaryCounts(testObjects));
  summary.add("String_Node_Str",getReportSummaryCounts(configObjects));
  JsonElement reportMetadata=gson.fromJson(ReporterConfigMetadata.toJsonAsString(),JsonElement.class);
  JsonObject reporter=new JsonObject();
  reporter.add("String_Node_Str",summary);
  reporter.add("String_Node_Str",testObjects);
  reporter.add("String_Node_Str",configObjects);
  reporter.add("String_Node_Str",generateConfigSummary());
  reporter.add("String_Node_Str",testJsonLocalConfigSummary);
  reporter.add("String_Node_Str",reportMetadata);
  logger.exiting(reporter);
  return reporter;
}

Fixed version (ground truth):
/** 
 * Construct the JSON report for report generation
 * @return
 */
private JsonObject buildJSONReport(){
  logger.entering();
  Gson gson=new GsonBuilder().setPrettyPrinting().create();
  JsonArray testObjects=loadJSONArray(jsonCompletedTest);
  for (  TestMethodInfo temp : completedTest) {
    testObjects.add(gson.fromJson(temp.toJson(),JsonElement.class));
  }
  for (  TestMethodInfo temp : runningTest) {
    testObjects.add(gson.fromJson(temp.toJson(),JsonElement.class));
  }
  JsonArray configObjects=loadJSONArray(jsonCompletedConfig);
  for (  ConfigMethodInfo temp : runningConfig) {
    configObjects.add(gson.fromJson(temp.toJson(),JsonElement.class));
  }
  JsonObject summary=new JsonObject();
  summary.add("String_Node_Str",getReportSummaryCounts(testObjects));
  summary.add("String_Node_Str",getReportSummaryCounts(configObjects));
  JsonElement reportMetadata=gson.fromJson(ReporterConfigMetadata.toJsonAsString(),JsonElement.class);
  JsonObject reporter=new JsonObject();
  reporter.add("String_Node_Str",summary);
  reporter.add("String_Node_Str",testObjects);
  reporter.add("String_Node_Str",configObjects);
  reporter.add("String_Node_Str",generateConfigSummary());
  reporter.add("String_Node_Str",testJsonLocalConfigSummary);
  reporter.add("String_Node_Str",reportMetadata);
  logger.exiting(reporter);
  return reporter;
}
Program: 8435
Project: 8435
Buggy source:
public JsonArray getCompletedConfigContent() throws JsonParseException {
  return loadJSONArray(jsonCompletedConfig);
}

Fixed version (ground truth):
/** 
 * Get list of configuration methods as a   {@link JsonArray}.
 * @return A {@link JsonArray}.
 */
public JsonArray getCompletedConfigContent(){
  return loadJSONArray(jsonCompletedConfig);
}
Program: 8436
Project: 8436
Buggy source:
/** 
 * This method generate the JSON string for the instance. GSON builder helps to build JSON string and it will exclude the static and transient variable during generation.
 * @return - JSON string
 */
public String toJson(){
  logger.entering();
  Gson gson=new GsonBuilder().setPrettyPrinting().excludeFieldsWithModifiers(Modifier.STATIC,Modifier.TRANSIENT).create();
  String json=gson.toJson(this);
  logger.exiting(json);
  return json;
}

Fixed version (ground truth):
/** 
 * This method generate the JSON string for the instance. GSON builder helps to build JSON string and it will exclude the static and transient variable during generation.
 * @return - JSON string
 */
public String toJson(){
  logger.entering();
  parseResults();
  Gson gson=new GsonBuilder().setPrettyPrinting().excludeFieldsWithModifiers(Modifier.STATIC,Modifier.TRANSIENT).create();
  String json=gson.toJson(this);
  logger.exiting(json);
  return json;
}
Program: 8437
Project: 8437
Buggy source:
public ITestResult getResult(){
  return result;
}

Fixed version (ground truth):
/** 
 * Gets the current test result.
 * @return An {@link ITestResult}.
 */
public ITestResult getResult(){
  return result;
}
Program: 8438
Project: 8438
Buggy source:
public MethodInfo(String suite,String test,String packages,String classname,ITestResult result){
  this.suite=suite;
  this.test=test;
  this.packageInfo=packages;
  this.className=classname;
  this.result=result;
  this.methodName=result.getName();
  if (result.getStatus() == ITestResult.SUCCESS) {
    this.status="String_Node_Str";
  }
 else   if (result.getStatus() == ITestResult.FAILURE) {
    this.status="String_Node_Str";
  }
 else   if (result.getStatus() == ITestResult.SKIP) {
    this.status="String_Node_Str";
  }
 else   if (result.getStatus() == ITestResult.STARTED) {
    this.status="String_Node_Str";
  }
  Calendar c=Calendar.getInstance();
  c.setTimeInMillis(result.getStartMillis());
  this.startTime=ReporterDateFormatter.getISO8601String(c.getTime());
  c.setTimeInMillis(result.getEndMillis());
  this.endTime=ReporterDateFormatter.getISO8601String(c.getTime());
  if (result.getMethod().getDescription() != null) {
    this.description=result.getMethod().getDescription();
  }
  if (result.getThrowable() != null) {
    this.exception=result.getThrowable().getClass().toString() + "String_Node_Str" + result.getThrowable().getLocalizedMessage();
    this.stacktrace=getStackTraceInfo(result.getThrowable());
  }
  loadMethodInfo(result);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param suite name of the suite
 * @param test name of the test
 * @param packages name of the package without class name
 * @param classname name of the class without package name
 * @param result ITestResult of the method which need to be reported
 */
public MethodInfo(String suite,String test,String packages,String classname,ITestResult result){
  this.suite=suite;
  this.test=test;
  this.packageInfo=packages;
  this.className=classname;
  this.result=result;
  this.methodName=result.getName();
}
Program: 8439
Project: 8439
Buggy source:
/** 
 * A method that helps in closing off the current session.
 */
public final void closeSession(){
  logger.entering();
  new SauceLabsHelper().embedSauceLabsJobUrlToTestReport();
  if (Grid.driver() != null) {
    Grid.driver().quit();
    Grid.getThreadLocalWebDriver().set(null);
    Grid.getThreadLocalTestSession().set(null);
  }
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * A method that helps in closing off the current session.
 */
public final void closeSession(){
  logger.entering();
  if ((isStarted()) && (Grid.driver() != null)) {
    new SauceLabsHelper().embedSauceLabsJobUrlToTestReport();
    Grid.driver().quit();
  }
  Grid.getThreadLocalWebDriver().set(null);
  Grid.getThreadLocalTestSession().set(null);
  this.isStarted=false;
  logger.exiting();
}
Program: 8440
Project: 8440
Buggy source:
@Test(groups="String_Node_Str",expectedExceptions={RuntimeException.class}) @WebTest(browser="String_Node_Str") public void testWrongBrowser(){
  fail("String_Node_Str");
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",expectedExceptions={IllegalArgumentException.class}) @WebTest(browser="String_Node_Str") public void testWrongBrowser(){
  Grid.driver().executeScript("String_Node_Str","String_Node_Str");
  fail("String_Node_Str");
}
Program: 8441
Project: 8441
Buggy source:
/** 
 * this method is used to download a file from the specified url
 * @param artifactUrl - url of the file to be downloaded.
 * @param checksum - checksum to downloaded file.
 * @return the downloaded file path.
 */
public static String downloadFile(String artifactUrl,String checksum){
  LOGGER.entering(new Object[]{artifactUrl,checksum});
  Preconditions.checkArgument(artifactUrl != null && !artifactUrl.isEmpty(),"String_Node_Str");
  Preconditions.checkArgument(checksum != null && !checksum.isEmpty(),"String_Node_Str");
  isValidFileType(artifactUrl);
  String algorithm=null;
  if (isValidSHA1(checksum)) {
    algorithm="String_Node_Str";
  }
 else   if (isValidMD5(checksum)) {
    algorithm="String_Node_Str";
  }
  String result=downloadFile(artifactUrl,checksum,algorithm);
  LOGGER.exiting(result);
  return result;
}

Fixed version (ground truth):
/** 
 * this method is used to download a file from the specified url
 * @param artifactUrl - url of the file to be downloaded.
 * @param checksum - checksum to downloaded file.
 * @return the downloaded file path.
 */
static String downloadFile(String artifactUrl,String checksum){
  LOGGER.entering(new Object[]{artifactUrl,checksum});
  Preconditions.checkArgument(artifactUrl != null && !artifactUrl.isEmpty(),"String_Node_Str");
  Preconditions.checkArgument(checksum != null && !checksum.isEmpty(),"String_Node_Str");
  isValidFileType(artifactUrl);
  String algorithm=null;
  if (isValidSHA1(checksum)) {
    algorithm="String_Node_Str";
  }
 else   if (isValidMD5(checksum)) {
    algorithm="String_Node_Str";
  }
  String result=downloadFile(artifactUrl,checksum,algorithm);
  LOGGER.exiting(result);
  return result;
}
Program: 8442
Project: 8442
Buggy source:
private static boolean checkLocalFile(String filename,String checksum,String algorithm){
  InputStream is=null;
  MessageDigest md=null;
  StringBuffer sb=new StringBuffer("String_Node_Str");
  try {
    md=MessageDigest.getInstance(algorithm);
  }
 catch (  NoSuchAlgorithmException e1) {
  }
  try {
    int bytesRead;
    is=new FileInputStream(filename);
    byte[] buf=new byte[1024];
    while ((bytesRead=is.read(buf)) != -1) {
      md.update(buf,0,bytesRead);
    }
    byte[] mdbytes=md.digest();
    for (int i=0; i < mdbytes.length; i++) {
      sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100,16).substring(1));
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.SEVERE,e.getMessage(),e);
  }
 finally {
    try {
      if (is != null) {
        is.close();
      }
    }
 catch (    Exception e) {
      LOGGER.log(Level.SEVERE,e.getMessage(),e);
    }
  }
  if (checksum.equals(sb.toString())) {
    LOGGER.info("String_Node_Str" + filename);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private static boolean checkLocalFile(String filename,String checksum,String algorithm){
  InputStream is=null;
  MessageDigest md=null;
  StringBuffer sb=new StringBuffer("String_Node_Str");
  try {
    md=MessageDigest.getInstance(algorithm);
  }
 catch (  NoSuchAlgorithmException e1) {
  }
  try {
    int bytesRead;
    is=new FileInputStream(filename);
    byte[] buf=new byte[1024];
    while ((bytesRead=is.read(buf)) != -1) {
      md.update(buf,0,bytesRead);
    }
    byte[] mdbytes=md.digest();
    for (int i=0; i < mdbytes.length; i++) {
      sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100,16).substring(1));
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.SEVERE,e.getMessage(),e);
  }
 finally {
    try {
      if (is != null) {
        is.close();
      }
    }
 catch (    Exception e) {
      LOGGER.log(Level.SEVERE,e.getMessage(),e);
    }
  }
  if (checksum.equals(sb.toString())) {
    LOGGER.fine("String_Node_Str" + filename);
    return true;
  }
  return false;
}
Program: 8444
Project: 8444
Buggy source:
/** 
 * This method is used to cleanup all the files already downloaded
 */
public static void cleanup(){
  LOGGER.entering();
  for (  String temp : files) {
    new File(temp).delete();
  }
  files.clear();
  LOGGER.exiting();
}

Fixed version (ground truth):
/** 
 * This method is used to cleanup all the files already downloaded
 */
static void cleanup(){
  LOGGER.entering();
  for (  String temp : files) {
    new File(temp).delete();
  }
  files.clear();
  LOGGER.exiting();
}
Program: 8445
Project: 8445
Buggy source:
private static String getFileNameFromPath(String name){
  String[] path=name.split("String_Node_Str");
  String s=path[path.length - 1];
  return s;
}

Fixed version (ground truth):
static String getFileNameFromPath(String name){
  String[] path=name.split("String_Node_Str");
  String s=path[path.length - 1];
  return s;
}
Program: 8447
Project: 8447
Buggy source:
private FileExtractor(){
}

Fixed version (ground truth):
FileExtractor(){
}
Program: 8448
Project: 8448
Buggy source:
/** 
 * Set the classpath for the child process. Adds all jars from CWD and SELION_HOME_DIR. Does not recurse into sub directories. Filters out duplicates.
 * @param the cmdLine we are building
 * @return the changed {@link CommandLine}
 */
private CommandLine addClassPathToCommanLine(CommandLine cmdLine){
  Set<String> uniqueClassPathEntries=new LinkedHashSet<String>();
  Collection<File> homeFiles=FileUtils.listFiles(new File(SELION_HOME_DIR),new String[]{"String_Node_Str"},false);
  for (  File file : homeFiles) {
    uniqueClassPathEntries.add(file.getAbsolutePath());
  }
  Collection<File> localFiles=FileUtils.listFiles(new File(System.getProperty("String_Node_Str")),new String[]{"String_Node_Str"},false);
  for (  File file : localFiles) {
    uniqueClassPathEntries.add(file.getName());
  }
  String classpath=System.getProperty("String_Node_Str");
  uniqueClassPathEntries.addAll(Arrays.asList(classpath.split("String_Node_Str")));
  StringBuffer buf=new StringBuffer();
  for (  String s : uniqueClassPathEntries) {
    buf.append(s + File.pathSeparatorChar);
  }
  buf.deleteCharAt(buf.length() - 1);
  cmdLine.addArgument("String_Node_Str");
  cmdLine.addArgument(buf.toString());
  cmdLine.addArgument(SeLionGridLauncher.class.getName());
  return cmdLine;
}

Fixed version (ground truth):
/** 
 * Set the classpath for the child process. Adds all jars from CWD and SELION_HOME_DIR. Does not recurse into sub directories. Filters out duplicates.
 * @param the cmdLine we are building
 * @return the changed {@link CommandLine}
 */
private CommandLine addClassPathToCommanLine(CommandLine cmdLine){
  Set<String> uniqueClassPathEntries=new LinkedHashSet<String>();
  Collection<File> homeFiles=FileUtils.listFiles(new File(SELION_HOME_DIR),new String[]{"String_Node_Str"},false);
  for (  File file : homeFiles) {
    uniqueClassPathEntries.add(file.getAbsolutePath());
  }
  Collection<File> localFiles=FileUtils.listFiles(new File(System.getProperty("String_Node_Str")),new String[]{"String_Node_Str"},false);
  for (  File file : localFiles) {
    uniqueClassPathEntries.add(file.getName());
  }
  String classpath=System.getProperty("String_Node_Str");
  uniqueClassPathEntries.addAll(Arrays.asList(classpath.split(SystemUtils.PATH_SEPARATOR)));
  StringBuffer buf=new StringBuffer();
  for (  String s : uniqueClassPathEntries) {
    buf.append(s + File.pathSeparatorChar);
  }
  buf.deleteCharAt(buf.length() - 1);
  cmdLine.addArgument("String_Node_Str");
  cmdLine.addArgument(buf.toString());
  cmdLine.addArgument(SeLionGridLauncher.class.getName());
  return cmdLine;
}
Program: 8449
Project: 8449
Buggy source:
public static void main(String[] args) throws IOException, InterruptedException {
  List<String> commands=Arrays.asList(args);
  JarSpawner spawner=new JarSpawner();
  spawner.initialSetup();
  if (commands.contains(SELION_CONFIG_ARG)) {
    ConfigParser.setConfigFile(commands.get(commands.indexOf(SELION_CONFIG_ARG) + 1));
  }
  long interval=ConfigParser.getInstance().getLong("String_Node_Str",60000L);
  LOGGER.info("String_Node_Str" + interval + "String_Node_Str");
  while (true) {
    FileDownloader.checkForDownloads();
    if (commands.contains(HELP_ARG) || commands.contains("String_Node_Str")) {
      spawner.continuouslyRestart(commands,100,true);
      spawner.printUsageInfo();
      return;
    }
    spawner.continuouslyRestart(commands,interval,false);
    LOGGER.info("String_Node_Str");
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, InterruptedException {
  List<String> commands=Arrays.asList(args);
  JarSpawner spawner=new JarSpawner();
  spawner.initialSetup();
  if (commands.contains(SELION_CONFIG_ARG)) {
    ConfigParser.setConfigFile(commands.get(commands.indexOf(SELION_CONFIG_ARG) + 1));
  }
  long interval=ConfigParser.parse().getLong("String_Node_Str",60000L);
  LOGGER.info("String_Node_Str" + interval + "String_Node_Str");
  while (true) {
    FileDownloader.checkForDownloads();
    if (commands.contains(HELP_ARG) || commands.contains("String_Node_Str")) {
      spawner.continuouslyRestart(commands,100,true);
      spawner.printUsageInfo();
      return;
    }
    spawner.continuouslyRestart(commands,interval,false);
    LOGGER.info("String_Node_Str");
  }
}
Program: 8450
Project: 8450
Buggy source:
public DefaultManagedArtifact(String pathName){
  this.filePath=pathName;
  artifactFile=new File(this.filePath);
  timeToLiveInMillis=ConfigParser.getInstance().getLong(EXPIRY_CONFIG_PROPERTY);
  if (LOGGER.isLoggable(Level.FINE)) {
    LOGGER.log(Level.FINE,"String_Node_Str" + timeToLiveInMillis + "String_Node_Str");
  }
}

Fixed version (ground truth):
public DefaultManagedArtifact(String pathName){
  this.filePath=pathName;
  artifactFile=new File(this.filePath);
  timeToLiveInMillis=ConfigParser.parse().getLong(EXPIRY_CONFIG_PROPERTY);
  if (LOGGER.isLoggable(Level.FINE)) {
    LOGGER.log(Level.FINE,"String_Node_Str" + timeToLiveInMillis + "String_Node_Str");
  }
}
Program: 8451
Project: 8451
Buggy source:
private Criteria formCriteria(){
  if (requestedCriteria == null) {
    EnumMap<RequestHeaders,String> parametersMap=getParametersMap();
    try {
      String criteriaClassName=ConfigParser.getInstance().getString(CRITERIA_CONFIG_PROPERTY);
      if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.log(Level.FINE,"String_Node_Str" + criteriaClassName);
      }
      @SuppressWarnings("String_Node_Str") Class<? extends Criteria> criteriaClass=(Class<? extends Criteria>)this.getClass().getClassLoader().loadClass(criteriaClassName);
      requestedCriteria=criteriaClass.getConstructor(new Class[]{EnumMap.class}).newInstance(new Object[]{parametersMap});
    }
 catch (    InvocationTargetException exe) {
      throw new ArtifactDownloadException(exe.getCause().getMessage(),exe);
    }
catch (    Exception exe) {
      throw new ArtifactDownloadException(exe.getClass().getSimpleName() + "String_Node_Str" + ConfigParser.getInstance().getString(CRITERIA_CONFIG_PROPERTY),exe);
    }
  }
  return requestedCriteria;
}

Fixed version (ground truth):
private Criteria formCriteria(){
  if (requestedCriteria == null) {
    EnumMap<RequestHeaders,String> parametersMap=getParametersMap();
    try {
      String criteriaClassName=ConfigParser.parse().getString(CRITERIA_CONFIG_PROPERTY);
      if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.log(Level.FINE,"String_Node_Str" + criteriaClassName);
      }
      @SuppressWarnings("String_Node_Str") Class<? extends Criteria> criteriaClass=(Class<? extends Criteria>)this.getClass().getClassLoader().loadClass(criteriaClassName);
      requestedCriteria=criteriaClass.getConstructor(new Class[]{EnumMap.class}).newInstance(new Object[]{parametersMap});
    }
 catch (    InvocationTargetException exe) {
      throw new ArtifactDownloadException(exe.getCause().getMessage(),exe);
    }
catch (    Exception exe) {
      throw new ArtifactDownloadException(exe.getClass().getSimpleName() + "String_Node_Str" + ConfigParser.parse().getString(CRITERIA_CONFIG_PROPERTY),exe);
    }
  }
  return requestedCriteria;
}
Program: 8452
Project: 8452
Buggy source:
@SuppressWarnings("String_Node_Str") private ManagedArtifact getManagedArtifact(String pathName){
  ManagedArtifact managedArtifact=null;
  try {
    String managedArtifactClassName=ConfigParser.getInstance().getString(ARTIFACT_CONFIG_PROPERTY);
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.log(Level.FINE,"String_Node_Str" + managedArtifactClassName);
    }
    Class<? extends ManagedArtifact> managedArtifactClass=(Class<? extends ManagedArtifact>)this.getClass().getClassLoader().loadClass(managedArtifactClassName);
    managedArtifact=managedArtifactClass.getConstructor(new Class[]{String.class}).newInstance(new Object[]{pathName});
    return managedArtifact;
  }
 catch (  InvocationTargetException exe) {
    throw new ArtifactUploadException(exe.getCause().getMessage(),exe);
  }
catch (  Exception exe) {
    throw new ArtifactUploadException(exe.getClass().getSimpleName() + "String_Node_Str" + ConfigParser.getInstance().getString(ARTIFACT_CONFIG_PROPERTY),exe);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private ManagedArtifact getManagedArtifact(String pathName){
  ManagedArtifact managedArtifact=null;
  try {
    String managedArtifactClassName=ConfigParser.parse().getString(ARTIFACT_CONFIG_PROPERTY);
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.log(Level.FINE,"String_Node_Str" + managedArtifactClassName);
    }
    Class<? extends ManagedArtifact> managedArtifactClass=(Class<? extends ManagedArtifact>)this.getClass().getClassLoader().loadClass(managedArtifactClassName);
    managedArtifact=managedArtifactClass.getConstructor(new Class[]{String.class}).newInstance(new Object[]{pathName});
    return managedArtifact;
  }
 catch (  InvocationTargetException exe) {
    throw new ArtifactUploadException(exe.getCause().getMessage(),exe);
  }
catch (  Exception exe) {
    throw new ArtifactUploadException(exe.getClass().getSimpleName() + "String_Node_Str" + ConfigParser.parse().getString(ARTIFACT_CONFIG_PROPERTY),exe);
  }
}
Program: 8453
Project: 8453
Buggy source:
protected AbstractUploadRequestProcessor(TransferContext transferContext){
  super();
  MAX_FILE_SIZE=ConfigParser.getInstance().getInt(MAX_FILE_CONFIG_PROPERTY);
  this.transferContext=transferContext;
  this.httpServletRequest=transferContext.getHttpServletRequest();
  repository=ManagedArtifactRepository.getInstance();
  managedArtifactList=new ArrayList<>();
}

Fixed version (ground truth):
protected AbstractUploadRequestProcessor(TransferContext transferContext){
  super();
  MAX_FILE_SIZE=ConfigParser.parse().getInt(MAX_FILE_CONFIG_PROPERTY);
  this.transferContext=transferContext;
  this.httpServletRequest=transferContext.getHttpServletRequest();
  repository=ManagedArtifactRepository.getInstance();
  managedArtifactList=new ArrayList<>();
}
Program: 8454
Project: 8454
Buggy source:
/** 
 * Verify if the element is availible based on a certain action
 * @param elementName
 * @param action
 */
private void verifyElementByAction(String elementName,String action){
  AbstractElement element=getAbstractElementThroughReflection(elementName);
switch (action) {
case "String_Node_Str":
    if (!element.isElementPresent()) {
      throw new PageValidationException(getClass().getSimpleName() + "String_Node_Str" + elementName+ "String_Node_Str");
    }
  break;
case "String_Node_Str":
if (!element.isElementPresent() && !element.isVisible()) {
  throw new PageValidationException(getClass().getSimpleName() + "String_Node_Str" + elementName+ "String_Node_Str");
}
break;
case "String_Node_Str":
if (!element.isElementPresent() && !element.isEnabled()) {
throw new PageValidationException(getClass().getSimpleName() + "String_Node_Str" + elementName+ "String_Node_Str");
}
break;
default :
if (!HtmlElementUtils.isElementPresent(element.getLocator())) {
throw new PageValidationException(getClass().getSimpleName() + "String_Node_Str" + elementName+ "String_Node_Str");
}
break;
}
}

Fixed version (ground truth):
/** 
 * Verify if the element is availible based on a certain action
 * @param elementName
 * @param action
 */
private void verifyElementByAction(String elementName,String action){
  AbstractElement element=getAbstractElementThroughReflection(elementName);
  boolean present=element.isElementPresent();
switch (action) {
case "String_Node_Str":
    if (!present) {
      throw new PageValidationException(getClass().getSimpleName() + "String_Node_Str" + elementName+ "String_Node_Str");
    }
  break;
case "String_Node_Str":
if (!present || (present && !element.isVisible())) {
  throw new PageValidationException(getClass().getSimpleName() + "String_Node_Str" + elementName+ "String_Node_Str");
}
break;
case "String_Node_Str":
if (!present || (present && !element.isEnabled())) {
throw new PageValidationException(getClass().getSimpleName() + "String_Node_Str" + elementName+ "String_Node_Str");
}
break;
default :
if (!present) {
throw new PageValidationException(getClass().getSimpleName() + "String_Node_Str" + elementName+ "String_Node_Str");
}
break;
}
}