nus-yam/ex-repair huggingface dataset:
Program: 81591
Project: 81591
Buggy source:
public void clean(){
  headers=null;
  count=0;
  hasHeader=false;
}

Fixed version (ground truth):
public void clean(){
  headers=null;
  count=0;
}
Program: 81592
Project: 81592
Buggy source:
@Override protected boolean isCheckedAction(){
  return getWebElement().getAttribute("String_Node_Str") != null;
}

Fixed version (ground truth):
@Override protected boolean isCheckedAction(){
  return new Element(By.xpath("String_Node_Str")).getInvisibleElement().getAttribute("String_Node_Str") != null;
}
Program: 81593
Project: 81593
Buggy source:
public MapArray<String,ICell> getRow(int rowNum){
  if (count() < 0 || count() < rowNum || rowNum <= 0)   throw exception("String_Node_Str",rowNum,count());
  try {
    List<WebElement> webRow=table.rows().getRowAction(rowNum);
    return new MapArray<>(count(),key -> headers()[key],value -> table.cell(webRow.get(value),new Column(value + 1),new Row(rowNum)));
  }
 catch (  Throwable ex) {
    throw throwColsException(rowNum + "String_Node_Str",ex.getMessage());
  }
}

Fixed version (ground truth):
public MapArray<String,ICell> getRow(int rowNum){
  if (count() < 0 || table.rows().count() < rowNum || rowNum <= 0)   throw exception("String_Node_Str",rowNum,count());
  try {
    List<WebElement> webRow=table.rows().getRowAction(rowNum);
    return new MapArray<>(count(),key -> headers()[key],value -> table.cell(webRow.get(value),new Column(value + 1),new Row(rowNum)));
  }
 catch (  Throwable ex) {
    throw throwColsException(rowNum + "String_Node_Str",ex.getMessage());
  }
}
Program: 81594
Project: 81594
Buggy source:
public final MapArray<String,ICell> getColumn(int colNum){
  if (count() < 0 || count() < colNum || colNum <= 0)   throw exception("String_Node_Str",colNum,count());
  try {
    List<WebElement> webColumn=table.columns().getColumnAction(colNum);
    return new MapArray<>(count(),key -> headers()[key],value -> table.cell(webColumn.get(value),new Column(colNum),new Row(value + 1)));
  }
 catch (  Throwable ex) {
    throw throwRowsException(colNum + "String_Node_Str",ex.getMessage());
  }
}

Fixed version (ground truth):
public final MapArray<String,ICell> getColumn(int colNum){
  if (count() < 0 || table.columns().count() < colNum || colNum <= 0)   throw exception("String_Node_Str",colNum,count());
  try {
    List<WebElement> webColumn=table.columns().getColumnAction(colNum);
    return new MapArray<>(count(),key -> headers()[key],value -> table.cell(webColumn.get(value),new Column(colNum),new Row(value + 1)));
  }
 catch (  Throwable ex) {
    throw throwRowsException(colNum + "String_Node_Str",ex.getMessage());
  }
}
Program: 81595
Project: 81595
Buggy source:
@Test public void getRowsCacheTest(){
  List<ICell> cells=support().getCells();
  Timer timer=new Timer();
  support().useCache();
  MapArray<String,MapArray<String,String>> rows=support().rows().getAsText();
  logger.info("String_Node_Str" + timer.timePassedInMSec() + "String_Node_Str");
  Assert.areEquals(rows,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
@Test public void getRowsCacheTest(){
  Timer timer=new Timer();
  support().useCache();
  MapArray<String,MapArray<String,String>> rows=support().rows().getAsText();
  logger.info("String_Node_Str" + timer.timePassedInMSec() + "String_Node_Str");
  Assert.areEquals(rows,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 81596
Project: 81596
Buggy source:
public IText textElement() throws Exception {
  throw new Exception();
}

Fixed version (ground truth):
public IText textElement() throws RuntimeException {
  throw new RuntimeException();
}
Program: 81597
Project: 81597
Buggy source:
@Override public IDatePicker textElement() throws Exception {
  return EpamJDISite.dates._datepicker;
}

Fixed version (ground truth):
@Override public IDatePicker textElement(){
  return EpamJDISite.dates._datepicker;
}
Program: 81598
Project: 81598
Buggy source:
public IFileInput robotInput() throws Exception {
  return EpamJDISite.dates._imageInput;
}

Fixed version (ground truth):
public IFileInput robotInput(){
  return EpamJDISite.dates._imageInput;
}
Program: 81599
Project: 81599
Buggy source:
@Test public void inputTest() throws Exception {
  textElement().input(getFPath());
  checkAction("String_Node_Str" + getFName() + "String_Node_Str");
}

Fixed version (ground truth):
@Test public void inputTest(){
  textElement().input(getFPath());
  checkAction("String_Node_Str" + getFName() + "String_Node_Str");
}
Program: 81600
Project: 81600
Buggy source:
@Test public void sendKeysTest() throws Exception {
  textElement().sendKeys(getFPath());
  checkAction("String_Node_Str" + getFName() + "String_Node_Str");
}

Fixed version (ground truth):
@Test public void sendKeysTest(){
  textElement().sendKeys(getFPath());
  checkAction("String_Node_Str" + getFName() + "String_Node_Str");
}
Program: 81601
Project: 81601
Buggy source:
@Override public RFileInput textElement() throws Exception {
  return EpamJDISite.dates._rImageInput;
}

Fixed version (ground truth):
@Override public RFileInput textElement(){
  return EpamJDISite.dates._rImageInput;
}
Program: 81602
Project: 81602
Buggy source:
protected List<WebElement> getColumnAction(String colName){
  return (columnNameTemplate == null) ? getColumnAction(index(headers,colName) + 1) : table.getWebElement().findElements(fillByTemplate(columnNameTemplate,colName));
}

Fixed version (ground truth):
protected List<WebElement> getColumnAction(String colName){
  return (columnNameTemplate == null) ? getColumnAction(index(headers(),colName) + 1) : table.getWebElement().findElements(fillByTemplate(columnNameTemplate,colName));
}
Program: 81603
Project: 81603
Buggy source:
protected List<WebElement> getRowAction(String rowName){
  return (rowNameTemplate == null) ? getRowAction(index(headers,rowName) + 1) : table.getWebElement().findElements(fillByTemplate(rowNameTemplate,rowName));
}

Fixed version (ground truth):
protected List<WebElement> getRowAction(String rowName){
  return (rowNameTemplate == null) ? getRowAction(index(headers(),rowName) + 1) : table.getWebElement().findElements(fillByTemplate(rowNameTemplate,rowName));
}
Program: 81604
Project: 81604
Buggy source:
public final String[] headers(){
  if (headers != null)   return headers;
  String[] localHeaders=Timer.getResultAction(this::getHeadersTextAction);
  setHeaders((hasHeader) ? localHeaders : getNumList(localHeaders.length));
  if (localHeaders == null || localHeaders.length == 0)   throw exception("String_Node_Str");
  setCount(localHeaders.length);
  return localHeaders;
}

Fixed version (ground truth):
public final String[] headers(){
  if (headers != null)   return headers;
  String[] localHeaders=Timer.getResultAction(this::getHeadersTextAction);
  localHeaders=(hasHeader) ? localHeaders : getNumList(localHeaders.length);
  setHeaders(localHeaders);
  if (localHeaders == null || localHeaders.length == 0)   throw exception("String_Node_Str");
  setCount(localHeaders.length);
  return localHeaders;
}
Program: 81605
Project: 81605
Buggy source:
@Test public void getRowsCacheTest(){
  Timer timer=new Timer();
  support().useCache();
  MapArray<String,MapArray<String,String>> rows=support().rows().getAsText();
  logger.info("String_Node_Str" + timer.timePassedInMSec() + "String_Node_Str");
  Assert.areEquals(rows,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
@Test public void getRowsCacheTest(){
  List<ICell> cells=support().getCells();
  Timer timer=new Timer();
  support().useCache();
  MapArray<String,MapArray<String,String>> rows=support().rows().getAsText();
  logger.info("String_Node_Str" + timer.timePassedInMSec() + "String_Node_Str");
  Assert.areEquals(rows,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 81606
Project: 81606
Buggy source:
protected void selectAction(int index){
  if (!haveLocator() && allLabels == null)   throw exception("String_Node_Str",index);
  if (allLabels != null) {
    selectFromList(allLabels.getWebElements(),index);
    return;
  }
  if (getLocator().toString().contains("String_Node_Str")) {
    new Clickable(fillByTemplate(getLocator(),index)).click();
    return;
  }
  List<WebElement> els=getDriver().findElements(getLocator());
  if (els.size() == 1)   getSelector().selectByIndex(index);
 else   selectFromList(els,index);
}

Fixed version (ground truth):
protected void selectAction(int index){
  if (!haveLocator() && allLabels == null)   throw exception("String_Node_Str",index);
  if (allLabels != null) {
    selectFromList(allLabels.getWebElements(),index);
    return;
  }
  if (getLocator().toString().contains("String_Node_Str")) {
    new Clickable(fillByTemplate(getLocator(),index)).click();
    return;
  }
  List<WebElement> els=getAvatar().getElements();
  if (els.size() == 1)   getSelector().selectByIndex(index);
 else   selectFromList(els,index);
}
Program: 81607
Project: 81607
Buggy source:
protected List<WebElement> getElements(){
  if (!haveLocator() && allLabels == null)   throw exception("String_Node_Str");
  if (allLabels != null)   return allLabels.getWebElements();
  if (getLocator().toString().contains("String_Node_Str"))   throw exception("String_Node_Str");
  List<WebElement> els=getDriver().findElements(getLocator());
  if (els.size() == 1)   els=getSelector().getAllSelectedOptions();
  return els;
}

Fixed version (ground truth):
protected List<WebElement> getElements(){
  if (!haveLocator() && allLabels == null)   throw exception("String_Node_Str");
  if (allLabels != null)   return allLabels.getWebElements();
  if (getLocator().toString().contains("String_Node_Str"))   throw exception("String_Node_Str");
  List<WebElement> els=getAvatar().getElements();
  if (els.size() == 1)   els=getSelector().getAllSelectedOptions();
  return els;
}
Program: 81608
Project: 81608
Buggy source:
protected void clearAction(){
  if (!haveLocator() && allLabels == null)   throw exception("String_Node_Str");
  if (getLocator().toString().contains("String_Node_Str"))   throw exception("String_Node_Str");
  if (allLabels != null) {
    clearElements(allLabels.getWebElements());
    return;
  }
  List<WebElement> els=getDriver().findElements(getLocator());
  if (els.size() == 1)   getSelector().deselectAll();
 else   clearElements(els);
}

Fixed version (ground truth):
protected void clearAction(){
  if (!haveLocator() && allLabels == null)   throw exception("String_Node_Str");
  if (getLocator().toString().contains("String_Node_Str"))   throw exception("String_Node_Str");
  if (allLabels != null) {
    clearElements(allLabels.getWebElements());
    return;
  }
  List<WebElement> els=getAvatar().getElements();
  if (els.size() == 1)   getSelector().deselectAll();
 else   clearElements(els);
}
Program: 81609
Project: 81609
Buggy source:
protected int getSelectedIndexAction(){
  if (allLabels != null) {
    return getSelectedIndex(allLabels.getWebElements());
  }
  if (getLocator().toString().contains("String_Node_Str"))   throw exception("String_Node_Str");
  List<WebElement> els=getDriver().findElements(getLocator());
  if (els.size() == 1)   return getSelectedIndex(getSelector().getOptions());
 else   return getSelectedIndex(els);
}

Fixed version (ground truth):
protected int getSelectedIndexAction(){
  if (allLabels != null) {
    return getSelectedIndex(allLabels.getWebElements());
  }
  if (getLocator().toString().contains("String_Node_Str"))   throw exception("String_Node_Str");
  List<WebElement> els=getAvatar().getElements();
  if (els.size() == 1)   return getSelectedIndex(getSelector().getOptions());
 else   return getSelectedIndex(els);
}
Program: 81610
Project: 81610
Buggy source:
protected String getSelectedAction(){
  if (allLabels != null)   return getSelected(allLabels.getWebElements());
  if (getLocator().toString().contains("String_Node_Str"))   throw exception("String_Node_Str");
  List<WebElement> els=getDriver().findElements(getLocator());
  if (els.size() == 1)   return getSelected(getSelector().getOptions());
 else   return getSelected(els);
}

Fixed version (ground truth):
protected String getSelectedAction(){
  if (allLabels != null)   return getSelected(allLabels.getWebElements());
  if (getLocator().toString().contains("String_Node_Str"))   throw exception("String_Node_Str");
  List<WebElement> els=getAvatar().getElements();
  if (els.size() == 1)   return getSelected(getSelector().getOptions());
 else   return getSelected(els);
}
Program: 81611
Project: 81611
Buggy source:
public RuntimeException exception(String failMessage,Object... args){
  failMessage=format(failMessage,args);
  logger.error(FRAMEWORK,failMessage);
  throwFail().invoke(failMessage);
  return new RuntimeException(failMessage);
}

Fixed version (ground truth):
public RuntimeException exception(String failMessage,Object... args){
  if (args.length > 0)   failMessage=format(failMessage,args);
  logger.error(FRAMEWORK,failMessage);
  throwFail().invoke(failMessage);
  return new RuntimeException(failMessage);
}
Program: 81612
Project: 81612
Buggy source:
public static <T extends Enum>List<T> getAllEnumValues(T enumValue){
  return asList(enumValue.getDeclaringClass().getEnumConstants());
}

Fixed version (ground truth):
public static <T extends Enum>List<T> getAllEnumValues(T enumValue){
  return asList((T[])enumValue.getDeclaringClass().getEnumConstants());
}
Program: 81613
Project: 81613
Buggy source:
public static void fillPageFromAnnotaiton(Page element,JPage pageAnnotation,Class<?> parentClass){
  String url=pageAnnotation.url();
  if (!hasDomain() && parentClass != null && parentClass.isAnnotationPresent(JSite.class))   domain=parentClass.getAnnotation(JSite.class).domain();
  url=(url.contains("String_Node_Str") || parentClass == null || !hasDomain()) ? url : getUrlFromUri(url);
  String title=pageAnnotation.title();
  String urlContains=pageAnnotation.urlContains();
  String titleContains=pageAnnotation.titleContains();
  String urlMatchs=pageAnnotation.urlMatchs();
  urlMatchs=(urlMatchs.contains("String_Node_Str") || parentClass == null || !hasDomain()) ? urlMatchs : getUrlFromUri(urlMatchs);
  String titleMatchs=pageAnnotation.titleMatchs();
  element.updatePageData(url,title,urlContains,titleContains,urlMatchs,titleMatchs);
}

Fixed version (ground truth):
public static void fillPageFromAnnotaiton(Page element,JPage pageAnnotation,Class<?> parentClass){
  String url=pageAnnotation.url();
  if (!hasDomain() && parentClass != null && parentClass.isAnnotationPresent(JSite.class))   domain=parentClass.getAnnotation(JSite.class).domain();
  url=(url.contains("String_Node_Str") || parentClass == null || !hasDomain()) ? url : getUrlFromUri(url);
  String title=pageAnnotation.title();
  String urlContains=pageAnnotation.urlContains();
  String titleContains=pageAnnotation.titleContains();
  String urlMatchs=pageAnnotation.urlMatchs();
  if (urlMatchs != null && !urlMatchs.equals("String_Node_Str"))   urlMatchs=(urlMatchs.contains("String_Node_Str") || parentClass == null || !hasDomain()) ? urlMatchs : getUrlFromUri(urlMatchs);
  String titleMatchs=pageAnnotation.titleMatchs();
  element.updatePageData(url,title,urlContains,titleContains,urlMatchs,titleMatchs);
}
Program: 81614
Project: 81614
Buggy source:
private void selectFromList(List<WebElement> els,int index){
  if (index <= 0)   throw asserter.exception("String_Node_Str",index);
  if (els == null)   throw asserter.exception("String_Node_Str",index);
  if (els.size() < index)   throw asserter.exception("String_Node_Str",index,els.size());
  els.get(index).click();
}

Fixed version (ground truth):
private void selectFromList(List<WebElement> els,int index){
  if (index <= 0)   throw asserter.exception("String_Node_Str",index);
  if (els == null)   throw asserter.exception("String_Node_Str",index);
  if (els.size() < index)   throw asserter.exception("String_Node_Str",index,els.size());
  els.get(index - 1).click();
}
Program: 81615
Project: 81615
Buggy source:
private String getSelected(List<WebElement> els){
  WebElement element=first(els,this::isSelected);
  if (element == null)   throw asserter.exception("String_Node_Str");
  return element.getText();
}

Fixed version (ground truth):
private String getSelected(List<WebElement> els){
  WebElement element=first(els,this::isSelectedAction);
  if (element == null)   throw asserter.exception("String_Node_Str");
  return element.getText();
}
Program: 81616
Project: 81616
Buggy source:
protected boolean isSelectedAction(int index){
  return getSelectedIndexAction() == index;
}

Fixed version (ground truth):
protected boolean isSelectedAction(WebElement el){
  return el.isSelected();
}
Program: 81617
Project: 81617
Buggy source:
private int getSelectedIndex(List<WebElement> els){
  return firstIndex(els,this::isSelected);
}

Fixed version (ground truth):
private int getSelectedIndex(List<WebElement> els){
  return firstIndex(els,this::isSelectedAction) + 1;
}
Program: 81618
Project: 81618
Buggy source:
private String printShortBy(By by){
  return getByFunc(by).toString().split("String_Node_Str")[1] + "String_Node_Str" + getByLocator(by);
}

Fixed version (ground truth):
private String printShortBy(By by){
  return getByName(by) + "String_Node_Str" + getByLocator(by);
}
Program: 81619
Project: 81619
Buggy source:
public int count(){
  return (count > 0) ? count : headers() != null ? headers.length : 0;
}

Fixed version (ground truth):
public int count(){
  if (count > 0)   return count;
 else {
    String[] headers=headers();
    return headers != null ? headers.length : 0;
  }
}
Program: 81620
Project: 81620
Buggy source:
public MapArray<String,ICell<T>> getRow(int rowNum){
  int colsCount=-1;
  if (count > 0)   colsCount=count;
 else   if (headers != null && (headers.length > 0))   colsCount=headers.length;
  if (colsCount > 0 && colsCount < rowNum)   asserter.exception(format("String_Node_Str",rowNum,colsCount));
  try {
    return new MapArray<>(count(),colNum -> headers()[colNum],colNum -> table.cell(new Column(colNum),new Row(rowNum)));
  }
 catch (  Exception ex) {
    throw throwColsException(rowNum + "String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public MapArray<String,ICell<T>> getRow(int rowNum){
  int colsCount=-1;
  if (count > 0)   colsCount=count;
 else   if (headers != null && (headers.length > 0))   colsCount=headers.length;
  if (colsCount == -1)   colsCount=headers().length;
  if (colsCount > 0 && colsCount < rowNum)   throw asserter.exception(format("String_Node_Str",rowNum,colsCount));
  try {
    return new MapArray<>(count(),colNum -> headers()[colNum],colNum -> table.cell(new Column(colNum + 1),new Row(rowNum)));
  }
 catch (  Exception ex) {
    throw throwColsException(rowNum + "String_Node_Str",ex);
  }
}
Program: 81621
Project: 81621
Buggy source:
public final MapArray<String,ICell<T>> getColumn(int colNum){
  int rowsCount=-1;
  if (count > 0)   rowsCount=count;
 else   if (headers != null && (headers.length > 0))   rowsCount=headers.length;
  if (rowsCount > 0 && rowsCount < colNum)   asserter.exception(format("String_Node_Str",colNum,rowsCount));
  try {
    return new MapArray<>(count(),rowNum -> headers()[rowNum],rowNum -> table.cell(new Column(colNum),new Row(rowNum)));
  }
 catch (  Exception ex) {
    throw throwRowsException(colNum + "String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public final MapArray<String,ICell<T>> getColumn(int colNum){
  int rowsCount=-1;
  if (count > 0)   rowsCount=count;
 else   if (headers != null && (headers.length > 0))   rowsCount=headers.length;
  if (rowsCount == -1)   rowsCount=headers().length;
  if (rowsCount > 0 && rowsCount < colNum)   throw asserter.exception(format("String_Node_Str",colNum,rowsCount));
  try {
    return new MapArray<>(count(),rowNum -> headers()[rowNum],rowNum -> table.cell(new Column(colNum),new Row(rowNum + 1)));
  }
 catch (  Exception ex) {
    throw throwRowsException(colNum + "String_Node_Str",ex);
  }
}
Program: 81622
Project: 81622
Buggy source:
public Verify(String checkMessage,DoScreen doScreenshot){
  super(checkMessage,doScreenshot);
  setFailMethod(fails::add);
}

Fixed version (ground truth):
public Verify(String checkMessage){
  super(checkMessage);
}
Program: 81623
Project: 81623
Buggy source:
private static BaseChecker getAssert(){
  return new Check(doScreenOnFail ? SCREEN_ON_FAIL : NO_SCREEN);
}

Fixed version (ground truth):
private static BaseChecker getAssert(){
  return new Check().setFailMethod(doScreenOnFail ? SCREEN_ON_FAIL : NO_SCREEN);
}
Program: 81624
Project: 81624
Buggy source:
public Check(String checkMessage,DoScreen doScreenshot){
  super(checkMessage,doScreenshot);
  setFailMethod(Assert::fail);
}

Fixed version (ground truth):
public Check(String checkMessage){
  super(checkMessage);
}
Program: 81625
Project: 81625
Buggy source:
private static BaseChecker getAssert(){
  return new Check(DO_SCREEN);
}

Fixed version (ground truth):
private static BaseChecker getAssert(){
  return new Check().setFailMethod(DO_SCREEN);
}
Program: 81626
Project: 81626
Buggy source:
private static BaseChecker getAssert(){
  return new Check(doScreenOnFail ? SCREEN_ON_FAIL : NO_SCREEN);
}

Fixed version (ground truth):
private static BaseChecker getAssert(){
  return new Check().setFailMethod(doScreenOnFail ? SCREEN_ON_FAIL : NO_SCREEN);
}
Program: 81627
Project: 81627
Buggy source:
public Check(String checkMessage,DoScreen doScreenshot){
  super(checkMessage,doScreenshot);
  setFailMethod(Assert::fail);
}

Fixed version (ground truth):
public Check(String checkMessage){
  super(checkMessage);
}
Program: 81628
Project: 81628
Buggy source:
private static BaseChecker getAssert(){
  return new Check(DO_SCREEN);
}

Fixed version (ground truth):
private static BaseChecker getAssert(){
  return new Check().setFailMethod(DO_SCREEN);
}
Program: 81629
Project: 81629
Buggy source:
private String getCheckMessage(String checkMessage){
  String firstWord=checkMessage.split("String_Node_Str")[0];
  return (!firstWord.toLowerCase().equals("String_Node_Str") || firstWord.toLowerCase().equals("String_Node_Str")) ? "String_Node_Str" + checkMessage : checkMessage;
}

Fixed version (ground truth):
private String getCheckMessage(String checkMessage){
  if (checkMessage == null)   checkMessage="String_Node_Str";
  String firstWord=checkMessage.split("String_Node_Str")[0];
  return (!firstWord.toLowerCase().equals("String_Node_Str") || firstWord.toLowerCase().equals("String_Node_Str")) ? "String_Node_Str" + checkMessage : checkMessage;
}
Program: 81630
Project: 81630
Buggy source:
public void actionPerformed(ActionEvent ae){
  EgDownloaderWindow mainWindow=window;
  if (action == addAction) {
    new AddGroupDialog((JFrame)mainWindow);
  }
 else   if (action == changeAction) {
    File dataFile=new File(ComponentConst.ROOT_DATA_PATH);
    if (!dataFile.exists()) {
      dataFile.mkdirs();
      JOptionPane.showMessageDialog(mainWindow,"String_Node_Str");
    }
 else {
      File[] files=dataFile.listFiles();
      List<File> groups=new ArrayList<File>();
      for (      File file : files) {
        if (file.isDirectory()) {
          groups.add(file);
        }
      }
      if (groups.size() > 0) {
        new GroupWindow(groups,mainWindow);
      }
 else {
        JOptionPane.showMessageDialog(mainWindow,"String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent ae){
  EgDownloaderWindow mainWindow=window;
  if (action == addAction) {
    new AddGroupDialog(null,mainWindow);
  }
 else   if (action == changeAction) {
    File dataFile=new File(ComponentConst.ROOT_DATA_PATH);
    if (!dataFile.exists()) {
      dataFile.mkdirs();
      JOptionPane.showMessageDialog(mainWindow,"String_Node_Str");
    }
 else {
      File[] files=dataFile.listFiles();
      List<File> groups=new ArrayList<File>();
      for (      File file : files) {
        if (file.isDirectory()) {
          groups.add(file);
        }
      }
      if (groups.size() > 0) {
        new GroupWindow(groups,mainWindow);
      }
 else {
        JOptionPane.showMessageDialog(mainWindow,"String_Node_Str");
      }
    }
  }
}
Program: 81631
Project: 81631
Buggy source:
public AddTaskGroupMenuItem(String text,final EgDownloaderWindow window,final int action){
  super(text);
  this.setIcon(new ImageIcon(getClass().getResource(ComponentConst.ICON_PATH + ComponentConst.SKIN_NUM + ComponentConst.SKIN_ICON.get(action == addAction ? "String_Node_Str" : "String_Node_Str"))));
  this.setForeground(new Color(0,0,85));
  this.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent ae){
      EgDownloaderWindow mainWindow=window;
      if (action == addAction) {
        new AddGroupDialog((JFrame)mainWindow);
      }
 else       if (action == changeAction) {
        File dataFile=new File(ComponentConst.ROOT_DATA_PATH);
        if (!dataFile.exists()) {
          dataFile.mkdirs();
          JOptionPane.showMessageDialog(mainWindow,"String_Node_Str");
        }
 else {
          File[] files=dataFile.listFiles();
          List<File> groups=new ArrayList<File>();
          for (          File file : files) {
            if (file.isDirectory()) {
              groups.add(file);
            }
          }
          if (groups.size() > 0) {
            new GroupWindow(groups,mainWindow);
          }
 else {
            JOptionPane.showMessageDialog(mainWindow,"String_Node_Str");
          }
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public AddTaskGroupMenuItem(String text,final EgDownloaderWindow window,final int action){
  super(text);
  this.setIcon(new ImageIcon(getClass().getResource(ComponentConst.ICON_PATH + ComponentConst.SKIN_NUM + ComponentConst.SKIN_ICON.get(action == addAction ? "String_Node_Str" : "String_Node_Str"))));
  this.setForeground(new Color(0,0,85));
  this.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent ae){
      EgDownloaderWindow mainWindow=window;
      if (action == addAction) {
        new AddGroupDialog(null,mainWindow);
      }
 else       if (action == changeAction) {
        File dataFile=new File(ComponentConst.ROOT_DATA_PATH);
        if (!dataFile.exists()) {
          dataFile.mkdirs();
          JOptionPane.showMessageDialog(mainWindow,"String_Node_Str");
        }
 else {
          File[] files=dataFile.listFiles();
          List<File> groups=new ArrayList<File>();
          for (          File file : files) {
            if (file.isDirectory()) {
              groups.add(file);
            }
          }
          if (groups.size() > 0) {
            new GroupWindow(groups,mainWindow);
          }
 else {
            JOptionPane.showMessageDialog(mainWindow,"String_Node_Str");
          }
        }
      }
    }
  }
);
}
Program: 81632
Project: 81632
Buggy source:
public void doWork(Window window,MouseEvent e){
  new AddGroupDialog((JFrame)window);
}

Fixed version (ground truth):
public void doWork(Window window,MouseEvent e){
  new AddGroupDialog((GroupWindow)window,mainWindow);
}
Program: 81633
Project: 81633
Buggy source:
public GroupWindow(List<File> groups,EgDownloaderWindow mainWindow){
  super(Version.NAME + "String_Node_Str");
  this.mainWindow=mainWindow;
  this.setSize(300,400);
  this.setResizable(false);
  this.setIconImage(new ImageIcon(getClass().getResource(ComponentConst.ICON_PATH + ComponentConst.SKIN_NUM + ComponentConst.SKIN_ICON.get("String_Node_Str"))).getImage());
  this.setLocationRelativeTo(null);
  this.getContentPane().setLayout(null);
  this.setDefaultCloseOperation(mainWindow == null ? EXIT_ON_CLOSE : DISPOSE_ON_CLOSE);
  JLabel tipLabel=new AJLabel("String_Node_Str",new Color(67,44,1),15,15,100,30);
  JButton addGroupBtn=new AJButton("String_Node_Str","String_Node_Str",ComponentConst.SKIN_NUM + ComponentConst.SKIN_ICON.get("String_Node_Str"),new OperaBtnMouseListener(this,MouseAction.CLICK,new IListenerTask(){
    public void doWork(    Window window,    MouseEvent e){
      new AddGroupDialog((JFrame)window);
    }
  }
),215,15,62,30);
  addGroupBtn.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.blue));
  JList list=new GroupList(groups,this,mainWindow);
  list.setSelectedIndex(0);
  JScrollPane listPane=new JScrollPane(list);
  listPane.setBounds(new Rectangle(10,50,270,300));
  listPane.setAutoscrolls(true);
  listPane.getViewport().setBackground(new Color(254,254,254));
  ComponentUtil.addComponents(this.getContentPane(),tipLabel,addGroupBtn,listPane);
  this.setVisible(true);
}

Fixed version (ground truth):
public GroupWindow(List<File> groups,final EgDownloaderWindow mainWindow){
  super(Version.NAME + "String_Node_Str");
  this.mainWindow=mainWindow;
  this.setSize(300,400);
  this.setResizable(false);
  this.setIconImage(new ImageIcon(getClass().getResource(ComponentConst.ICON_PATH + ComponentConst.SKIN_NUM + ComponentConst.SKIN_ICON.get("String_Node_Str"))).getImage());
  this.setLocationRelativeTo(null);
  this.getContentPane().setLayout(null);
  this.setDefaultCloseOperation(mainWindow == null ? EXIT_ON_CLOSE : DISPOSE_ON_CLOSE);
  JLabel tipLabel=new AJLabel("String_Node_Str",new Color(67,44,1),15,15,100,30);
  JButton addGroupBtn=new AJButton("String_Node_Str","String_Node_Str",ComponentConst.SKIN_NUM + ComponentConst.SKIN_ICON.get("String_Node_Str"),new OperaBtnMouseListener(this,MouseAction.CLICK,new IListenerTask(){
    public void doWork(    Window window,    MouseEvent e){
      new AddGroupDialog((GroupWindow)window,mainWindow);
    }
  }
),215,15,62,30);
  addGroupBtn.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.blue));
  JList list=new GroupList(groups,this,mainWindow);
  list.setSelectedIndex(0);
  JScrollPane listPane=new JScrollPane(list);
  listPane.setBounds(new Rectangle(10,50,270,300));
  listPane.setAutoscrolls(true);
  listPane.getViewport().setBackground(new Color(254,254,254));
  ComponentUtil.addComponents(this.getContentPane(),tipLabel,addGroupBtn,listPane);
  this.setVisible(true);
}
Program: 81635
Project: 81635
Buggy source:
public void doWork(Window dialog,MouseEvent event){
  AddGroupDialog addGroupDialog=(AddGroupDialog)dialog;
  String groupName=groupNameField.getText().trim();
  if ("String_Node_Str".equals(groupName)) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
 else   if (!FileUtil.dirValidate(groupName)) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
 else {
    if (window instanceof EgDownloaderWindow) {
      EgDownloaderWindow mainWindow=(EgDownloaderWindow)window;
      mainWindow.saveTaskGroupData();
      mainWindow.dispose();
    }
 else {
      window.dispose();
    }
    ComponentConst.groupName=groupName;
    ComponentConst.changeDataPath(groupName);
    ComponentConst.changeDataXmlPath();
    addGroupDialog.dispose();
    if (window instanceof EgDownloaderWindow) {
      FileUtil.ifNotExistsThenCreate(ComponentConst.getXmlDirPath());
      SettingDom4jDbTemplate.updateDom();
      TaskDom4jDbTemplate.updateDom();
      PictureDom4jDbTemplate.updateDom();
    }
    new InitWindow();
  }
}

Fixed version (ground truth):
public void doWork(Window dialog,MouseEvent event){
  AddGroupDialog addGroupDialog=(AddGroupDialog)dialog;
  String groupName=groupNameField.getText().trim();
  if ("String_Node_Str".equals(groupName)) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
 else   if (!FileUtil.dirValidate(groupName)) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
 else {
    FileUtil.ifNotExistsThenCreate(ComponentConst.ROOT_DATA_PATH);
    File dataFile=new File(ComponentConst.ROOT_DATA_PATH);
    for (    File file : dataFile.listFiles()) {
      if (file.getName().equals(groupName)) {
        JOptionPane.showMessageDialog(null,"String_Node_Str");
        return;
      }
    }
    if (mainWindow != null) {
      mainWindow.saveTaskGroupData();
      mainWindow.dispose();
    }
    ComponentConst.groupName=groupName;
    ComponentConst.changeDataPath(groupName);
    ComponentConst.changeDataXmlPath();
    addGroupDialog.dispose();
    if (mainWindow != null) {
      FileUtil.ifNotExistsThenCreate(ComponentConst.getXmlDirPath());
      SettingDom4jDbTemplate.updateDom();
      TaskDom4jDbTemplate.updateDom();
      PictureDom4jDbTemplate.updateDom();
    }
    if (window != null) {
      window.dispose();
    }
    new InitWindow();
  }
}
Program: 81639
Project: 81639
Buggy source:
public void mouseClicked(MouseEvent me){
  int clickNum=me.getClickCount();
  GroupList list=(GroupList)me.getSource();
  if (me.getButton() == MouseEvent.BUTTON1) {
    if (2 == clickNum) {
      String groupName="String_Node_Str";
      if (list.getSelectedIndex() != 0) {
        groupName=list.getSelectedValue().toString();
        if (groupName.indexOf("String_Node_Str") != -1) {
          groupName=groupName.substring(groupName.indexOf("String_Node_Str") + 1,groupName.length()).trim();
        }
      }
      if (mainWindow != null && groupName.equals(ComponentConst.groupName)) {
        window.dispose();
        return;
      }
      if (mainWindow != null) {
        mainWindow.saveTaskGroupData();
        mainWindow.dispose();
      }
      ComponentConst.groupName=groupName;
      ComponentConst.changeDataPath(groupName);
      ComponentConst.changeDataXmlPath();
      window.dispose();
      if (mainWindow != null) {
        SettingDom4jDbTemplate.updateDom();
        TaskDom4jDbTemplate.updateDom();
        PictureDom4jDbTemplate.updateDom();
      }
      new InitWindow();
    }
  }
 else   if (me.getButton() == MouseEvent.BUTTON3) {
    int rowIndex=list.locationToIndex(me.getPoint());
    list.getSelectionModel().setSelectionInterval(rowIndex,rowIndex);
    if (popupMenu == null) {
      popupMenu=new AJPopupMenu(deleteMenu);
    }
    popupMenu.show(list,me.getPoint().x,me.getPoint().y);
  }
}

Fixed version (ground truth):
public void mouseClicked(MouseEvent me){
  int clickNum=me.getClickCount();
  GroupList list=(GroupList)me.getSource();
  if (me.getButton() == MouseEvent.BUTTON1) {
    if (2 == clickNum) {
      String groupName="String_Node_Str";
      if (list.getSelectedIndex() != 0) {
        groupName=list.getSelectedValue().toString();
        if (groupName.indexOf("String_Node_Str") != -1) {
          groupName=groupName.substring(groupName.indexOf("String_Node_Str") + 1,groupName.length()).trim();
        }
      }
      if (mainWindow != null && groupName.equals(ComponentConst.groupName)) {
        window.dispose();
        return;
      }
      if (mainWindow != null) {
        mainWindow.saveTaskGroupData();
        mainWindow.dispose();
      }
      ComponentConst.groupName=groupName;
      ComponentConst.changeDataPath(groupName);
      ComponentConst.changeDataXmlPath();
      window.dispose();
      if (mainWindow != null) {
        SettingDom4jDbTemplate.updateDom();
        TaskDom4jDbTemplate.updateDom();
        PictureDom4jDbTemplate.updateDom();
      }
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          new InitWindow();
        }
      }
);
    }
  }
 else   if (me.getButton() == MouseEvent.BUTTON3) {
    int rowIndex=list.locationToIndex(me.getPoint());
    list.getSelectionModel().setSelectionInterval(rowIndex,rowIndex);
    if (popupMenu == null) {
      popupMenu=new AJPopupMenu(deleteMenu);
    }
    popupMenu.show(list,me.getPoint().x,me.getPoint().y);
  }
}
Program: 81644
Project: 81644
Buggy source:
public void doWork(Window dialog,MouseEvent event){
  AddGroupDialog addGroupDialog=(AddGroupDialog)dialog;
  String groupName=groupNameField.getText().trim();
  if ("String_Node_Str".equals(groupName)) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
 else   if (!FileUtil.dirValidate(groupName)) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
 else {
    FileUtil.ifNotExistsThenCreate(ComponentConst.ROOT_DATA_PATH);
    File dataFile=new File(ComponentConst.ROOT_DATA_PATH);
    for (    File file : dataFile.listFiles()) {
      if (file.getName().equals(groupName)) {
        JOptionPane.showMessageDialog(null,"String_Node_Str");
        return;
      }
    }
    if (mainWindow != null) {
      mainWindow.saveTaskGroupData();
      mainWindow.dispose();
    }
    ComponentConst.groupName=groupName;
    ComponentConst.changeDataPath(groupName);
    ComponentConst.changeDataXmlPath();
    addGroupDialog.dispose();
    if (mainWindow != null) {
      FileUtil.ifNotExistsThenCreate(ComponentConst.getXmlDirPath());
      SettingDom4jDbTemplate.updateDom();
      TaskDom4jDbTemplate.updateDom();
      PictureDom4jDbTemplate.updateDom();
    }
    if (window != null) {
      window.dispose();
    }
    new InitWindow();
  }
}

Fixed version (ground truth):
public void doWork(Window dialog,MouseEvent event){
  AddGroupDialog addGroupDialog=(AddGroupDialog)dialog;
  String groupName=groupNameField.getText().trim();
  if ("String_Node_Str".equals(groupName)) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
 else   if (!FileUtil.dirValidate(groupName)) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
 else {
    FileUtil.ifNotExistsThenCreate(ComponentConst.ROOT_DATA_PATH);
    File dataFile=new File(ComponentConst.ROOT_DATA_PATH);
    for (    File file : dataFile.listFiles()) {
      if (file.getName().equals(groupName)) {
        JOptionPane.showMessageDialog(null,"String_Node_Str");
        return;
      }
    }
    if (mainWindow != null) {
      mainWindow.saveTaskGroupData();
    }
    ComponentConst.groupName=groupName;
    ComponentConst.changeDataPath(groupName);
    ComponentConst.changeDataXmlPath();
    if (mainWindow != null) {
      FileUtil.ifNotExistsThenCreate(ComponentConst.getXmlDirPath());
      SettingDom4jDbTemplate.updateDom();
      TaskDom4jDbTemplate.updateDom();
      PictureDom4jDbTemplate.updateDom();
      mainWindow.dispose();
    }
    if (window != null) {
      window.dispose();
    }
    addGroupDialog.dispose();
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        new InitWindow();
      }
    }
);
  }
}
Program: 81646
Project: 81646
Buggy source:
public DeletingWindow(JFrame window){
  this.mainWindow=window;
  this.setTitle("String_Node_Str");
  this.setSize(400,120);
  this.setLayout(null);
  this.setResizable(false);
  this.setLocationRelativeTo(this.mainWindow);
  this.setBackground(Color.WHITE);
  this.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      DeletingWindow window=(DeletingWindow)e.getSource();
      window.mainWindow.setEnabled(true);
      window.mainWindow.setVisible(true);
      window.dispose();
    }
    public void windowActivated(    WindowEvent e){
      mainWindow.setEnabled(false);
    }
  }
);
  dataLabel=new AJLabel("String_Node_Str",Color.BLACK,160,10,80,30);
  infoLabel=new AJLabel("String_Node_Str",Color.BLACK,10,50,380,30);
  ComponentUtil.addComponents(getContentPane(),dataLabel,infoLabel);
}

Fixed version (ground truth):
public DeletingWindow(JFrame window){
  this.mainWindow=window;
  this.setTitle("String_Node_Str");
  this.setSize(400,120);
  this.setLayout(null);
  this.setResizable(false);
  this.setLocationRelativeTo(this.mainWindow);
  this.setBackground(Color.WHITE);
  this.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      DeletingWindow window=(DeletingWindow)e.getSource();
      window.mainWindow.setEnabled(true);
      window.mainWindow.setVisible(true);
      window.dispose();
    }
  }
);
  dataLabel=new AJLabel("String_Node_Str",Color.BLACK,160,10,80,30);
  infoLabel=new AJLabel("String_Node_Str",Color.BLACK,10,50,380,30);
  ComponentUtil.addComponents(getContentPane(),dataLabel,infoLabel);
}
Program: 81647
Project: 81647
Buggy source:
public static File getCollectScriptFile(String filePath){
  return collectScriptFile == null ? new File(filePath) : collectScriptFile;
}

Fixed version (ground truth):
public static File getCollectScriptFile(String filePath){
  return collectScriptFile == null ? collectScriptFile=new File(filePath) : collectScriptFile;
}
Program: 81648
Project: 81648
Buggy source:
public static File getCreateScriptFile(String filePath){
  return createScriptFile == null ? new File(filePath) : createScriptFile;
}

Fixed version (ground truth):
public static File getCreateScriptFile(String filePath){
  return createScriptFile == null ? createScriptFile=new File(filePath) : createScriptFile;
}
Program: 81649
Project: 81649
Buggy source:
public static File getDownloadScriptFile(String filePath){
  return downloadScriptFile == null ? new File(filePath) : downloadScriptFile;
}

Fixed version (ground truth):
public static File getDownloadScriptFile(String filePath){
  return downloadScriptFile == null ? downloadScriptFile=new File(filePath) : downloadScriptFile;
}
Program: 81650
Project: 81650
Buggy source:
public static void main(String[] args){
  for (int i=0; i < FontConst.DEFAULT_FONT.length; i++)   UIManager.put(FontConst.DEFAULT_FONT[i],new Font("String_Node_Str",Font.BOLD,14));
  try {
    BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
    BeautyEyeLNFHelper.launchBeautyEyeLNF();
    UIManager.put("String_Node_Str",false);
  }
 catch (  Exception e) {
  }
  new InitWindow();
}

Fixed version (ground truth):
public static void main(String[] args){
  for (int i=0; i < FontConst.DEFAULT_FONT.length; i++)   UIManager.put(FontConst.DEFAULT_FONT[i],new Font("String_Node_Str",Font.BOLD,12));
  try {
    BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
    BeautyEyeLNFHelper.launchBeautyEyeLNF();
    UIManager.put("String_Node_Str",false);
  }
 catch (  Exception e) {
  }
  new InitWindow();
}
Program: 81651
Project: 81651
Buggy source:
/** 
 * 添加排队等待的任务
 * @param task
 */
public void addWaitingTask(Task task){
  if (waitingTasks == null) {
    waitingTasks=new ArrayList<Task>();
  }
  if (!waitingTasks.contains(task)) {
    task.setStatus(TaskStatus.WAITING);
    waitingTasks.add(task);
  }
}

Fixed version (ground truth):
/** 
 * 添加排队等待的任务
 * @param task
 */
public void addWaitingTask(Task task){
  if (waitingTasks == null) {
    waitingTasks=new ArrayList<Task>();
  }
  if (!waitingTasks.contains(task)) {
    task.setStatus(TaskStatus.WAITING);
    waitingTasks.add(task);
  }
  this.updateUI();
}
Program: 81652
Project: 81652
Buggy source:
/** 
 * 开启任务下载
 * @param task 
 * @return void
 */
public void startTask(Task task){
  task.setStatus(TaskStatus.STARTED);
  task.setDownloadWorker(new DownloadWorker(task,this.getMainWindow()));
  task.getDownloadWorker().execute();
  this.setRunningNum(this.getRunningNum() + 1);
}

Fixed version (ground truth):
/** 
 * 开启任务下载
 * @param task 
 * @return void
 */
public void startTask(Task task){
  task.setStatus(TaskStatus.STARTED);
  if (task.getPictures() == null || task.getPictures().size() == 0) {
    task.setReCreateWorker(new ReCreateWorker(task,this.getMainWindow()));
    task.getReCreateWorker().execute();
  }
 else {
    task.setDownloadWorker(new DownloadWorker(task,this.getMainWindow()));
    task.getDownloadWorker().execute();
  }
  this.setRunningNum(this.getRunningNum() + 1);
  this.updateUI();
}
Program: 81653
Project: 81653
Buggy source:
public void actionPerformed(ActionEvent ae){
  TaskingTable table=(TaskingTable)window.runningTable;
  List<Task> tasks=table.getTasks();
  Task task=null;
  for (int i=0; i < tasks.size(); i++) {
    if (tasks.get(i).getStatus() == TaskStatus.STARTED || tasks.get(i).getStatus() == TaskStatus.WAITING) {
      task=tasks.get(i);
      task.setStatus(TaskStatus.STOPED);
      if (task.getDownloadWorker() != null) {
        task.getDownloadWorker().cancel(true);
        task.setDownloadWorker(null);
        window.taskDbTemplate.update(task);
      }
    }
  }
  table.getWaitingTasks().clear();
  table.setRunningNum(0);
  table.updateUI();
  Tracker.println(getClass(),"String_Node_Str");
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent ae){
  TaskingTable table=(TaskingTable)window.runningTable;
  List<Task> tasks=table.getTasks();
  Task task=null;
  for (int i=0; i < tasks.size(); i++) {
    if (tasks.get(i).getStatus() == TaskStatus.STARTED || tasks.get(i).getStatus() == TaskStatus.WAITING) {
      task=tasks.get(i);
      task.setStatus(TaskStatus.STOPED);
      if (task.getDownloadWorker() != null) {
        task.getDownloadWorker().cancel(true);
        task.setDownloadWorker(null);
        window.taskDbTemplate.update(task);
      }
    }
  }
  if (table.getWaitingTasks() != null) {
    table.getWaitingTasks().clear();
  }
  table.setRunningNum(0);
  table.updateUI();
  Tracker.println(getClass(),"String_Node_Str");
}
Program: 81654
Project: 81654
Buggy source:
public StopAllTaskMenuItem(String text,final EgDownloaderWindow window){
  super(text);
  this.setForeground(new Color(0,0,85));
  this.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent ae){
      TaskingTable table=(TaskingTable)window.runningTable;
      List<Task> tasks=table.getTasks();
      Task task=null;
      for (int i=0; i < tasks.size(); i++) {
        if (tasks.get(i).getStatus() == TaskStatus.STARTED || tasks.get(i).getStatus() == TaskStatus.WAITING) {
          task=tasks.get(i);
          task.setStatus(TaskStatus.STOPED);
          if (task.getDownloadWorker() != null) {
            task.getDownloadWorker().cancel(true);
            task.setDownloadWorker(null);
            window.taskDbTemplate.update(task);
          }
        }
      }
      table.getWaitingTasks().clear();
      table.setRunningNum(0);
      table.updateUI();
      Tracker.println(getClass(),"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
public StopAllTaskMenuItem(String text,final EgDownloaderWindow window){
  super(text);
  this.setForeground(new Color(0,0,85));
  this.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent ae){
      TaskingTable table=(TaskingTable)window.runningTable;
      List<Task> tasks=table.getTasks();
      Task task=null;
      for (int i=0; i < tasks.size(); i++) {
        if (tasks.get(i).getStatus() == TaskStatus.STARTED || tasks.get(i).getStatus() == TaskStatus.WAITING) {
          task=tasks.get(i);
          task.setStatus(TaskStatus.STOPED);
          if (task.getDownloadWorker() != null) {
            task.getDownloadWorker().cancel(true);
            task.setDownloadWorker(null);
            window.taskDbTemplate.update(task);
          }
        }
      }
      if (table.getWaitingTasks() != null) {
        table.getWaitingTasks().clear();
      }
      table.setRunningNum(0);
      table.updateUI();
      Tracker.println(getClass(),"String_Node_Str");
    }
  }
);
}