nus-yam/ex-repair huggingface dataset:
Program: 138827
Project: 138827
Buggy source:
protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  if (ResourcesPlugin.getWorkspace().isTreeLocked()) {
    return connList;
  }
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_CONNECTIONS,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      if (!(item instanceof FolderItem)) {
        DatabaseConnection connection=(DatabaseConnection)((DatabaseConnectionItem)item).getConnection();
        register(connection,reposViewObj);
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}

Fixed version (ground truth):
protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_CONNECTIONS,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      if (!(item instanceof FolderItem)) {
        DatabaseConnection connection=(DatabaseConnection)((DatabaseConnectionItem)item).getConnection();
        register(connection,reposViewObj);
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}
Program: 138828
Project: 138828
Buggy source:
@Override protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  if (ResourcesPlugin.getWorkspace().isTreeLocked()) {
    return connList;
  }
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_MDMCONNECTION,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      MDMConnection connection=(MDMConnection)((MDMConnectionItem)item).getConnection();
      register(connection,reposViewObj);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}

Fixed version (ground truth):
@Override protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_MDMCONNECTION,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      MDMConnection connection=(MDMConnection)((MDMConnectionItem)item).getConnection();
      register(connection,reposViewObj);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}
Program: 138830
Project: 138830
Buggy source:
public IndicatorCheckedTreeSelectionDialog(Shell parent,ILabelProvider labelProvider,ITreeContentProvider contentProvider){
  super(parent,labelProvider,contentProvider);
  addFilter(new DQFolderFliter(true));
}

Fixed version (ground truth):
public IndicatorCheckedTreeSelectionDialog(Shell parent,ILabelProvider labelProvider,ITreeContentProvider contentProvider){
  super(parent,labelProvider,contentProvider);
  addFilter(new DQFolderFliter(true));
  addFilter(new RecycleBinFilter());
}
Program: 138832
Project: 138832
Buggy source:
/** 
 * DOC bZhou Comment method "doMigrationTask".
 * @param tasks
 * @param monitor
 */
public static void doMigrationTask(List<IMigrationTask> tasks,IProgressMonitor monitor){
  monitor.beginTask("String_Node_Str",tasks.size());
  for (  IMigrationTask task : tasks) {
    if (monitor.isCanceled()) {
      break;
    }
    monitor.subTask(task.getName());
    if (task.valid()) {
      if (!task.execute()) {
        log.warn("String_Node_Str" + task.getName());
      }
 else {
        log.info("String_Node_Str" + task.getName());
        System.out.println("String_Node_Str" + task.getName());
      }
    }
    monitor.worked(1);
  }
  monitor.done();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "doMigrationTask".
 * @param tasks
 * @param monitor
 */
public static void doMigrationTask(List<IMigrationTask> tasks,IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  monitor.beginTask("String_Node_Str",tasks.size());
  for (  IMigrationTask task : tasks) {
    if (monitor.isCanceled()) {
      break;
    }
    monitor.subTask(task.getName());
    if (task.valid()) {
      if (!task.execute()) {
        log.warn("String_Node_Str" + task.getName());
      }
 else {
        log.info("String_Node_Str" + task.getName());
        System.out.println("String_Node_Str" + task.getName());
      }
    }
    monitor.worked(1);
  }
  monitor.done();
}
Program: 138833
Project: 138833
Buggy source:
public void migration(IProgressMonitor monitor){
  List<IMigrationTask> modelTasks=new ArrayList<IMigrationTask>();
  if (versionFile != null && versionFile.exists()) {
    ProductVersion version=WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
    Iterator<IMigrationTask> it=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version).iterator();
    while (it.hasNext()) {
      IMigrationTask task=it.next();
      if (isModelTask(task)) {
        ((AbstractWorksapceUpdateTask)task).setWorkspacePath(basePath);
        modelTasks.add(task);
      }
 else {
        commonTasks.add(task);
      }
    }
  }
  if (!modelTasks.isEmpty()) {
    if (monitor == null) {
      monitor=new NullProgressMonitor();
    }
    MigrationTaskManager.doMigrationTask(modelTasks,monitor);
    WorkspaceVersionHelper.storeVersion(versionFile);
  }
}

Fixed version (ground truth):
public void migration(IProgressMonitor monitor){
  List<IMigrationTask> modelTasks=new ArrayList<IMigrationTask>();
  if (versionFile != null && versionFile.exists()) {
    ProductVersion version=WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
    Iterator<IMigrationTask> it=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version).iterator();
    while (it.hasNext()) {
      IMigrationTask task=it.next();
      if (isModelTask(task)) {
        ((AbstractWorksapceUpdateTask)task).setWorkspacePath(basePath);
        modelTasks.add(task);
      }
 else {
        commonTasks.add(task);
      }
    }
  }
  if (!modelTasks.isEmpty()) {
    MigrationTaskManager.doMigrationTask(modelTasks,monitor);
    WorkspaceVersionHelper.storeVersion(versionFile);
  }
}
Program: 138834
Project: 138834
Buggy source:
/** 
 * DOC bZhou Comment method "isTOPFile".
 * @param file
 * @return
 */
private boolean isValidDirectory(File file){
  String absolutePath=file.getAbsolutePath();
  boolean tdqProject=false;
  File[] listFiles=file.listFiles();
  if (listFiles != null) {
    for (    File afile : listFiles) {
      if (StringUtils.equals(afile.getName(),"String_Node_Str")) {
        tdqProject=true;
        break;
      }
    }
  }
  return (absolutePath.indexOf(EResourceConstant.DATA_PROFILING.getName()) > 0 || absolutePath.indexOf(EResourceConstant.LIBRARIES.getName()) > 0 || absolutePath.indexOf(EResourceConstant.METADATA.getName()) > 0 || absolutePath.indexOf("String_Node_Str") > 0 || StringUtils.equals(file.getName(),ReponsitoryContextBridge.PROJECT_DEFAULT_NAME) || tdqProject) && !file.getName().startsWith("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isTOPFile".
 * @param file
 * @return
 */
private boolean isValidDirectory(File file){
  if (!file.getName().startsWith("String_Node_Str")) {
    String absolutePath=file.getAbsolutePath();
    for (    EResourceConstant constant : EResourceConstant.getTopConstants()) {
      if (absolutePath.indexOf(constant.getPath()) > 0) {
        return true;
      }
    }
  }
  return false;
}
Program: 138835
Project: 138835
Buggy source:
/** 
 * DOC bZhou Comment method "create".
 * @param element
 * @param file
 * @param withProperty
 * @return
 */
public ReturnCode create(ModelElement element,IFile file,boolean withProperty){
  ReturnCode rc=new ReturnCode();
  if (!check(file)) {
    rc.setReturnCode("String_Node_Str",false);
  }
 else {
    IPath itemPath=file.getFullPath();
    IPath propPath=itemPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
    if (withProperty) {
      Property property=createProperty(element,propPath);
      if (property.getItem() instanceof TDQItem) {
        ((TDQItem)property.getItem()).setFilename(file.getName());
        saveProperty(property);
      }
    }
    if (!util.addEObjectToResourceSet(itemPath.toString(),element)) {
      rc.setReturnCode("String_Node_Str" + util.getLastErrorMessage(),false);
    }
 else {
      if (element instanceof RenderedObject) {
        ((RenderedObject)element).setFileName(itemPath.toString());
      }
      rc=save(element);
    }
  }
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "create".
 * @param element
 * @param file
 * @param withProperty
 * @return
 */
public ReturnCode create(ModelElement element,IFile file,boolean withProperty){
  ReturnCode rc=new ReturnCode();
  if (!check(file)) {
    rc.setReturnCode("String_Node_Str",false);
  }
 else {
    IPath itemPath=file.getFullPath();
    IPath propPath=itemPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
    if (withProperty) {
      Property property=createProperty(element,propPath,file.getName());
    }
    if (!util.addEObjectToResourceSet(itemPath.toString(),element)) {
      rc.setReturnCode("String_Node_Str" + util.getLastErrorMessage(),false);
    }
 else {
      if (element instanceof RenderedObject) {
        ((RenderedObject)element).setFileName(itemPath.toString());
      }
      rc=save(element);
    }
  }
  return rc;
}
Program: 138836
Project: 138836
Buggy source:
/** 
 * DOC Zqin Comment method "showSelectedElements".MOD 2009-01-07 mzhao.
 * @param newTree
 */
private void showSelectedElements(Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  DQRespositoryView dqview=CorePlugin.getDefault().getRepositoryView();
  if (selection.length == 1) {
    try {
      ModelElementIndicator meIndicator=(ModelElementIndicator)selection[0].getData(AbstractColumnDropTree.MODELELEMENT_INDICATOR_KEY);
      ModelElement me=meIndicator.getModelElement();
      CorePlugin.getDefault().refreshDQView();
      dqview.showSelectedElements(me);
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC Zqin Comment method "showSelectedElements".MOD 2009-01-07 mzhao.
 * @param newTree
 */
private void showSelectedElements(Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  DQRespositoryView dqview=CorePlugin.getDefault().getRepositoryView();
  if (selection.length == 1) {
    try {
      ModelElementIndicator meIndicator=(ModelElementIndicator)selection[0].getData(AbstractColumnDropTree.MODELELEMENT_INDICATOR_KEY);
      ModelElement me=meIndicator.getModelElement();
      dqview.showSelectedElements(me);
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
}
Program: 138837
Project: 138837
Buggy source:
/** 
 * DOC Zqin Comment method "showSelectedElements". MOD 2009-01-07 mzhao for feature:0005664
 * @param newTree
 */
public void showSelectedElements(Object selectedElement){
  try {
    getCommonViewer().refresh();
    StructuredSelection structSel=new StructuredSelection(selectedElement);
    getCommonViewer().setSelection(structSel);
    StructuredSelection selectionTarge=(StructuredSelection)getCommonViewer().getSelection();
    if (!selectionTarge.equals(structSel)) {
      recursiveExpandTree(selectedElement);
      getCommonViewer().setSelection(structSel);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
/** 
 * DOC Zqin Comment method "showSelectedElements". MOD 2009-01-07 mzhao for feature:0005664
 * @param newTree
 */
public void showSelectedElements(Object selectedElement){
  try {
    StructuredSelection structSel=new StructuredSelection(selectedElement);
    getCommonViewer().setSelection(structSel);
    StructuredSelection selectionTarge=(StructuredSelection)getCommonViewer().getSelection();
    if (!selectionTarge.equals(structSel)) {
      getCommonViewer().refresh();
      recursiveExpandTree(selectedElement);
      getCommonViewer().setSelection(structSel);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 138838
Project: 138838
Buggy source:
public Object getParent(Object element){
  if (element instanceof IFile) {
    return ((IResource)element).getParent();
  }
  Object returnObj=super.getParent(element);
  return returnObj;
}

Fixed version (ground truth):
public Object getParent(Object element){
  if (element instanceof IFile) {
    return ((IResource)element).getParent();
  }
 else   if (element instanceof IRepositoryViewObject) {
    Item item=((IRepositoryViewObject)element).getProperty().getItem();
    if (item instanceof DatabaseConnectionItem) {
      return ResourceManager.getConnectionFolder();
    }
 else     if (item instanceof MDMConnectionItem) {
      return ResourceManager.getMDMConnectionFolder();
    }
  }
  Object returnObj=super.getParent(element);
  if (returnObj instanceof CwmResource) {
    for (    EObject conn : ((CwmResource)returnObj).getContents()) {
      if (conn instanceof Connection) {
        IRepositoryViewObject repObjec=ProxyRepositoryViewObject.getRepositoryViewObject((Connection)conn);
        if (repObjec == null) {
          break;
        }
        return repObjec;
      }
    }
  }
 else   if (returnObj == null && element instanceof PackageImpl && ((PackageImpl)element).getDataManager().size() > 0) {
    for (    EObject conn : ((PackageImpl)element).getDataManager()) {
      if (conn instanceof Connection) {
        IRepositoryViewObject repObjec=ProxyRepositoryViewObject.getRepositoryViewObject((Connection)conn);
        if (repObjec == null) {
          break;
        }
        return repObjec;
      }
    }
  }
  return returnObj;
}
Program: 138839
Project: 138839
Buggy source:
/** 
 * DOC mzhao Get all database connections.
 * @return
 */
public static List<Connection> getAllDatabaseConnections(){
  List<Connection> metadataConns=new ArrayList<Connection>();
  metadataConns.addAll(getDBConnectionInstance().getAllElements());
  return metadataConns;
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "getAllDatabaseConnections".
 * @param excludeRecycleBin
 * @return
 */
public static List<Connection> getAllDatabaseConnections(boolean excludeRecycleBin){
  List<Connection> connections=new ArrayList<Connection>();
  if (excludeRecycleBin) {
    for (    Connection con : getAllDatabaseConnections()) {
      if (null != con.eResource() && !PropertyHelper.getProperty(con).getItem().getState().isDeleted()) {
        connections.add(con);
      }
    }
  }
  return connections;
}
Program: 138840
Project: 138840
Buggy source:
/** 
 * DOC mzhao Get all mdm connections.
 * @return
 */
public static List<Connection> getAllMDMConnections(){
  List<Connection> metadataConns=new ArrayList<Connection>();
  metadataConns.addAll(getMDMConnectionInstance().getAllElements());
  return metadataConns;
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "getAllDatabaseConnections".
 * @param excludeRecycleBin
 * @return
 */
public static List<Connection> getAllMDMConnections(boolean excludeRecycleBin){
  List<Connection> connections=new ArrayList<Connection>();
  if (excludeRecycleBin) {
    for (    Connection con : getAllMDMConnections()) {
      if (null != con.eResource() && !PropertyHelper.getProperty(con).getItem().getState().isDeleted()) {
        connections.add(con);
      }
    }
  }
  return connections;
}
Program: 138841
Project: 138841
Buggy source:
protected void reloadDataproviderAndFillConnCombo(){
  Collection<Connection> connections=ProxyRepositoryViewObject.getAllDatabaseConnections();
  Collection<Connection> mdmConne=ProxyRepositoryViewObject.getAllMDMConnections();
  connections.addAll(mdmConne);
  int index=0;
  connCombo.removeAll();
  for (  Connection prov : connections) {
    connCombo.add(prov.getName(),index);
    connCombo.setData(prov.getName(),index);
    connCombo.setData(index + "String_Node_Str",prov);
    index++;
  }
  if (index > 0) {
    connCombo.select(0);
  }
}

Fixed version (ground truth):
protected void reloadDataproviderAndFillConnCombo(){
  Collection<Connection> connections=ProxyRepositoryViewObject.getAllDatabaseConnections(true);
  Collection<Connection> mdmConne=ProxyRepositoryViewObject.getAllMDMConnections(true);
  connections.addAll(mdmConne);
  int index=0;
  connCombo.removeAll();
  for (  Connection prov : connections) {
    connCombo.add(prov.getName(),index);
    connCombo.setData(prov.getName(),index);
    connCombo.setData(index + "String_Node_Str",prov);
    index++;
  }
  if (index > 0) {
    connCombo.select(0);
  }
}
Program: 138842
Project: 138842
Buggy source:
/** 
 * Method "getColumns".
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @param columnPattern a column name pattern; must match the column name as it is stored in the database
 * @throws SQLException
 * @see DatabaseMetaData#getColumns(String,String,String,String)
 */
public List<TdColumn> getColumns(String catalogName,String schemaPattern,String tablePattern,String columnPattern) throws SQLException {
  List<TdColumn> tableColumns=new ArrayList<TdColumn>();
  ResultSet columns=getConnectionMetadata(connection).getColumns(catalogName,schemaPattern,tablePattern,columnPattern);
  while (columns.next()) {
    TdColumn column=RelationalFactory.eINSTANCE.createTdColumn();
    tableColumns.add(TDColumnAttributeHelper.addColumnAttribute(columns,column));
  }
  columns.close();
  return tableColumns;
}

Fixed version (ground truth):
/** 
 * Method "getColumns".
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @param columnPattern a column name pattern; must match the column name as it is stored in the database
 * @throws SQLException
 * @see DatabaseMetaData#getColumns(String,String,String,String)
 */
public List<TdColumn> getColumns(String catalogName,String schemaPattern,String tablePattern,String columnPattern) throws SQLException {
  List<TdColumn> tableColumns=new ArrayList<TdColumn>();
  ResultSet columns=getConnectionMetadata(connection).getColumns(catalogName,schemaPattern,tablePattern,columnPattern);
  while (columns.next()) {
    TdColumn column=RelationalFactory.eINSTANCE.createTdColumn();
    tableColumns.add(TDColumnAttributeHelper.addColumnAttribute(columns,column,connection));
  }
  columns.close();
  return tableColumns;
}
Program: 138843
Project: 138843
Buggy source:
/** 
 * DOC zshen fetch repository view object all of under the path.
 * @param reload whether reload all of element
 * @param itemType the type of item which you want
 * @param path path of folder
 * @return
 */
public List<IRepositoryViewObject> fetchRepositoryViewObjectsByFolder(boolean reload,ERepositoryObjectType itemType,IPath path){
  if (reload) {
    fetchRepositoryViewObjectsLower();
  }
  List<IRepositoryViewObject> folderRepositoryObjectList=ProxyRepositoryFactory.getInstance().getMetadataByFolder(itemType,path);
  return folderRepositoryObjectList;
}

Fixed version (ground truth):
/** 
 * DOC zshen fetch repository view object all of under the path.
 * @param reload whether reload all of element
 * @param itemType the type of item which you want
 * @param path path of folder
 * @return
 */
public List<IRepositoryViewObject> fetchRepositoryViewObjectsByFolder(boolean reload,ERepositoryObjectType itemType,IPath path){
  if (reload) {
    fetchRepositoryViewObjectsLower();
  }
  List<IRepositoryViewObject> folderRepositoryObjectList=ProxyRepositoryFactory.getInstance().getMetadataByFolder(itemType,path);
  List<IRepositoryViewObject> returnList=new ArrayList<IRepositoryViewObject>();
  for (  IRepositoryViewObject newRepositoryObject : folderRepositoryObjectList) {
    returnList.add(this.getReposViewObjByProperty(newRepositoryObject.getProperty()));
  }
  return returnList;
}
Program: 138844
Project: 138844
Buggy source:
/** 
 * DOC bZhou Comment method "decorateCategoryPlot".
 * @param chart
 */
public static void decorateCategoryPlot(JFreeChart chart){
  CategoryPlot plot=chart.getCategoryPlot();
  CategoryItemRenderer render=plot.getRenderer();
  CategoryAxis domainAxis=plot.getDomainAxis();
  domainAxis.setCategoryMargin(0.01);
  ValueAxis valueAxis=plot.getRangeAxis();
  Font font=new Font("String_Node_Str",Font.BOLD,BASE_ITEM_LABEL_SIZE);
  render.setBaseItemLabelFont(font);
  font=new Font("String_Node_Str",Font.BOLD,BASE_LABEL_SIZE);
  domainAxis.setLabelFont(font);
  font=new Font("String_Node_Str",Font.BOLD,BASE_LABEL_SIZE);
  valueAxis.setLabelFont(font);
  font=new Font("String_Node_Str",Font.PLAIN,BASE_TICK_LABEL_SIZE);
  domainAxis.setTickLabelFont(font);
  valueAxis.setTickLabelFont(font);
  font=new Font("String_Node_Str",Font.PLAIN,BASE_LEGEND_LABEL_SIZE);
  LegendTitle legend=chart.getLegend();
  if (legend != null) {
    legend.setItemFont(font);
  }
  font=new Font("String_Node_Str",Font.BOLD,BASE_TITLE_LABEL_SIZE);
  TextTitle title=chart.getTitle();
  if (title != null) {
    title.setFont(font);
  }
  font=null;
  if (render instanceof BarRenderer) {
    int rowCount=chart.getCategoryPlot().getDataset().getRowCount();
    domainAxis.setTickLabelFont(new Font("String_Node_Str",Font.PLAIN,10));
    domainAxis.setUpperMargin(0.1);
    domainAxis.setMaximumCategoryLabelLines(10);
    ((BarRenderer)render).setItemMargin(-0.40 * rowCount);
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "decorateCategoryPlot".
 * @param chart
 */
public static void decorateCategoryPlot(JFreeChart chart){
  CategoryPlot plot=chart.getCategoryPlot();
  CategoryItemRenderer render=plot.getRenderer();
  CategoryAxis domainAxis=plot.getDomainAxis();
  domainAxis.setCategoryMargin(0.01);
  ValueAxis valueAxis=plot.getRangeAxis();
  Font font=new Font("String_Node_Str",Font.BOLD,BASE_ITEM_LABEL_SIZE);
  render.setBaseItemLabelFont(font);
  font=new Font("String_Node_Str",Font.BOLD,BASE_LABEL_SIZE);
  domainAxis.setLabelFont(font);
  font=new Font("String_Node_Str",Font.BOLD,BASE_LABEL_SIZE);
  valueAxis.setLabelFont(font);
  font=new Font("String_Node_Str",Font.PLAIN,BASE_TICK_LABEL_SIZE);
  domainAxis.setTickLabelFont(font);
  valueAxis.setTickLabelFont(font);
  font=new Font("String_Node_Str",Font.PLAIN,BASE_LEGEND_LABEL_SIZE);
  LegendTitle legend=chart.getLegend();
  if (legend != null) {
    legend.setItemFont(font);
  }
  font=new Font("String_Node_Str",Font.BOLD,BASE_TITLE_LABEL_SIZE);
  TextTitle title=chart.getTitle();
  if (title != null) {
    title.setFont(font);
  }
  font=null;
  if (render instanceof BarRenderer) {
    int rowCount=chart.getCategoryPlot().getDataset().getRowCount();
    if (!isContainsChineseColumn(chart))     domainAxis.setTickLabelFont(new Font("String_Node_Str",Font.PLAIN,10));
    domainAxis.setUpperMargin(0.1);
    domainAxis.setMaximumCategoryLabelLines(10);
    ((BarRenderer)render).setItemMargin(-0.40 * rowCount);
  }
}
Program: 138845
Project: 138845
Buggy source:
/** 
 * Method "getColumns".
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @param columnPattern a column name pattern; must match the column name as it is stored in the database
 * @throws SQLException
 * @see DatabaseMetaData#getColumns(String,String,String,String)
 */
public List<TdColumn> getColumns(String catalogName,String schemaPattern,String tablePattern,String columnPattern) throws SQLException {
  List<TdColumn> tableColumns=new ArrayList<TdColumn>();
  ResultSet columns=getConnectionMetadata(connection).getColumns(catalogName,schemaPattern,tablePattern,columnPattern);
  while (columns.next()) {
    TdColumn column=RelationalFactory.eINSTANCE.createTdColumn();
    tableColumns.add(TDColumnAttributeHelper.addColumnAttribute(columns,column,connection));
  }
  columns.close();
  return tableColumns;
}

Fixed version (ground truth):
/** 
 * Method "getColumns".
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @param columnPattern a column name pattern; must match the column name as it is stored in the database
 * @throws SQLException
 * @see DatabaseMetaData#getColumns(String,String,String,String)
 */
public List<TdColumn> getColumns(String catalogName,String schemaPattern,String tablePattern,String columnPattern) throws SQLException {
  List<TdColumn> tableColumns=new ArrayList<TdColumn>();
  ResultSet columns=getConnectionMetadata(connection).getColumns(catalogName,schemaPattern,tablePattern,columnPattern);
  while (columns.next()) {
    TdColumn column=RelationalFactory.eINSTANCE.createTdColumn();
    tableColumns.add(TDColumnAttributeHelper.addColumnAttribute(columns,column));
  }
  columns.close();
  return tableColumns;
}
Program: 138847
Project: 138847
Buggy source:
@Override public boolean canDrop(ModelElement modelElement){
  Connection tdProvider=ModelElementHelper.getTdDataProvider(modelElement);
  if (tdProvider == null) {
    return false;
  }
 else   if (this.getAnalysis().getContext().getConnection() != null && !tdProvider.equals(this.getAnalysis().getContext().getConnection())) {
    return false;
  }
  if (masterPage.isDirty()) {
    masterPage.doSave(new NullProgressMonitor());
    return false;
  }
  List<ModelElement> existModelElements=new ArrayList<ModelElement>();
  for (  ModelElementIndicator modelElementIndicator : this.getModelElementIndicator()) {
    existModelElements.add(modelElementIndicator.getModelElement());
  }
  if (modelElement instanceof TdTable) {
    return !existModelElements.containsAll(ColumnSetHelper.getColumns((TdTable)modelElement));
  }
  if (existModelElements.contains(modelElement)) {
    return false;
  }
  if (modelElement instanceof TdXmlElementType) {
    return XmlElementHelper.isLeafNode((TdXmlElementType)modelElement);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean canDrop(ModelElement modelElement){
  Connection tdProvider=ModelElementHelper.getTdDataProvider(modelElement);
  if (tdProvider == null) {
    return false;
  }
 else   if (this.getAnalysis().getContext().getConnection() != null && !ProxyRepositoryViewObject.areSame(tdProvider,this.getAnalysis().getContext().getConnection())) {
    return false;
  }
  if (masterPage.isDirty()) {
    masterPage.doSave(new NullProgressMonitor());
    return false;
  }
  List<ModelElement> existModelElements=new ArrayList<ModelElement>();
  for (  ModelElementIndicator modelElementIndicator : this.getModelElementIndicator()) {
    existModelElements.add(modelElementIndicator.getModelElement());
  }
  if (modelElement instanceof TdTable) {
    return !existModelElements.containsAll(ColumnSetHelper.getColumns((TdTable)modelElement));
  }
  if (existModelElements.contains(modelElement)) {
    return false;
  }
  if (modelElement instanceof TdXmlElementType) {
    return XmlElementHelper.isLeafNode((TdXmlElementType)modelElement);
  }
  return true;
}
Program: 138849
Project: 138849
Buggy source:
protected boolean isAccessWith(Connection dp){
  if (dataprovider == null) {
    dataprovider=dp;
    return true;
  }
  if (ResourceHelper.areSame(dataprovider,dp)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
protected boolean isAccessWith(Connection dp){
  if (dataprovider == null) {
    dataprovider=dp;
    return true;
  }
  if (ProxyRepositoryViewObject.areSame(dataprovider,dp)) {
    return true;
  }
  return false;
}
Program: 138850
Project: 138850
Buggy source:
protected boolean isAccessWith(Connection dp){
  if (dataprovider == null) {
    dataprovider=dp;
    return true;
  }
  if (ResourceHelper.areSame(dataprovider,dp)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
protected boolean isAccessWith(Connection dp){
  if (dataprovider == null) {
    dataprovider=dp;
    return true;
  }
  if (ProxyRepositoryViewObject.areSame(dataprovider,dp)) {
    return true;
  }
  return false;
}
Program: 138851
Project: 138851
Buggy source:
protected boolean isAccessWith(Connection dp){
  if (dataprovider == null) {
    dataprovider=dp;
    return true;
  }
  if (ResourceHelper.areSame(dataprovider,dp)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
protected boolean isAccessWith(Connection dp){
  if (dataprovider == null) {
    dataprovider=dp;
    return true;
  }
  if (ProxyRepositoryViewObject.areSame(dataprovider,dp)) {
    return true;
  }
  return false;
}
Program: 138852
Project: 138852
Buggy source:
protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  try {
    ProxyRepositoryFactory.getInstance().initialize();
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_CONNECTIONS,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      if (!(item instanceof FolderItem)) {
        DatabaseConnection connection=(DatabaseConnection)((DatabaseConnectionItem)item).getConnection();
        register(connection,reposViewObj);
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}

Fixed version (ground truth):
protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_CONNECTIONS,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      if (!(item instanceof FolderItem)) {
        DatabaseConnection connection=(DatabaseConnection)((DatabaseConnectionItem)item).getConnection();
        register(connection,reposViewObj);
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}
Program: 138853
Project: 138853
Buggy source:
@Override protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  try {
    ProxyRepositoryFactory.getInstance().initialize();
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_MDMCONNECTION,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      MDMConnection connection=(MDMConnection)((MDMConnectionItem)item).getConnection();
      register(connection,reposViewObj);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}

Fixed version (ground truth):
@Override protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_MDMCONNECTION,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      MDMConnection connection=(MDMConnection)((MDMConnectionItem)item).getConnection();
      register(connection,reposViewObj);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}
Program: 138854
Project: 138854
Buggy source:
protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_CONNECTIONS,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      if (!(item instanceof FolderItem)) {
        DatabaseConnection connection=(DatabaseConnection)((DatabaseConnectionItem)item).getConnection();
        register(connection,reposViewObj);
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}

Fixed version (ground truth):
protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  if (ResourcesPlugin.getWorkspace().isTreeLocked()) {
    return connList;
  }
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_CONNECTIONS,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      if (!(item instanceof FolderItem)) {
        DatabaseConnection connection=(DatabaseConnection)((DatabaseConnectionItem)item).getConnection();
        register(connection,reposViewObj);
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}
Program: 138855
Project: 138855
Buggy source:
@Override protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_MDMCONNECTION,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      MDMConnection connection=(MDMConnection)((MDMConnectionItem)item).getConnection();
      register(connection,reposViewObj);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}

Fixed version (ground truth):
@Override protected List<IRepositoryViewObject> fetchRepositoryViewObjectsLower(){
  List<IRepositoryViewObject> connList=new ArrayList<IRepositoryViewObject>();
  if (ResourcesPlugin.getWorkspace().isTreeLocked()) {
    return connList;
  }
  try {
    connList.addAll(ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA_MDMCONNECTION,true));
    clear();
    for (    IRepositoryViewObject reposViewObj : connList) {
      Item item=reposViewObj.getProperty().getItem();
      MDMConnection connection=(MDMConnection)((MDMConnectionItem)item).getConnection();
      register(connection,reposViewObj);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return connList;
}
Program: 138856
Project: 138856
Buggy source:
@Override public TypedReturnCode<Object> createAndSaveCWMFile(ModelElement cwmElement){
  Analysis analysis=(Analysis)cwmElement;
  DataManager connection=analysis.getContext().getConnection();
  DependenciesHandler.getInstance().setDependencyOn(analysis,connection);
  TypedReturnCode<Object> saveCWMFile=super.createAndSaveCWMFile(analysis);
  if (saveCWMFile.isOk()) {
    ProxyRepositoryViewObject.save((Connection)connection);
  }
  return saveCWMFile;
}

Fixed version (ground truth):
@Override public TypedReturnCode<Object> createAndSaveCWMFile(ModelElement cwmElement){
  Analysis analysis=(Analysis)cwmElement;
  DataManager connection=analysis.getContext().getConnection();
  DependenciesHandler.getInstance().setDependencyOn(analysis,connection);
  TypedReturnCode<Object> saveCWMFile=super.createAndSaveCWMFile(analysis);
  if (saveCWMFile.isOk()) {
    ProxyRepositoryViewObject.fetchAllRepositoryViewObjects(Boolean.TRUE);
    ProxyRepositoryViewObject.save((Connection)connection);
  }
  return saveCWMFile;
}
Program: 138859
Project: 138859
Buggy source:
private boolean isMdmFlag(){
  FolderProvider folderProvider=connectionParam.getFolderProvider();
  return folderProvider != null && ResourceManager.isMdmConnectionFolder(folderProvider.getFolderResource());
}

Fixed version (ground truth):
private boolean isMdmFlag(){
  FolderProvider folderProvider=connectionParam.getFolderProvider();
  return folderProvider != null && ResourceService.isSubFolder(ResourceManager.getMDMConnectionFolder(),folderProvider.getFolderResource());
}
Program: 138860
Project: 138860
Buggy source:
/** 
 * Adds a submenu to the given menu with the name "New Component".
 */
public void fillContextMenu(IMenuManager menu){
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  if (obj instanceof IResource) {
    IResource resource=(IResource)obj;
    if (!ResourceService.isReadOnlyFolder(resource)) {
      menu.add(new DeleteObjectsAction());
    }
  }
 else {
    menu.add(new DeleteObjectsAction());
  }
}

Fixed version (ground truth):
/** 
 * Adds a submenu to the given menu with the name "New Component".
 */
public void fillContextMenu(IMenuManager menu){
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  if (obj instanceof IResource) {
    IResource resource=(IResource)obj;
    if (!ResourceService.isReadOnlyFolder(resource) && !isSystemIndicator(resource)) {
      menu.add(new DeleteObjectsAction());
    }
  }
 else {
    menu.add(new DeleteObjectsAction());
  }
}
Program: 138862
Project: 138862
Buggy source:
public Map<String,String> getQueryMap(){
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  Map<String,String> map=new HashMap<String,String>();
switch (this.indicatorEnum) {
case MinLengthIndicatorEnum:
case MaxLengthIndicatorEnum:
    map.put(MENU_VIEW_ROWS,isSqlEngine ? getTextRowsStatement() : null);
  break;
default :
}
return map;
}

Fixed version (ground truth):
public Map<String,String> getQueryMap(){
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  Map<String,String> map=new HashMap<String,String>();
switch (this.indicatorEnum) {
case MinLengthIndicatorEnum:
case MaxLengthIndicatorEnum:
case AverageLengthIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
case MinLengthWithNullIndicatorEnum:
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
case AverageLengthWithBlankIndicatorEnum:
case AverageLengthWithNullBlankIndicatorEnum:
case AverageLengthWithNullIndicatorEnum:
    map.put(MENU_VIEW_ROWS,isSqlEngine ? getTextRowsStatement() : null);
  break;
default :
}
return map;
}
Program: 138863
Project: 138863
Buggy source:
private boolean isSystemIndicator(IResource resource){
  return resource.getFileExtension().equals("String_Node_Str") && resource.getFullPath().toOSString().contains(EResourceConstant.SYSTEM_INDICATORS.getName());
}

Fixed version (ground truth):
private boolean isSystemIndicator(IResource resource){
  if (resource instanceof IFile) {
    return resource.getFileExtension().equals("String_Node_Str") && resource.getFullPath().toOSString().contains(EResourceConstant.SYSTEM_INDICATORS.getName());
  }
 else {
    return resource.getFullPath().toOSString().contains(EResourceConstant.SYSTEM_INDICATORS.getName());
  }
}
Program: 138864
Project: 138864
Buggy source:
/** 
 * setup the Grid Layout Data to limit the vertical size of the table according to the numOfRows. if (numOfRows <= 10) then table will be 10 rows height, if (numOfRows > 10) then the table will be 30 rows heigth
 * @param table the table to set the GridData value on
 * @param numOfRows number of rows in the table ADDED sgandon 15/03/2010 bug 11769 : setup the size of the table toavoid crash and add consistency.
 */
protected void setupTableGridDataLimitedSize(Table table,int numOfRows){
  int itemHeight=table.getItemHeight();
  GridData data=new GridData(SWT.FILL,SWT.FILL,false,false);
  data.heightHint=numOfRows > TABLE_MIN_ROW_LIMIT ? BIG_TABLE_NUM_ROWS * itemHeight : SMALL_TABLE_NUM_ROWS * itemHeight;
  int tableWidth=0;
  for (  TableColumn column : table.getColumns()) {
    tableWidth+=column.getWidth();
  }
  data.widthHint=TABLE_WIDTH_HINT > tableWidth ? tableWidth : TABLE_WIDTH_HINT;
  table.setLayoutData(data);
}

Fixed version (ground truth):
/** 
 * setup the Grid Layout Data to limit the vertical size of the table according to the numOfRows. if (numOfRows <= 10) then table will be 10 rows height, if (numOfRows > 10) then the table will be 30 rows heigth
 * @param table the table to set the GridData value on
 * @param numOfRows number of rows in the table ADDED sgandon 15/03/2010 bug 11769 : setup the size of the table toavoid crash and add consistency.
 */
protected void setupTableGridDataLimitedSize(Table table,int numOfRows){
  int itemHeight=table.getItemHeight();
  GridData data=new GridData(SWT.FILL,SWT.FILL,false,false);
  data.heightHint=numOfRows > TABLE_MIN_ROW_LIMIT ? BIG_TABLE_NUM_ROWS * itemHeight : SMALL_TABLE_NUM_ROWS * itemHeight;
  int tableWidth=0;
  for (  TableColumn column : table.getColumns()) {
    tableWidth+=column.getWidth() + 50;
  }
  data.widthHint=TABLE_WIDTH_HINT > tableWidth ? tableWidth : TABLE_WIDTH_HINT;
  table.setLayoutData(data);
}
Program: 138865
Project: 138865
Buggy source:
/** 
 * setup the Grid Layout Data to limit the vertical size of the table according to the numOfRows. if (numOfRows <= 10) then table will be 10 rows height, if (numOfRows > 10) then the table will be 30 rows heigth
 * @param table the table to set the GridData value on
 * @param numOfRows number of rows in the table ADDED sgandon 15/03/2010 bug 11769 : setup the size of the table toavoid crash and add consistency.
 */
protected void setupTableGridDataLimitedSize(Table table,int numOfRows){
  int itemHeight=table.getItemHeight();
  GridData data=new GridData(SWT.FILL,SWT.FILL,false,false);
  data.heightHint=numOfRows > TABLE_MIN_ROW_LIMIT ? BIG_TABLE_NUM_ROWS * itemHeight : SMALL_TABLE_NUM_ROWS * itemHeight;
  int tableWidth=0;
  for (  TableColumn column : table.getColumns()) {
    tableWidth+=column.getWidth() + 50;
  }
  data.widthHint=TABLE_WIDTH_HINT > tableWidth ? tableWidth : TABLE_WIDTH_HINT;
  table.setLayoutData(data);
}

Fixed version (ground truth):
/** 
 * setup the Grid Layout Data to limit the vertical size of the table according to the numOfRows. if (numOfRows <= 10) then table will be 10 rows height, if (numOfRows > 10) then the table will be 30 rows heigth
 * @param table the table to set the GridData value on
 * @param numOfRows number of rows in the table ADDED sgandon 15/03/2010 bug 11769 : setup the size of the table toavoid crash and add consistency.
 */
protected void setupTableGridDataLimitedSize(Table table,int numOfRows){
  int itemHeight=table.getItemHeight();
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,false);
  data.heightHint=numOfRows > TABLE_MIN_ROW_LIMIT ? BIG_TABLE_NUM_ROWS * itemHeight : SMALL_TABLE_NUM_ROWS * itemHeight;
  table.setLayoutData(data);
}
Program: 138870
Project: 138870
Buggy source:
@Override protected void deleteRelated(IFile file){
}

Fixed version (ground truth):
@Override protected void deleteRelated(IFile file){
  EObjectHelper.getDependencyClients(file);
}
Program: 138871
Project: 138871
Buggy source:
/** 
 * Save logical delete path to TXT file.
 * @param type
 * @param path
 */
public static void saveElement(String type,String path){
  try {
    File f=new Path(filePath).toFile();
    if (!f.exists()) {
      f=new File(filePath);
      f.createNewFile();
    }
    FileWriter fw=new FileWriter(f.getPath(),true);
    PrintWriter out=new PrintWriter(fw);
    out.println(type + path);
    fw.close();
    out.close();
    String[] es={type.replaceAll("String_Node_Str",PluginConstant.EMPTY_STRING),path};
    delLs.add(es);
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
}

Fixed version (ground truth):
/** 
 * Save logical delete path to TXT file.
 * @param type
 * @param path
 */
public static void saveElement(String type,String path){
  try {
    File f=new Path(filePath).toFile();
    if (!f.exists()) {
      f=new File(filePath);
      f.createNewFile();
    }
    FileWriter fw=new FileWriter(f.getPath(),true);
    PrintWriter out=new PrintWriter(fw);
    out.println(type + path);
    fw.close();
    out.close();
    String[] es={type.replaceAll("String_Node_Str",PluginConstant.EMPTY_STRING),path};
    if (delLs == null) {
      delLs=getDelLs();
    }
    delLs.add(es);
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
}
Program: 138872
Project: 138872
Buggy source:
/** 
 * DOC qzhang DeleteFolderAction constructor comment.
 */
public DeleteFolderAction(IFolder obj,boolean isDeleteForever){
  this.folder=obj;
  this.isDeleteForever=isDeleteForever;
  if (isDeleteForever) {
    setText(DefaultMessagesImpl.getString("String_Node_Str"));
  }
 else {
    setText(DefaultMessagesImpl.getString("String_Node_Str"));
  }
  setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
}

Fixed version (ground truth):
/** 
 * DOC qzhang DeleteFolderAction constructor comment.
 */
public DeleteFolderAction(IFolder obj,boolean isDeleteForever){
  this.folder=obj;
  this.isDeleteForever=isDeleteForever;
  setText(DefaultMessagesImpl.getString("String_Node_Str"));
  setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
}
Program: 138873
Project: 138873
Buggy source:
@Override public void run(){
  IFolder parent=(IFolder)folder.getParent();
  boolean isFilesDeleted=deleteFolderAndFiles();
  if (!isFilesDeleted) {
    return;
  }
  try {
    if (isDeleteForever) {
      delsubFolderForever(folder);
      if (LogicalDeleteFileHandle.isStartWithDelFolder(folder.getFullPath().toOSString())) {
        LogicalDeleteFileHandle.replaceInFile(LogicalDeleteFileHandle.folderType + folder.getFullPath().toOSString(),PluginConstant.EMPTY_STRING);
        folder.delete(true,null);
      }
    }
 else {
      LogicalDeleteFileHandle.saveElement(LogicalDeleteFileHandle.folderType,folder.getFullPath().toOSString());
    }
    CorePlugin.getDefault().refreshDQView();
    ProxyRepositoryManager.getInstance().save();
    parent.refreshLocal(IResource.DEPTH_INFINITE,null);
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  boolean isFilesDeleted=deleteFolderAndFiles();
  if (!isFilesDeleted) {
    return;
  }
  try {
    folder.delete(true,null);
    CorePlugin.getDefault().refreshDQView();
    ProxyRepositoryManager.getInstance().save();
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
}