nus-yam/ex-repair huggingface dataset:
Program: 11977
Project: 11977
Buggy source:
/** 
 * Checks the number of results after a query execution
 * @param resultNumber: number of rows obtained after a query execution
 * @throws Exception
 */
@Given("String_Node_Str") public void resultsMustBe(String resultNumber) throws Exception {
  if (this.results != null) {
    List<Row> rows=this.results.all();
    assertThat(Integer.parseInt(resultNumber)).isEqualTo(rows.size()).overridingErrorMessage("String_Node_Str" + resultNumber + "String_Node_Str"+ "String_Node_Str"+ rows.size());
  }
 else {
    throw new Exception("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Checks the number of results after a query execution
 * @param resultNumber: number of rows obtained after a query execution
 * @throws Exception
 */
@Given("String_Node_Str") public void resultsMustBe(String resultNumber) throws Exception {
  if (commonspec.getResults() != null) {
    List<Row> rows=commonspec.getResults().all();
    assertThat(Integer.parseInt(resultNumber)).isEqualTo(rows.size()).overridingErrorMessage("String_Node_Str" + resultNumber + "String_Node_Str"+ "String_Node_Str"+ rows.size());
  }
 else {
    throw new Exception("String_Node_Str");
  }
}
Program: 11978
Project: 11978
Buggy source:
/** 
 * Execute a query with scheme over a cluster
 * @param scheme: the file of configuration (.conf) with the options of mappin
 * @param type: type of the changes in scheme (string or json)
 * @param table: table for create the index
 * @param magic_column: magic column where index will be saved
 * @param keyspace: keyspace used
 * @param modifications: query fields on scheme
 * @throws Exception
 */
@Given("String_Node_Str") public void sendQueryOfType(String scheme,String type,String magic_column,String table,String keyspace,DataTable modifications) throws Exception {
  commonspec.getCassandraClient().useKeyspace(keyspace);
  commonspec.getLogger().info("String_Node_Str","String_Node_Str");
  String retrievedData=commonspec.retrieveData(scheme,type);
  String modifiedData=commonspec.modifyData(retrievedData,type,modifications).toString();
  String query="String_Node_Str" + table + "String_Node_Str"+ magic_column+ "String_Node_Str"+ modifiedData+ "String_Node_Str";
  System.out.println("String_Node_Str" + query);
  this.results=commonspec.getCassandraClient().executeQuery(query);
}

Fixed version (ground truth):
/** 
 * Execute a query with scheme over a cluster
 * @param scheme: the file of configuration (.conf) with the options of mappin
 * @param type: type of the changes in scheme (string or json)
 * @param table: table for create the index
 * @param magic_column: magic column where index will be saved
 * @param keyspace: keyspace used
 * @param modifications: query fields on scheme
 * @throws Exception
 */
@Given("String_Node_Str") public void sendQueryOfType(String scheme,String type,String magic_column,String table,String keyspace,DataTable modifications) throws Exception {
  commonspec.getCassandraClient().useKeyspace(keyspace);
  commonspec.getLogger().info("String_Node_Str","String_Node_Str");
  String retrievedData=commonspec.retrieveData(scheme,type);
  String modifiedData=commonspec.modifyData(retrievedData,type,modifications).toString();
  String query="String_Node_Str" + table + "String_Node_Str"+ magic_column+ "String_Node_Str"+ modifiedData+ "String_Node_Str";
  System.out.println("String_Node_Str" + query);
  commonspec.setResults(commonspec.getCassandraClient().executeQuery(query));
}
Program: 11979
Project: 11979
Buggy source:
/** 
 * Generic constructor.
 * @param spec
 */
public GivenGSpec(CommonG spec){
  this.commonspec=spec;
  this.results=null;
}

Fixed version (ground truth):
/** 
 * Generic constructor.
 * @param spec
 */
public GivenGSpec(CommonG spec){
  this.commonspec=spec;
}
Program: 11980
Project: 11980
Buggy source:
/** 
 * Drop a keyspace in Cassandra.
 * @param ifExists
 * @param keyspace
 */
public void dropKeyspace(boolean ifExists,String keyspace){
  executeQuery(this.queryUtils.dropKeyspaceQuery(ifExists,keyspace));
}

Fixed version (ground truth):
/** 
 * Drop a keyspace in Cassandra.
 * @param ifExists
 * @param keyspace
 */
public void dropKeyspace(boolean ifExists,String keyspace){
  executeQuery(this.CassandraqueryUtils.dropKeyspaceQuery(ifExists,keyspace));
}
Program: 11981
Project: 11981
Buggy source:
/** 
 * Create a keyspace in Cassandra.
 * @param keyspace
 */
public void createKeyspace(String keyspace){
  Map<String,String> replicationSimpleOneExtra=new Hashtable<String,String>();
  replicationSimpleOneExtra.put("String_Node_Str","String_Node_Str");
  replicationSimpleOneExtra.put("String_Node_Str","String_Node_Str");
  String query=this.queryUtils.createKeyspaceQuery(true,keyspace,queryUtils.createKeyspaceReplication(replicationSimpleOneExtra),"String_Node_Str");
  LOGGER.debug(query);
  executeQuery(query);
}

Fixed version (ground truth):
/** 
 * Create a keyspace in Cassandra.
 * @param keyspace
 */
public void createKeyspace(String keyspace){
  Map<String,String> replicationSimpleOneExtra=new HashMap<>();
  replicationSimpleOneExtra.put("String_Node_Str","String_Node_Str");
  replicationSimpleOneExtra.put("String_Node_Str","String_Node_Str");
  String query=this.CassandraqueryUtils.createKeyspaceQuery(true,keyspace,this.CassandraqueryUtils.createKeyspaceReplication(replicationSimpleOneExtra),"String_Node_Str");
  LOGGER.debug(query);
  executeQuery(query);
}
Program: 11982
Project: 11982
Buggy source:
/** 
 * Use a keyspace in Cassandra.
 * @param keyspace
 */
public void useKeyspace(String keyspace){
  executeQuery(this.queryUtils.useQuery(keyspace));
}

Fixed version (ground truth):
/** 
 * Use a keyspace in Cassandra.
 * @param keyspace
 */
public void useKeyspace(String keyspace){
  executeQuery(this.CassandraqueryUtils.useQuery(keyspace));
}
Program: 11983
Project: 11983
Buggy source:
/** 
 * Connect to Cassandra host.
 */
public void connect(){
  buildCluster();
  this.queryUtils=new QueryUtils();
  this.metadata=this.cluster.getMetadata();
  LOGGER.debug("String_Node_Str" + host + "String_Node_Str"+ metadata.getClusterName()+ "String_Node_Str");
  this.session=this.cluster.connect();
}

Fixed version (ground truth):
/** 
 * Connect to Cassandra host.
 */
public void connect(){
  buildCluster();
  this.CassandraqueryUtils=new CassandraQueryUtils();
  this.metadata=this.cluster.getMetadata();
  LOGGER.debug("String_Node_Str" + host + "String_Node_Str"+ metadata.getClusterName()+ "String_Node_Str");
  this.session=this.cluster.connect();
}
Program: 11984
Project: 11984
Buggy source:
/** 
 * Drop a table of a keyspace.
 * @param keyspace
 * @param table
 */
public void dropTable(String keyspace,String table){
  executeQuery(this.queryUtils.dropTableQuery(false,table));
}

Fixed version (ground truth):
/** 
 * Drop a table of a keyspace.
 * @param keyspace
 * @param table
 */
public void dropTable(String keyspace,String table){
  executeQuery(this.CassandraqueryUtils.dropTableQuery(false,table));
}
Program: 11985
Project: 11985
Buggy source:
public static SeleniumAssert assertThat(WebDriver actual){
  return new SeleniumAssert(actual);
}

Fixed version (ground truth):
/** 
 * Check if two WebDrivers are equals.
 * @param actual
 * @return
 */
public static SeleniumAssert assertThat(WebDriver actual){
  return new SeleniumAssert(actual);
}
Program: 11986
Project: 11986
Buggy source:
public HttpResponseAssert hasStatusCode(Integer status){
  if (actual.getStatusCode() != status) {
    failWithMessage("String_Node_Str",status,actual.getStatusCode());
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Checks if a HttpResponse has an specific status.
 * @param status
 * @return HttpResponseAssert
 */
public HttpResponseAssert hasStatusCode(Integer status){
  if (actual.getStatusCode() != status) {
    failWithMessage("String_Node_Str",status,actual.getStatusCode());
  }
  return this;
}
Program: 11987
Project: 11987
Buggy source:
public HttpResponseAssert hasMessage(String message){
  if (!actual.getResponse().contains(message)) {
    failWithMessage("String_Node_Str",message,actual.getResponse());
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Checks if a HttpResponse has a specific message.
 * @param message
 * @return HttpResponseAssert
 */
public HttpResponseAssert hasMessage(String message){
  if (!actual.getResponse().contains(message)) {
    failWithMessage("String_Node_Str",message,actual.getResponse());
  }
  return this;
}
Program: 11988
Project: 11988
Buggy source:
public HttpResponseAssert hasStatusCodeAndMessage(Integer status,String message){
  String msg="String_Node_Str";
  if (actual.getStatusCode() != status) {
    msg+=String.format("String_Node_Str",status,actual.getStatusCode());
  }
  if (!actual.getResponse().contains(message)) {
    String nl="String_Node_Str";
    if (!"String_Node_Str".equals(msg)) {
      nl=String.format("String_Node_Str",System.lineSeparator(),"String_Node_Str");
    }
    msg+=String.format("String_Node_Str",nl,message,actual.getResponse());
  }
  if (!"String_Node_Str".equals(msg)) {
    failWithMessage(msg);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Checks if a HttpResponse has a specific message and has a specific status.
 * @param status
 * @param message
 * @return HttpResponseAssert
 */
public HttpResponseAssert hasStatusCodeAndMessage(Integer status,String message){
  String msg="String_Node_Str";
  if (actual.getStatusCode() != status) {
    msg+=String.format("String_Node_Str",status,actual.getStatusCode());
  }
  if (!actual.getResponse().contains(message)) {
    String nl="String_Node_Str";
    if (!"String_Node_Str".equals(msg)) {
      nl=String.format("String_Node_Str",System.lineSeparator(),"String_Node_Str");
    }
    msg+=String.format("String_Node_Str",nl,message,actual.getResponse());
  }
  if (!"String_Node_Str".equals(msg)) {
    failWithMessage(msg);
  }
  return this;
}
Program: 11989
Project: 11989
Buggy source:
public HttpResponseAssert doesNotHaveMessage(String message){
  if (actual.getResponse().contains(message)) {
    failWithMessage("String_Node_Str",message,actual.getResponse());
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Checks if a HttpResponse has not a specific message.
 * @param message
 * @return HttpResponseAssert
 */
public HttpResponseAssert doesNotHaveMessage(String message){
  if (actual.getResponse().contains(message)) {
    failWithMessage("String_Node_Str",message,actual.getResponse());
  }
  return this;
}
Program: 11990
Project: 11990
Buggy source:
public static HttpResponseAssert assertThat(HttpResponse actual){
  return new HttpResponseAssert(actual);
}

Fixed version (ground truth):
/** 
 * Checks the actual "http" response.
 * @param actual
 * @return HttpResponseAssert
 */
public static HttpResponseAssert assertThat(HttpResponse actual){
  return new HttpResponseAssert(actual);
}
Program: 11991
Project: 11991
Buggy source:
public HttpResponseAssert doesNotHaveStatusCode(Integer status){
  if (actual.getStatusCode() == status) {
    failWithMessage("String_Node_Str",status,actual.getStatusCode());
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Checks if a HttpResponse has not an specific status.
 * @param status
 * @return
 */
public HttpResponseAssert doesNotHaveStatusCode(Integer status){
  if (actual.getStatusCode() == status) {
    failWithMessage("String_Node_Str",status,actual.getStatusCode());
  }
  return this;
}
Program: 11992
Project: 11992
Buggy source:
public HttpResponseAssert doesNotHaveStatusCodeNorMessage(Integer status,String message){
  String msg="String_Node_Str";
  if (actual.getStatusCode() == status) {
    msg+=String.format("String_Node_Str",status,actual.getStatusCode());
  }
  if (actual.getResponse().contains(message)) {
    String nl="String_Node_Str";
    if (!"String_Node_Str".equals(msg)) {
      nl=String.format("String_Node_Str",System.lineSeparator(),"String_Node_Str");
    }
    msg+=String.format("String_Node_Str",nl,message,actual.getResponse());
  }
  if (!"String_Node_Str".equals(msg)) {
    failWithMessage(msg);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Checks if a HttpResponse has not a specific message and has not a specific status.
 * @param status
 * @param message
 * @return HttpResponseAssert
 */
public HttpResponseAssert doesNotHaveStatusCodeNorMessage(Integer status,String message){
  String msg="String_Node_Str";
  if (actual.getStatusCode() == status) {
    msg+=String.format("String_Node_Str",status,actual.getStatusCode());
  }
  if (actual.getResponse().contains(message)) {
    String nl="String_Node_Str";
    if (!"String_Node_Str".equals(msg)) {
      nl=String.format("String_Node_Str",System.lineSeparator(),"String_Node_Str");
    }
    msg+=String.format("String_Node_Str",nl,message,actual.getResponse());
  }
  if (!"String_Node_Str".equals(msg)) {
    failWithMessage(msg);
  }
  return this;
}
Program: 11993
Project: 11993
Buggy source:
public HttpResponseAssert(HttpResponse actual){
  super(actual,HttpResponseAssert.class);
}

Fixed version (ground truth):
/** 
 * Generic constructor.
 * @param actual
 */
public HttpResponseAssert(HttpResponse actual){
  super(actual,HttpResponseAssert.class);
}
Program: 11994
Project: 11994
Buggy source:
public SeleniumAssert contains(CharSequence... values){
  if (actual instanceof WebDriver) {
    Strings.instance().assertContains(info,((WebDriver)actual).getPageSource(),values);
  }
 else   if (actual instanceof WebElement) {
    Strings.instance().assertContains(info,((WebElement)actual).getText(),values);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Checks if a webDriver or WebElement has values.
 * @param values
 * @return
 */
public SeleniumAssert contains(CharSequence... values){
  if (actual instanceof WebDriver) {
    Strings.instance().assertContains(info,((WebDriver)actual).getPageSource(),values);
  }
 else   if (actual instanceof WebElement) {
    Strings.instance().assertContains(info,((WebElement)actual).getText(),values);
  }
  return this;
}
Program: 11995
Project: 11995
Buggy source:
public SeleniumAssert(WebDriver actual){
  super(actual,SeleniumAssert.class);
}

Fixed version (ground truth):
/** 
 * Constructor with WebDriver.
 * @param actual
 */
public SeleniumAssert(WebDriver actual){
  super(actual,SeleniumAssert.class);
}
Program: 11996
Project: 11996
Buggy source:
public static SeleniumAssert assertThat(WebDriver actual){
  return new SeleniumAssert(actual);
}

Fixed version (ground truth):
/** 
 * Checks a selenium WebDriver.
 * @param actual
 * @return
 */
public static SeleniumAssert assertThat(WebDriver actual){
  return new SeleniumAssert(actual);
}
Program: 11997
Project: 11997
Buggy source:
public static Extractor<WebElement,String> linkText(){
  return new SeleniumExtractor();
}

Fixed version (ground truth):
/** 
 * Get selenium extractor
 * @return
 */
public static Extractor<WebElement,String> linkText(){
  return new SeleniumExtractor();
}
Program: 11998
Project: 11998
Buggy source:
@Around(value="String_Node_Str") public void aroundLogAssertFailurePointcut(ProceedingJoinPoint pjp,String reason,Object actual,Matcher<?> matcher) throws Throwable {
  try {
    pjp.proceed();
  }
 catch (  AssertionError e) {
    logger.error("String_Node_Str",reason);
    if ((actual instanceof ArrayList) && (matcher.getClass().toString().endsWith("String_Node_Str"))) {
      List<?> actualList=(ArrayList<?>)actual;
      if (actualList.size() > 0) {
        Object el=actualList.get(actualList.size() - 1);
        if (el != null && (el instanceof Exception)) {
          logger.error("String_Node_Str",((Exception)el).getClass().getSimpleName(),((Exception)el).getMessage());
        }
      }
    }
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * @param pjp
 * @param reason
 * @param actual
 * @param matcher
 * @throws Throwable
 */
@Around(value="String_Node_Str") public void aroundLogAssertFailurePointcut(ProceedingJoinPoint pjp,String reason,Object actual,Matcher<?> matcher) throws Throwable {
  try {
    pjp.proceed();
  }
 catch (  AssertionError e) {
    logger.error("String_Node_Str",reason);
    if ((actual instanceof ArrayList) && (matcher.getClass().toString().endsWith("String_Node_Str"))) {
      List<?> actualList=(ArrayList<?>)actual;
      if (actualList.size() > 0) {
        Object el=actualList.get(actualList.size() - 1);
        if (el != null && (el instanceof Exception)) {
          logger.error("String_Node_Str",((Exception)el).getClass().getSimpleName(),((Exception)el).getMessage());
        }
      }
    }
    throw e;
  }
}
Program: 11999
Project: 11999
Buggy source:
@Around("String_Node_Str") public AssertionError aroundLogAssertJFailurePointcut(ProceedingJoinPoint pjp) throws Throwable {
  AssertionError ae=(AssertionError)pjp.proceed();
  logger.error("String_Node_Str",ae.getMessage());
  return ae;
}

Fixed version (ground truth):
/** 
 * @param pjp
 * @return
 * @throws Throwable
 */
@Around("String_Node_Str") public AssertionError aroundLogAssertJFailurePointcut(ProceedingJoinPoint pjp) throws Throwable {
  AssertionError ae=(AssertionError)pjp.proceed();
  logger.error("String_Node_Str",ae.getMessage());
  return ae;
}
Program: 12000
Project: 12000
Buggy source:
@Around(value="String_Node_Str") public void aroundAddIgnoreTagPointcut(ProceedingJoinPoint pjp,Formatter formatter,Reporter reporter,Runtime runtime) throws Throwable {
  logger.debug("String_Node_Str");
  CucumberScenario scen=(CucumberScenario)pjp.getThis();
  Scenario scenario=(Scenario)scen.getGherkinModel();
  Class<?> sc=scen.getClass();
  Method tt=sc.getSuperclass().getDeclaredMethod("String_Node_Str");
  tt.setAccessible(true);
  Set<Tag> tags=(Set<Tag>)tt.invoke(scen);
  Boolean ignore=false;
  for (  Tag tag : tags) {
    if ("String_Node_Str".equals(tag.getName())) {
      ignore=true;
    }
  }
  if (ignore) {
    runtime.buildBackendWorlds(reporter,tags,scenario.getName());
    formatter.startOfScenarioLifeCycle(scenario);
    formatter.endOfScenarioLifeCycle(scenario);
    runtime.disposeBackendWorlds();
  }
 else {
    pjp.proceed();
  }
}

Fixed version (ground truth):
/** 
 * @param pjp
 * @param formatter
 * @param reporter
 * @param runtime
 * @throws Throwable
 */
@Around(value="String_Node_Str") public void aroundAddIgnoreTagPointcut(ProceedingJoinPoint pjp,Formatter formatter,Reporter reporter,Runtime runtime) throws Throwable {
  logger.debug("String_Node_Str");
  CucumberScenario scen=(CucumberScenario)pjp.getThis();
  Scenario scenario=(Scenario)scen.getGherkinModel();
  Class<?> sc=scen.getClass();
  Method tt=sc.getSuperclass().getDeclaredMethod("String_Node_Str");
  tt.setAccessible(true);
  Set<Tag> tags=(Set<Tag>)tt.invoke(scen);
  Boolean ignore=false;
  for (  Tag tag : tags) {
    if ("String_Node_Str".equals(tag.getName())) {
      ignore=true;
    }
  }
  if (ignore) {
    runtime.buildBackendWorlds(reporter,tags,scenario.getName());
    formatter.startOfScenarioLifeCycle(scenario);
    formatter.endOfScenarioLifeCycle(scenario);
    runtime.disposeBackendWorlds();
  }
 else {
    pjp.proceed();
  }
}
Program: 12001
Project: 12001
Buggy source:
private File adjustLastCapture(Integer newTrailingImageHeight,List<File> capture) throws IOException {
  Integer finalHeight=0;
  Integer finalWidth=0;
  File trailingImage=capture.get(capture.size() - 1);
  capture.remove(capture.size() - 1);
  BufferedImage oldTrailingImage=ImageIO.read(trailingImage);
  BufferedImage newTrailingImage=new BufferedImage(oldTrailingImage.getWidth(),oldTrailingImage.getHeight() - newTrailingImageHeight,BufferedImage.TYPE_INT_RGB);
  newTrailingImage.createGraphics().drawImage(oldTrailingImage,0,0 - newTrailingImageHeight,null);
  File newTrailingImageF=File.createTempFile("String_Node_Str","String_Node_Str");
  newTrailingImageF.deleteOnExit();
  ImageIO.write(newTrailingImage,"String_Node_Str",newTrailingImageF);
  capture.add(newTrailingImageF);
  finalWidth=ImageIO.read(capture.get(0)).getWidth();
  for (  File cap : capture) {
    finalHeight+=ImageIO.read(cap).getHeight();
  }
  BufferedImage img=new BufferedImage(finalWidth,finalHeight,BufferedImage.TYPE_INT_RGB);
  Integer y=0;
  BufferedImage tmpImg=null;
  for (  File cap : capture) {
    tmpImg=ImageIO.read(cap);
    img.createGraphics().drawImage(tmpImg,0,y,null);
    y+=tmpImg.getHeight();
  }
  long ts=System.currentTimeMillis() / 1000L;
  File temp;
  temp=File.createTempFile("String_Node_Str" + String.valueOf(ts),"String_Node_Str");
  temp.deleteOnExit();
  ImageIO.write(img,"String_Node_Str",temp);
  return temp;
}

Fixed version (ground truth):
private File adjustLastCapture(Integer newTrailingImageHeight,List<File> capture) throws IOException {
  Integer finalHeight=0;
  Integer finalWidth=0;
  File trailingImage=capture.get(capture.size() - 1);
  capture.remove(capture.size() - 1);
  BufferedImage oldTrailingImage=ImageIO.read(trailingImage);
  BufferedImage newTrailingImage=new BufferedImage(oldTrailingImage.getWidth(),oldTrailingImage.getHeight() - newTrailingImageHeight,BufferedImage.TYPE_INT_RGB);
  newTrailingImage.createGraphics().drawImage(oldTrailingImage,0,0 - newTrailingImageHeight,null);
  File newTrailingImageF=File.createTempFile("String_Node_Str","String_Node_Str");
  newTrailingImageF.deleteOnExit();
  ImageIO.write(newTrailingImage,"String_Node_Str",newTrailingImageF);
  capture.add(newTrailingImageF);
  finalWidth=ImageIO.read(capture.get(0)).getWidth();
  for (  File cap : capture) {
    finalHeight+=ImageIO.read(cap).getHeight();
  }
  BufferedImage img=new BufferedImage(finalWidth,finalHeight,BufferedImage.TYPE_INT_RGB);
  Integer y=0;
  BufferedImage tmpImg=null;
  for (  File cap : capture) {
    tmpImg=ImageIO.read(cap);
    img.createGraphics().drawImage(tmpImg,0,y,null);
    y+=tmpImg.getHeight();
  }
  long ts=System.currentTimeMillis() / DEFAULT_CURRENT_TIME;
  File temp;
  temp=File.createTempFile("String_Node_Str" + Long.toString(ts),"String_Node_Str");
  temp.deleteOnExit();
  ImageIO.write(img,"String_Node_Str",temp);
  return temp;
}
Program: 12002
Project: 12002
Buggy source:
private File chromeFullScreenCapture(WebDriver driver) throws IOException, InterruptedException {
  driver.switchTo().defaultContent();
  ArrayList<File> capture=new ArrayList<File>();
  Boolean atBottom=false;
  Integer windowSize=((Long)((JavascriptExecutor)driver).executeScript("String_Node_Str")).intValue();
  Integer accuScroll=0;
  Integer newTrailingImageHeight=0;
  while (!atBottom) {
    Thread.sleep(1500);
    capture.add(((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE));
    ((JavascriptExecutor)driver).executeScript("String_Node_Str" + "String_Node_Str" + windowSize + "String_Node_Str");
    accuScroll+=windowSize;
    if (getDocumentHeight(driver) <= accuScroll) {
      atBottom=true;
    }
  }
  newTrailingImageHeight=accuScroll - getDocumentHeight(driver);
  return adjustLastCapture(newTrailingImageHeight,capture);
}

Fixed version (ground truth):
private File chromeFullScreenCapture(WebDriver driver) throws IOException, InterruptedException {
  driver.switchTo().defaultContent();
  ArrayList<File> capture=new ArrayList<File>();
  Boolean atBottom=false;
  Integer windowSize=((Long)((JavascriptExecutor)driver).executeScript("String_Node_Str")).intValue();
  Integer accuScroll=0;
  Integer newTrailingImageHeight=0;
  while (!atBottom) {
    Thread.sleep(DEFAULT_SLEEP_TIME);
    capture.add(((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE));
    ((JavascriptExecutor)driver).executeScript("String_Node_Str" + "String_Node_Str" + windowSize + "String_Node_Str");
    accuScroll+=windowSize;
    if (getDocumentHeight(driver) <= accuScroll) {
      atBottom=true;
    }
  }
  newTrailingImageHeight=accuScroll - getDocumentHeight(driver);
  return adjustLastCapture(newTrailingImageHeight,capture);
}
Program: 12003
Project: 12003
Buggy source:
@Around(value="String_Node_Str") public Object aroundExceptionCalls(ProceedingJoinPoint pjp) throws Throwable {
  Object retVal=null;
  try {
    retVal=pjp.proceed();
    return retVal;
  }
 catch (  Throwable ex) {
    WebDriver driver=null;
    if (ex instanceof WebDriverException) {
      logger.info("String_Node_Str");
      if (!(pjp.getThis() instanceof WebDriver)) {
        throw ex;
      }
      driver=(WebDriver)pjp.getThis();
    }
 else     if ((pjp.getTarget() instanceof SeleniumAssert) && (ex instanceof AssertionError)) {
      logger.info("String_Node_Str");
      SeleniumAssert as=(SeleniumAssert)pjp.getTarget();
      Class<?> c=as.getClass().getSuperclass();
      Field actual=c.getDeclaredField("String_Node_Str");
      actual.setAccessible(true);
      Object realActual=actual.get(as);
      if (realActual instanceof WebDriver) {
        driver=(WebDriver)actual.get(as);
      }
 else       if (realActual instanceof RemoteWebElement) {
        driver=((RemoteWebElement)actual.get(as)).getWrappedDriver();
      }
    }
    if (driver != null) {
      captureEvidence(driver,"String_Node_Str");
      captureEvidence(driver,"String_Node_Str");
      captureEvidence(driver,"String_Node_Str");
    }
 else {
      logger.info("String_Node_Str");
    }
    throw ex;
  }
}

Fixed version (ground truth):
/** 
 * @param pjp
 * @return
 * @throws Throwable
 */
@Around(value="String_Node_Str") public Object aroundExceptionCalls(ProceedingJoinPoint pjp) throws Throwable {
  Object retVal=null;
  try {
    retVal=pjp.proceed();
    return retVal;
  }
 catch (  Throwable ex) {
    WebDriver driver=null;
    if (ex instanceof WebDriverException) {
      logger.info("String_Node_Str");
      if (!(pjp.getThis() instanceof WebDriver)) {
        throw ex;
      }
      driver=(WebDriver)pjp.getThis();
    }
 else     if ((pjp.getTarget() instanceof SeleniumAssert) && (ex instanceof AssertionError)) {
      logger.info("String_Node_Str");
      SeleniumAssert as=(SeleniumAssert)pjp.getTarget();
      Class<?> c=as.getClass().getSuperclass();
      Field actual=c.getDeclaredField("String_Node_Str");
      actual.setAccessible(true);
      Object realActual=actual.get(as);
      if (realActual instanceof WebDriver) {
        driver=(WebDriver)actual.get(as);
      }
 else       if (realActual instanceof RemoteWebElement) {
        driver=((RemoteWebElement)actual.get(as)).getWrappedDriver();
      }
    }
    if (driver != null) {
      captureEvidence(driver,"String_Node_Str");
      captureEvidence(driver,"String_Node_Str");
      captureEvidence(driver,"String_Node_Str");
    }
 else {
      logger.info("String_Node_Str");
    }
    throw ex;
  }
}
Program: 12004
Project: 12004
Buggy source:
@Override Attachment.EmptyAttachment parseAttachment(JSONObject attachmentData) throws NxtException.NotValidException {
  return Attachment.AT_PAYMENT;
}

Fixed version (ground truth):
@Override AbstractAttachment parseAttachment(JSONObject attachmentData) throws NxtException.NotValidException {
  return new Attachment.AutomatedTransactionsPayment(attachmentData);
}
Program: 12005
Project: 12005
Buggy source:
protected static Long findTransaction(int startHeight,Long atID,int numOfTx,long minAmount){
  try (Connection con=Db.getConnection();PreparedStatement pstmt=con.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str")){
    pstmt.setInt(1,startHeight);
    pstmt.setInt(2,Nxt.getBlockchain().getHeight());
    pstmt.setLong(3,atID);
    pstmt.setInt(4,numOfTx);
    pstmt.setLong(5,minAmount);
    ResultSet rs=pstmt.executeQuery();
    Long transactionId=0L;
    if (rs.next()) {
      transactionId=rs.getLong("String_Node_Str");
    }
    rs.close();
    return transactionId;
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
}

Fixed version (ground truth):
protected static Long findTransaction(int startHeight,Long atID,int numOfTx,long minAmount){
  try (Connection con=Db.getConnection();PreparedStatement pstmt=con.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str")){
    pstmt.setInt(1,startHeight);
    pstmt.setInt(2,Nxt.getBlockchain().getHeight());
    pstmt.setLong(3,atID);
    pstmt.setLong(4,minAmount);
    pstmt.setInt(5,numOfTx);
    ResultSet rs=pstmt.executeQuery();
    Long transactionId=0L;
    if (rs.next()) {
      transactionId=rs.getLong("String_Node_Str");
    }
    rs.close();
    return transactionId;
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
}
Program: 12006
Project: 12006
Buggy source:
@Override public long get_Type_for_Tx_in_A(AT_Machine_State state){
  long txid=AT_API_Helper.getLong(state.get_A1());
  Transaction tx=Nxt.getBlockchain().getTransaction(txid);
  if (tx != null) {
    if (tx.getType().getType() == 1) {
      return 1;
    }
 else {
      return 0;
    }
  }
  return -1;
}

Fixed version (ground truth):
@Override public long get_Type_for_Tx_in_A(AT_Machine_State state){
  long txid=AT_API_Helper.getLong(state.get_A1());
  Transaction tx=Nxt.getBlockchain().getTransaction(txid);
  if (tx != null) {
    if (tx.getMessage() != null) {
      return 1;
    }
 else {
      return 0;
    }
  }
  return -1;
}
Program: 12007
Project: 12007
Buggy source:
public LinkedList<AT_Transaction> getTransactions(){
  return transactions;
}

Fixed version (ground truth):
public Collection<AT_Transaction> getTransactions(){
  return transactions.values();
}
Program: 12009
Project: 12009
Buggy source:
public byte[] getTransactionBytes(){
  ByteBuffer b=ByteBuffer.allocate((creator.length + 8) * transactions.size());
  b.order(ByteOrder.LITTLE_ENDIAN);
  for (  AT_Transaction tx : transactions) {
    b.put(tx.getRecipientId());
    b.putLong(tx.getAmount());
  }
  return b.array();
}

Fixed version (ground truth):
public byte[] getTransactionBytes(){
  ByteBuffer b=ByteBuffer.allocate((creator.length + 8) * transactions.size());
  b.order(ByteOrder.LITTLE_ENDIAN);
  for (  AT_Transaction tx : transactions.values()) {
    b.put(tx.getRecipientId());
    b.putLong(tx.getAmount());
  }
  return b.array();
}
Program: 12010
Project: 12010
Buggy source:
protected void addTransaction(AT_Transaction tx){
  transactions.add(tx);
}

Fixed version (ground truth):
protected void addTransaction(AT_Transaction tx){
  ByteBuffer recipId=ByteBuffer.wrap(tx.getRecipientId());
  AT_Transaction oldTx=transactions.get(recipId);
  if (oldTx == null) {
    transactions.put(recipId,tx);
  }
 else {
    AT_Transaction newTx=new AT_Transaction(tx.getSenderId(),tx.getRecipientId(),oldTx.getAmount() + tx.getAmount(),tx.getMessage() != null ? tx.getMessage() : oldTx.getMessage());
    transactions.put(recipId,newTx);
  }
}
Program: 12012
Project: 12012
Buggy source:
public static AT getAT(Long id){
  try (PreparedStatement pstmt=Db.getConnection().prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str")){
    int i=0;
    pstmt.setLong(++i,id);
    ResultSet result=pstmt.executeQuery();
    List<AT> ats=createATs(result);
    if (ats.size() > 0) {
      return ats.get(0);
    }
    return null;
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
}

Fixed version (ground truth):
public static AT getAT(Long id){
  try (Connection con=Db.getConnection();PreparedStatement pstmt=con.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str")){
    int i=0;
    pstmt.setLong(++i,id);
    ResultSet result=pstmt.executeQuery();
    List<AT> ats=createATs(result);
    if (ats.size() > 0) {
      return ats.get(0);
    }
    return null;
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
}
Program: 12013
Project: 12013
Buggy source:
public static List<AT> getATsIssuedBy(Long accountId){
  try (PreparedStatement pstmt=Db.getConnection().prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str")){
    pstmt.setLong(1,accountId);
    ResultSet result=pstmt.executeQuery();
    return createATs(result);
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
}

Fixed version (ground truth):
public static List<Long> getATsIssuedBy(Long accountId){
  try (Connection con=Db.getConnection();PreparedStatement pstmt=con.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str")){
    pstmt.setLong(1,accountId);
    ResultSet result=pstmt.executeQuery();
    List<Long> resultList=new ArrayList<>();
    while (result.next()) {
      resultList.add(result.getLong(1));
    }
    return resultList;
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
}
Program: 12014
Project: 12014
Buggy source:
public static List<Long> getOrderedATs(){
  List<Long> orderedATs=new ArrayList<>();
  try (PreparedStatement pstmt=Db.getConnection().prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str")){
    pstmt.setInt(1,Nxt.getBlockchain().getHeight());
    pstmt.setLong(2,AT_Constants.getInstance().STEP_FEE(Nxt.getBlockchain().getHeight()));
    ResultSet result=pstmt.executeQuery();
    while (result.next()) {
      Long id=result.getLong(1);
      orderedATs.add(id);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
  return orderedATs;
}

Fixed version (ground truth):
public static List<Long> getOrderedATs(){
  List<Long> orderedATs=new ArrayList<>();
  try (Connection con=Db.getConnection();PreparedStatement pstmt=con.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str")){
    pstmt.setInt(1,Nxt.getBlockchain().getHeight());
    pstmt.setLong(2,AT_Constants.getInstance().STEP_FEE(Nxt.getBlockchain().getHeight()));
    ResultSet result=pstmt.executeQuery();
    while (result.next()) {
      Long id=result.getLong(1);
      orderedATs.add(id);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
  return orderedATs;
}
Program: 12015
Project: 12015
Buggy source:
byte[] getBytes(){
  ByteBuffer buffer=ByteBuffer.allocate(4 + 4 + 8+ 4+ (version < 3 ? (4 + 4) : (8 + 8))+ 4+ 32+ 32+ (32 + 32)+ 8+ (blockATs != null ? blockATs.length : 0)+ 64);
  buffer.order(ByteOrder.LITTLE_ENDIAN);
  buffer.putInt(version);
  buffer.putInt(timestamp);
  buffer.putLong(previousBlockId);
  buffer.putInt(getTransactions().size());
  if (version < 3) {
    buffer.putInt((int)(totalAmountNQT / Constants.ONE_NXT));
    buffer.putInt((int)(totalFeeNQT / Constants.ONE_NXT));
  }
 else {
    buffer.putLong(totalAmountNQT);
    buffer.putLong(totalFeeNQT);
  }
  buffer.putInt(payloadLength);
  buffer.put(payloadHash);
  buffer.put(generatorPublicKey);
  buffer.put(generationSignature);
  if (version > 1) {
    buffer.put(previousBlockHash);
  }
  buffer.putLong(nonce);
  buffer.put(blockATs);
  buffer.put(blockSignature);
  return buffer.array();
}

Fixed version (ground truth):
byte[] getBytes(){
  ByteBuffer buffer=ByteBuffer.allocate(4 + 4 + 8+ 4+ (version < 3 ? (4 + 4) : (8 + 8))+ 4+ 32+ 32+ (32 + 32)+ 8+ (blockATs != null ? blockATs.length : 0)+ 64);
  buffer.order(ByteOrder.LITTLE_ENDIAN);
  buffer.putInt(version);
  buffer.putInt(timestamp);
  buffer.putLong(previousBlockId);
  buffer.putInt(getTransactions().size());
  if (version < 3) {
    buffer.putInt((int)(totalAmountNQT / Constants.ONE_NXT));
    buffer.putInt((int)(totalFeeNQT / Constants.ONE_NXT));
  }
 else {
    buffer.putLong(totalAmountNQT);
    buffer.putLong(totalFeeNQT);
  }
  buffer.putInt(payloadLength);
  buffer.put(payloadHash);
  buffer.put(generatorPublicKey);
  buffer.put(generationSignature);
  if (version > 1) {
    buffer.put(previousBlockHash);
  }
  buffer.putLong(nonce);
  if (blockATs != null)   buffer.put(blockATs);
  buffer.put(blockSignature);
  return buffer.array();
}
Program: 12017
Project: 12017
Buggy source:
private static void saveResultTransaction(Long blockId,int blockHeight,int blockTime,Long escrowId,Long recipientId,Long amountNQT,DecisionType decision){
  Attachment.AbstractAttachment attachment=new Attachment.AdvancedPaymentEscrowResult(escrowId,decision);
  TransactionImpl.BuilderImpl builder=new TransactionImpl.BuilderImpl((byte)1,Genesis.CREATOR_PUBLIC_KEY,amountNQT,0L,blockTime,(short)1440,attachment);
  builder.recipientId(recipientId).referencedTransactionFullHash((String)null).signature(null).blockId(blockId).height(blockHeight).id(null).senderId(null).blockTimestamp(blockTime).fullHash((String)null).ecBlockHeight(0).ecBlockId(null);
  List<TransactionImpl> transactionList=new ArrayList<>();
  try {
    TransactionImpl transaction=builder.build();
    transactionList.add(transaction);
  }
 catch (  NxtException.NotValidException e) {
    throw new RuntimeException(e.toString(),e);
  }
  try (Connection con=Db.getConnection()){
    TransactionDb.saveTransactions(con,transactionList);
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
}

Fixed version (ground truth):
private static void saveResultTransaction(Long blockId,int blockHeight,int blockTime,Long escrowId,Long recipientId,Long amountNQT,DecisionType decision){
  Attachment.AbstractAttachment attachment=new Attachment.AdvancedPaymentEscrowResult(escrowId,decision);
  TransactionImpl.BuilderImpl builder=new TransactionImpl.BuilderImpl((byte)1,Genesis.CREATOR_PUBLIC_KEY,amountNQT,0L,blockTime,(short)1440,attachment);
  builder.senderId(0L).recipientId(recipientId).referencedTransactionFullHash((String)null).signature(null).blockId(blockId).height(blockHeight).id(null).senderId(null).blockTimestamp(blockTime).fullHash((String)null).ecBlockHeight(0).ecBlockId(0L);
  List<TransactionImpl> transactionList=new ArrayList<>();
  try {
    TransactionImpl transaction=builder.build();
    transactionList.add(transaction);
  }
 catch (  NxtException.NotValidException e) {
    throw new RuntimeException(e.toString(),e);
  }
  try (Connection con=Db.getConnection()){
    TransactionDb.saveTransactions(con,transactionList);
    con.commit();
  }
 catch (  SQLException e) {
    throw new RuntimeException(e.toString(),e);
  }
}
Program: 12018
Project: 12018
Buggy source:
private synchronized boolean process(Long blockId,int blockHeight,int blockTime,boolean apply,boolean scanning) throws NotValidException {
  if (blockTime < timeNext) {
    return true;
  }
  Account sender=Account.getAccount(senderId);
  Account recipient=Account.getAccount(recipientId);
  long totalAmountNQT=Convert.safeAdd(amountNQT,Convert.safeDivide(Constants.ONE_NXT,10L));
  if (sender.getBalanceNQT() < totalAmountNQT) {
    return false;
  }
  if (apply) {
    sender.addToBalanceAndUnconfirmedBalanceNQT(-totalAmountNQT);
    recipient.addToBalanceAndUnconfirmedBalanceNQT(amountNQT);
    timeLast=timeNext;
    timeNext+=frequency;
    if (!scanning) {
      Attachment.AbstractAttachment attachment=new Attachment.AdvancedPaymentSubscriptionPayment(id);
      TransactionImpl.BuilderImpl builder=new TransactionImpl.BuilderImpl((byte)1,sender.getPublicKey(),amountNQT,Convert.safeDivide(Constants.ONE_NXT,10L),timeLast,(short)1440,attachment);
      builder.referencedTransactionFullHash((String)null).signature(null).blockId(blockId).height(blockHeight).id(null).senderId(null).blockTimestamp(blockTime).fullHash((String)null).ecBlockHeight(0).ecBlockId(null);
      TransactionImpl transaction=builder.build();
      paymentTransactions.add(transaction);
    }
  }
  return true;
}

Fixed version (ground truth):
private synchronized boolean process(Long blockId,int blockHeight,int blockTime,boolean apply,boolean scanning) throws NotValidException {
  if (blockTime < timeNext) {
    return true;
  }
  Account sender=Account.getAccount(senderId);
  Account recipient=Account.getAccount(recipientId);
  long totalAmountNQT=Convert.safeAdd(amountNQT,Convert.safeDivide(Constants.ONE_NXT,10L));
  if (sender.getBalanceNQT() < totalAmountNQT) {
    return false;
  }
  if (apply) {
    sender.addToBalanceAndUnconfirmedBalanceNQT(-totalAmountNQT);
    recipient.addToBalanceAndUnconfirmedBalanceNQT(amountNQT);
    timeLast=timeNext;
    timeNext+=frequency;
    if (!scanning) {
      Attachment.AbstractAttachment attachment=new Attachment.AdvancedPaymentSubscriptionPayment(id);
      TransactionImpl.BuilderImpl builder=new TransactionImpl.BuilderImpl((byte)1,sender.getPublicKey(),amountNQT,Convert.safeDivide(Constants.ONE_NXT,10L),timeLast,(short)1440,attachment);
      builder.senderId(senderId).recipientId(recipientId).referencedTransactionFullHash((String)null).signature(null).blockId(blockId).height(blockHeight).id(null).senderId(null).blockTimestamp(blockTime).fullHash((String)null).ecBlockHeight(0).ecBlockId(0L);
      TransactionImpl transaction=builder.build();
      paymentTransactions.add(transaction);
    }
  }
  return true;
}
Program: 12019
Project: 12019
Buggy source:
public static void saveTransactions(){
  if (paymentTransactions.size() > 0) {
    try (Connection con=Db.getConnection()){
      TransactionDb.saveTransactions(con,paymentTransactions);
    }
 catch (    SQLException e) {
      throw new RuntimeException(e.toString(),e);
    }
    paymentTransactions.clear();
  }
}

Fixed version (ground truth):
public static void saveTransactions(){
  if (paymentTransactions.size() > 0) {
    try (Connection con=Db.getConnection()){
      TransactionDb.saveTransactions(con,paymentTransactions);
      con.commit();
    }
 catch (    SQLException e) {
      throw new RuntimeException(e.toString(),e);
    }
    paymentTransactions.clear();
  }
}
Program: 12020
Project: 12020
Buggy source:
static JSONObject subscription(Subscription subscription){
  JSONObject json=new JSONObject();
  json.put("String_Node_Str",subscription.getId());
  putAccount(json,"String_Node_Str",subscription.getSenderId());
  putAccount(json,"String_Node_Str",subscription.getRecipientId());
  json.put("String_Node_Str",subscription.getAmountNQT());
  json.put("String_Node_Str",subscription.getFrequency());
  json.put("String_Node_Str",subscription.getTimeStart());
  json.put("String_Node_Str",subscription.getTimeLast());
  json.put("String_Node_Str",subscription.getTimeNext());
  return json;
}

Fixed version (ground truth):
static JSONObject subscription(Subscription subscription){
  JSONObject json=new JSONObject();
  json.put("String_Node_Str",Convert.toUnsignedLong(subscription.getId()));
  putAccount(json,"String_Node_Str",subscription.getSenderId());
  putAccount(json,"String_Node_Str",subscription.getRecipientId());
  json.put("String_Node_Str",Convert.toUnsignedLong(subscription.getAmountNQT()));
  json.put("String_Node_Str",subscription.getFrequency());
  json.put("String_Node_Str",subscription.getTimeStart());
  json.put("String_Node_Str",subscription.getTimeLast());
  json.put("String_Node_Str",subscription.getTimeNext());
  return json;
}
Program: 12021
Project: 12021
Buggy source:
public ExtractMethodFragmentRefactoring(){
  this.tryStatementsToBeRemoved=new LinkedHashSet<TryStatement>();
  this.tryStatementsToBeCopied=new LinkedHashSet<TryStatement>();
  this.tryStatementBodyRewriteMap=new LinkedHashMap<TryStatement,ListRewrite>();
  this.doLoopNodes=new ArrayList<CFGBranchDoLoopNode>();
}

Fixed version (ground truth):
public ExtractMethodFragmentRefactoring(){
  this.tryStatementsToBeRemoved=new LinkedHashSet<TryStatement>();
  this.tryStatementsToBeCopied=new LinkedHashSet<TryStatement>();
  this.tryStatementBodyRewriteMap=new LinkedHashMap<TryStatement,ListRewrite>();
  this.doLoopNodes=new ArrayList<CFGBranchDoLoopNode>();
  this.labeledStatementsToBeRemoved=new LinkedHashSet<LabeledStatement>();
}
Program: 12028
Project: 12028
Buggy source:
protected TryStatement surroundingTryBlock(Statement statement){
  ASTNode parent=statement.getParent();
  while (!(parent instanceof MethodDeclaration)) {
    if (parent instanceof TryStatement)     return (TryStatement)parent;
    parent=parent.getParent();
  }
  return null;
}

Fixed version (ground truth):
protected TryStatement surroundingTryBlock(ASTNode statement){
  ASTNode parent=statement.getParent();
  while (!(parent instanceof MethodDeclaration)) {
    if (parent instanceof TryStatement)     return (TryStatement)parent;
    parent=parent.getParent();
  }
  return null;
}
Program: 12031
Project: 12031
Buggy source:
public boolean hasResources(){
  return !getExpressions().isEmpty();
}

Fixed version (ground truth):
public boolean hasResources(){
  return !super.getExpressions().isEmpty();
}
Program: 12037
Project: 12037
Buggy source:
private MethodInvocationObject recurseDelegations(MethodInvocationObject methodInvocation,SystemObject system){
  MethodInvocationObject delegation;
  if ((delegation=system.containsDelegate(methodInvocation)) != null && system.getClassObject(delegation.getOriginClassName()) != null)   return recurseDelegations(delegation,system);
 else   return methodInvocation;
}

Fixed version (ground truth):
private MethodInvocationObject recurseDelegations(MethodInvocationObject methodInvocation,SystemObject system){
  MethodInvocationObject delegation;
  if ((delegation=system.containsDelegate(methodInvocation)) != null && system.getClassObject(delegation.getOriginClassName()) != null && !delegation.equals(methodInvocation))   return recurseDelegations(delegation,system);
 else   return methodInvocation;
}
Program: 12038
Project: 12038
Buggy source:
public int getEndOffset(){
  return this.endOffset;
}

Fixed version (ground truth):
public int getEndOffset(){
  return endOffset;
}
Program: 12039
Project: 12039
Buggy source:
public CloneInstanceLocationInfo(String filePath,int startLine,int startColumn,int endLine,int endColumn){
  this(filePath);
  this.startLine=startLine;
  this.startColumn=startColumn;
  this.endLine=endLine;
  this.endColumn=endColumn;
  String fileContents=readFileContents(filePath);
  String[] lines=fileContents.split(LINE_FEED);
  int numberOfCharsForLines=getNumberOfCharsForLines(lines,startLine - 1);
  this.startOffset=numberOfCharsForLines + this.startColumn;
  while (isWhiteSpaceCharacter(fileContents.charAt(startOffset))) {
    this.startOffset++;
  }
  numberOfCharsForLines=getNumberOfCharsForLines(lines,endLine) - 1;
  this.endOffset=numberOfCharsForLines + this.endColumn;
  while (isWhiteSpaceCharacter(fileContents.charAt(this.endOffset))) {
    this.endOffset--;
  }
  this.length=this.endOffset - this.startOffset + 1;
}

Fixed version (ground truth):
public CloneInstanceLocationInfo(String filePath,int startLine,int startColumn,int endLine,int endColumn){
  this.filePath=filePath;
  this.startLine=startLine;
  this.startColumn=startColumn;
  this.endLine=endLine;
  this.endColumn=endColumn;
  String fileContents=readFileContents(filePath);
  String[] lines=fileContents.split(LINE_FEED);
  int numberOfCharsForLines=getNumberOfCharsForLines(lines,startLine - 1);
  this.startOffset=numberOfCharsForLines + this.startColumn;
  while (isWhiteSpaceCharacter(fileContents.charAt(startOffset))) {
    this.startOffset++;
  }
  numberOfCharsForLines=getNumberOfCharsForLines(lines,endLine) - 1;
  this.endOffset=numberOfCharsForLines + this.endColumn;
  while (isWhiteSpaceCharacter(fileContents.charAt(this.endOffset))) {
    this.endOffset--;
  }
  this.length=this.endOffset - this.startOffset + 1;
}
Program: 12041
Project: 12041
Buggy source:
private int getNumberOfCharsForLines(String[] linesBeforeAndIncludingOffset,int line){
  if (line >= linesBeforeAndIncludingOffset.length)   return 0;
  int charsBeforeLine=0;
  for (int i=0; i < line; i++) {
    charsBeforeLine+=linesBeforeAndIncludingOffset[i].length() + LINE_FEED.length();
  }
  return charsBeforeLine;
}

Fixed version (ground truth):
private int getNumberOfCharsForLines(String[] lines,int line){
  if (line >= lines.length)   return 0;
  int charsBeforeLine=0;
  for (int i=0; i < line; i++) {
    charsBeforeLine+=lines[i].length() + LINE_FEED.length();
  }
  return charsBeforeLine;
}