nus-yam/ex-repair huggingface dataset:
Program: 123948
Project: 123948
Buggy source:
protected void okPressed(){
  if (directoryField.getText() != null && !directoryField.getText().startsWith(QUOTATION_MARK) && !directoryField.getText().endsWith(QUOTATION_MARK)) {
    directoryField.setText(TalendQuoteUtils.addQuotesIfNotExist(directoryField.getText()));
  }
  MapperSettingModel currnentModel=settingsManager.getCurrnentModel();
  currnentModel.setDieOnError(dieOnErrorButton.getSelection());
  currnentModel.setLookInParallel(lookupInParallelButton.getSelection());
  currnentModel.setTempDataDir(directoryField.getText());
  currnentModel.setRowBufferSize(sizeField.getText());
  if (dieOnErrorButton.getSelection()) {
    mapperManager.removeRejectOutput();
  }
 else {
    if (!mapperManager.hasRejectOutput(mapperManager.getOutputTables())) {
      mapperManager.addRejectOutput();
    }
  }
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  if (directoryField.getText() != null && StringUtils.trimToNull(directoryField.getText()) != null && (!directoryField.getText().startsWith(QUOTATION_MARK) || !directoryField.getText().endsWith(QUOTATION_MARK))) {
    directoryField.setText(TalendQuoteUtils.addQuotesIfNotExist(directoryField.getText()));
  }
  MapperSettingModel currentModel=settingsManager.getCurrnentModel();
  currentModel.setDieOnError(dieOnErrorButton.getSelection());
  currentModel.setLookInParallel(lookupInParallelButton.getSelection());
  currentModel.setTempDataDir(directoryField.getText());
  currentModel.setRowBufferSize(sizeField.getText());
  if (dieOnErrorButton.getSelection()) {
    mapperManager.removeRejectOutput();
  }
 else {
    if (!mapperManager.hasRejectOutput(mapperManager.getOutputTables())) {
      mapperManager.addRejectOutput();
    }
  }
  super.okPressed();
}
Program: 123949
Project: 123949
Buggy source:
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length > 1) {
    String exp=MetadataToolHelper.validateValue(split[1]);
    if (!exp.equals(split[1])) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
  }
  return split[0] + "String_Node_Str" + split[1].trim();
}

Fixed version (ground truth):
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length > 1) {
    String exp=MetadataToolHelper.validateValue(split[1].trim());
    if (!exp.equals(split[1].trim())) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
  }
  return split[0] + "String_Node_Str" + split[1].trim();
}
Program: 123951
Project: 123951
Buggy source:
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length > 1) {
    String exp=MetadataToolHelper.validateValue(split[1].trim());
    if (!exp.equals(split[1].trim())) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
    return split[0] + "String_Node_Str" + split[1].trim();
  }
 else {
    return expression;
  }
}

Fixed version (ground truth):
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length == 2) {
    String exp=MetadataToolHelper.validateValue(split[1].trim());
    if (!exp.equals(split[1].trim())) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
    return split[0] + "String_Node_Str" + split[1].trim();
  }
 else {
    return expression;
  }
}
Program: 123952
Project: 123952
Buggy source:
/** 
 * DOC wzhang Comment method "getConnection".
 * @return
 */
private Connection getConnection(){
  if (this.elem == null) {
    return null;
  }
  if (elem instanceof Node) {
    String propertyValue=(String)(((Node)elem).getPropertyValue(EParameterName.REPOSITORY_PROPERTY_TYPE.getName()));
    IRepositoryViewObject lastVersion=UpdateRepositoryUtils.getRepositoryObjectById(propertyValue);
    if (lastVersion != null) {
      final Item item=lastVersion.getProperty().getItem();
      if (item != null && item instanceof ConnectionItem) {
        Connection repositoryConn=((ConnectionItem)item).getConnection();
        return repositoryConn;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC wzhang Comment method "getConnection".
 * @return
 */
private Connection getConnection(){
  if (this.elem == null) {
    return null;
  }
  if (elem instanceof Node) {
    IElementParameter elementParameter=((Node)elem).getElementParameter(EParameterName.PROPERTY_TYPE.getName());
    if (elementParameter != null && !EmfComponent.BUILTIN.equals(elementParameter.getValue())) {
      String propertyValue=(String)(((Node)elem).getPropertyValue(EParameterName.REPOSITORY_PROPERTY_TYPE.getName()));
      IRepositoryViewObject lastVersion=UpdateRepositoryUtils.getRepositoryObjectById(propertyValue);
      if (lastVersion != null) {
        final Item item=lastVersion.getProperty().getItem();
        if (item != null && item instanceof ConnectionItem) {
          Connection repositoryConn=((ConnectionItem)item).getConnection();
          return repositoryConn;
        }
      }
    }
  }
  return null;
}
Program: 123964
Project: 123964
Buggy source:
/** 
 * DOC acer ModulePropertyDialog constructor comment.
 * @param parentShell
 */
public ModulePropertyDialog(Shell parentShell){
  super(parentShell);
  setShellStyle(SWT.CLOSE | SWT.MIN | SWT.MAX| SWT.RESIZE);
}

Fixed version (ground truth):
/** 
 * DOC acer ModulePropertyDialog constructor comment.
 * @param parentShell
 */
public ModulePropertyDialog(Shell parentShell){
  super(parentShell);
  setShellStyle(SWT.CLOSE | SWT.MIN | SWT.MAX| SWT.RESIZE| SWT.APPLICATION_MODAL);
}
Program: 123965
Project: 123965
Buggy source:
/** 
 * DOC acer ModulePropertyDialog constructor comment.
 * @param parentShell
 */
public ModulePropertyDialog(Shell parentShell){
  super(parentShell);
  setShellStyle(SWT.CLOSE | SWT.MIN | SWT.MAX| SWT.RESIZE);
}

Fixed version (ground truth):
/** 
 * DOC acer ModulePropertyDialog constructor comment.
 * @param parentShell
 */
public ModulePropertyDialog(Shell parentShell){
  super(parentShell);
  setShellStyle(SWT.CLOSE | SWT.MIN | SWT.MAX| SWT.RESIZE| SWT.APPLICATION_MODAL);
}
Program: 123966
Project: 123966
Buggy source:
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=project.getAuthor().getLogin();
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      okPressed();
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=project.getAuthor().getLogin();
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}
Program: 123969
Project: 123969
Buggy source:
/** 
 * DOC Administrator TalendForgeDialog constructor comment.
 * @param shell
 */
public TalendForgeDialog(Shell shell,Project project){
  super(shell);
  this.project=project;
}

Fixed version (ground truth):
/** 
 * DOC Administrator TalendForgeDialog constructor comment.
 * @param shell
 */
public TalendForgeDialog(Shell shell,Project project){
  super(shell);
  this.project=project;
  if (osName.contains("String_Node_Str")) {
    font=fontMac;
  }
}
Program: 123973
Project: 123973
Buggy source:
public void addPath(String path,String originalPath,Boolean asXML){
  paths.add(path);
  originalPaths.add(originalPath);
  asXMLs.add(asXML);
}

Fixed version (ground truth):
public void addPath(String path,String originalPath,Boolean asXML,boolean isDot){
  paths.add(path);
  originalPaths.add(originalPath);
  asXMLs.add(asXML);
  isDots.add(isDot);
}
Program: 123981
Project: 123981
Buggy source:
/** 
 * @see org.eclipse.jface.wizard.Wizard#performFinish()
 */
@Override public boolean performFinish(){
  IProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Context ctx=CorePlugin.getContext();
  RepositoryContext repositoryContext=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
  try {
    Project projectInfor=ProjectHelper.createProject(mainPage.getName(),mainPage.getDescription(),mainPage.getLanguage(),repositoryContext.getUser());
    project=repositoryFactory.createProject(projectInfor);
    return true;
  }
 catch (  PersistenceException e) {
    MessageDialog.openError(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    MessageBoxExceptionHandler.process(e);
    return false;
  }
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.jface.wizard.Wizard#performFinish()
 */
@Override public boolean performFinish(){
  IProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Context ctx=CorePlugin.getContext();
  RepositoryContext repositoryContext=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
  try {
    Project projectInfor=ProjectHelper.createProject(mainPage.getName().trim().replace(' ','_'),mainPage.getDescription(),mainPage.getLanguage(),repositoryContext.getUser());
    project=repositoryFactory.createProject(projectInfor);
    return true;
  }
 catch (  PersistenceException e) {
    MessageDialog.openError(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    MessageBoxExceptionHandler.process(e);
    return false;
  }
}
Program: 123982
Project: 123982
Buggy source:
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=project.getAuthor().getLogin();
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      okPressed();
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=project.getAuthor().getLogin();
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}
Program: 123984
Project: 123984
Buggy source:
/** 
 * DOC Administrator TalendForgeDialog constructor comment.
 * @param shell
 */
public TalendForgeDialog(Shell shell,Project project){
  super(shell);
  this.project=project;
}

Fixed version (ground truth):
/** 
 * DOC Administrator TalendForgeDialog constructor comment.
 * @param shell
 */
public TalendForgeDialog(Shell shell,Project project){
  super(shell);
  this.project=project;
  if (osName.contains("String_Node_Str")) {
    font=fontMac;
  }
}
Program: 123988
Project: 123988
Buggy source:
/** 
 * @see org.eclipse.jface.wizard.Wizard#performFinish()
 */
@Override public boolean performFinish(){
  IProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Context ctx=CorePlugin.getContext();
  RepositoryContext repositoryContext=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
  try {
    Project projectInfor=ProjectHelper.createProject(mainPage.getName(),mainPage.getDescription(),mainPage.getLanguage(),repositoryContext.getUser());
    project=repositoryFactory.createProject(projectInfor);
    return true;
  }
 catch (  PersistenceException e) {
    MessageDialog.openError(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    MessageBoxExceptionHandler.process(e);
    return false;
  }
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.jface.wizard.Wizard#performFinish()
 */
@Override public boolean performFinish(){
  IProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Context ctx=CorePlugin.getContext();
  RepositoryContext repositoryContext=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
  try {
    Project projectInfor=ProjectHelper.createProject(mainPage.getName().trim().replace(' ','_'),mainPage.getDescription(),mainPage.getLanguage(),repositoryContext.getUser());
    project=repositoryFactory.createProject(projectInfor);
    return true;
  }
 catch (  PersistenceException e) {
    MessageDialog.openError(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    MessageBoxExceptionHandler.process(e);
    return false;
  }
}
Program: 123989
Project: 123989
Buggy source:
@Override public boolean except(Item item,ERepositoryObjectType type,RepositoryNode seletetedNode,IComponent component,String repositoryType){
  if (component != null && component.getName().startsWith("String_Node_Str")) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean except(Item item,ERepositoryObjectType type,RepositoryNode seletetedNode,IComponent component,String repositoryType){
  boolean isOracleSid=false;
  if (item != null && item instanceof DatabaseConnectionItem) {
    if (((DatabaseConnectionItem)item).getConnection() instanceof DatabaseConnection)     if (((DatabaseConnection)((DatabaseConnectionItem)item).getConnection()).getDatabaseType().equals(EDatabaseTypeName.ORACLEFORSID.getDisplayName())) {
      isOracleSid=true;
    }
  }
  if (!isOracleSid && component != null && component.getName().startsWith("String_Node_Str")) {
    return true;
  }
  return false;
}
Program: 123992
Project: 123992
Buggy source:
public void focusLost(FocusEvent e){
  projectText.setText(DEFAULT_PROJECT_NAME);
  projectText.setBackground(GREY_COLOR);
}

Fixed version (ground truth):
public void focusLost(FocusEvent e){
  if (projectText.getText() == "String_Node_Str") {
    projectText.setText(DEFAULT_PROJECT_NAME);
    projectText.setBackground(GREY_COLOR);
  }
}
Program: 123993
Project: 123993
Buggy source:
public void focusGained(FocusEvent e){
  projectText.setBackground(null);
  projectText.setText("String_Node_Str");
}

Fixed version (ground truth):
public void focusGained(FocusEvent e){
  if (projectText.getText().equals(DEFAULT_PROJECT_NAME)) {
    projectText.setBackground(null);
    projectText.setText("String_Node_Str");
  }
}
Program: 124000
Project: 124000
Buggy source:
@Override public void refresh(IElementParameter param,boolean check){
  String paramName=param.getName();
  CCombo combo=(CCombo)hashCurControls.get(paramName);
  if (combo == null || combo.isDisposed()) {
    return;
  }
  Object value=param.getValue();
  if (value instanceof String) {
    String strValue="String_Node_Str";
    boolean strValueSet=false;
    int nbInList=0, nbMax=param.getListItemsValue().length;
    String name=(String)value;
    while (strValue.equals(new String("String_Node_Str")) && nbInList < nbMax) {
      if (name.equals(param.getListItemsValue()[nbInList])) {
        strValue=(String)param.getListItemsDisplayName()[nbInList];
        strValueSet=true;
      }
      nbInList++;
    }
    if (!strValueSet) {
      strValue=name;
    }
    String[] paramItems=getListToDisplay(param);
    String[] comboItems=combo.getItems();
    if (!Arrays.equals(paramItems,comboItems)) {
      combo.setItems(paramItems);
    }
    combo.setText(strValue);
    combo.setVisible(true);
  }
  if (param.isContextMode()) {
    combo.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_YELLOW));
    combo.setEnabled(false);
  }
}

Fixed version (ground truth):
@Override public void refresh(IElementParameter param,boolean check){
  String paramName=param.getName();
  CCombo combo=(CCombo)hashCurControls.get(paramName);
  if (combo == null || combo.isDisposed()) {
    return;
  }
  Object value=param.getValue();
  if (value instanceof String) {
    String strValue="String_Node_Str";
    boolean strValueSet=false;
    int nbInList=0, nbMax=param.getListItemsValue().length;
    String name=(String)value;
    while (strValue.equals(new String("String_Node_Str")) && nbInList < nbMax) {
      if (name.equals(param.getListItemsValue()[nbInList])) {
        strValue=(String)param.getListItemsDisplayName()[nbInList];
        strValueSet=true;
      }
      nbInList++;
    }
    if (!strValueSet) {
      strValue=name;
    }
    String[] paramItems=getListToDisplay(param);
    String[] comboItems=combo.getItems();
    if (!Arrays.equals(paramItems,comboItems)) {
      combo.setItems(paramItems);
    }
    if (param.isRepositoryValueUsed()) {
      combo.removeModifyListener(modifySelection);
      combo.setText(strValue);
      combo.addModifyListener(modifySelection);
    }
 else {
      combo.setText(strValue);
    }
    combo.setVisible(true);
  }
  if (param.isContextMode()) {
    combo.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_YELLOW));
    combo.setEnabled(false);
  }
}
Program: 124003
Project: 124003
Buggy source:
@Override public void notifyChanged(Notification notification){
  Object oldValue=notification.getOldValue();
  Object newValue=notification.getNewValue();
  boolean changed=(newValue == null && oldValue != null) || (newValue != null && !newValue.equals(oldValue));
  if (notification.getEventType() != Notification.REMOVING_ADAPTER && changed) {
    int featureID=notification.getFeatureID(Properties.class);
    if (featureID == PropertiesPackage.PROPERTY__INFORMATIONS) {
      return;
    }
 else     if (featureID == PropertiesPackage.PROPERTY__MAX_INFORMATION_LEVEL) {
      updateTitleImage();
      return;
    }
    if (Display.getCurrent() != null) {
      propertyIsDirty=true;
      firePropertyChange(IEditorPart.PROP_DIRTY);
    }
  }
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
    int featureID=notification.getFeatureID(Properties.class);
    if (featureID == PropertiesPackage.PROPERTY__INFORMATIONS) {
      return;
    }
 else     if (featureID == PropertiesPackage.PROPERTY__MAX_INFORMATION_LEVEL) {
      updateTitleImage();
      return;
    }
    if (Display.getCurrent() != null) {
      propertyIsDirty=true;
      firePropertyChange(IEditorPart.PROP_DIRTY);
    }
  }
}
Program: 124004
Project: 124004
Buggy source:
@Override public void notifyChanged(Notification notification){
  Object oldValue=notification.getOldValue();
  Object newValue=notification.getNewValue();
  boolean changed=(newValue == null && oldValue != null) || (newValue != null && !newValue.equals(oldValue));
  if (notification.getEventType() != Notification.REMOVING_ADAPTER && changed) {
    propertyIsDirty=true;
    Display.getDefault().syncExec(new Runnable(){
      public void run(){
        firePropertyChange(IEditorPart.PROP_DIRTY);
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
    propertyIsDirty=true;
    Display.getDefault().syncExec(new Runnable(){
      public void run(){
        firePropertyChange(IEditorPart.PROP_DIRTY);
      }
    }
);
  }
}
Program: 124007
Project: 124007
Buggy source:
private void deleteNoUseTable(){
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}

Fixed version (ground truth):
private void deleteNoUseTable(){
  DatabaseConnection connection=(DatabaseConnection)SQLBuilderRepositoryNodeManager.getItem(SQLBuilderRepositoryNodeManager.getRoot(nodeInEditor)).getConnection();
  if (SQLBuilderRepositoryNodeManager.tList instanceof List) {
    if (SQLBuilderRepositoryNodeManager.tList.size() == 0) {
      SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
    }
  }
 else {
    SQLBuilderRepositoryNodeManager.tList=new ArrayList<MetadataTable>();
    SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
  }
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}
Program: 124008
Project: 124008
Buggy source:
@Override public void cancelPressed(){
  SQLBuilderRepositoryNodeManager.tList=null;
  super.cancelPressed();
}

Fixed version (ground truth):
@Override public void cancelPressed(){
  super.cancelPressed();
  SQLBuilderRepositoryNodeManager.tList=null;
}
Program: 124011
Project: 124011
Buggy source:
/** 
 * DOC smallet Comment method "afterImportAs".
 * @param newName
 * @param technicalName
 * @throws InvocationTargetException
 */
private static void afterImportAs(String newName,String technicalName) throws InvocationTargetException {
  final IWorkspace workspace=org.eclipse.core.resources.ResourcesPlugin.getWorkspace();
  IContainer containers=(IProject)workspace.getRoot().findMember(new Path(technicalName));
  IResource file2=containers.findMember(IProjectDescription.DESCRIPTION_FILE_NAME);
  try {
    FilesUtils.replaceInFile("String_Node_Str",file2.getLocation().toOSString(),"String_Node_Str" + technicalName + "String_Node_Str");
    IResource file3=containers.findMember(OLD_TALEND_PROJECT_FILE_NAME);
    if (file3 == null || !file3.exists()) {
      file3=containers.findMember(TALEND_PROJECT_FILE_NAME);
    }
    replaceInFile("String_Node_Str",file3.getLocation().toOSString(),"String_Node_Str" + newName + "String_Node_Str");
    replaceInFile("String_Node_Str",file3.getLocation().toOSString(),"String_Node_Str" + technicalName + "String_Node_Str");
  }
 catch (  IOException e) {
    throw new InvocationTargetException(e);
  }
}

Fixed version (ground truth):
/** 
 * DOC smallet Comment method "afterImportAs".
 * @param newName
 * @param technicalName
 * @throws InvocationTargetException
 */
private static void afterImportAs(String newName,String technicalName) throws InvocationTargetException {
  final IWorkspace workspace=org.eclipse.core.resources.ResourcesPlugin.getWorkspace();
  IContainer containers=(IProject)workspace.getRoot().findMember(new Path(technicalName));
  IResource file2=containers.findMember(IProjectDescription.DESCRIPTION_FILE_NAME);
  try {
    FilesUtils.replaceInFile("String_Node_Str",file2.getLocation().toOSString(),"String_Node_Str" + technicalName + "String_Node_Str");
    IResource file3=containers.findMember(OLD_TALEND_PROJECT_FILE_NAME);
    if (file3 == null || !file3.exists()) {
      file3=containers.findMember(TALEND_PROJECT_FILE_NAME);
    }
    replaceInFile("String_Node_Str",file3.getLocation().toOSString(),"String_Node_Str" + newName + "String_Node_Str");
    replaceInFile("String_Node_Str",file3.getLocation().toOSString(),"String_Node_Str" + technicalName + "String_Node_Str");
    final IProject project=workspace.getRoot().getProject(technicalName);
    XmiResourceManager xmiManager=new XmiResourceManager();
    try {
      final Project loadProject=xmiManager.loadProject(project);
      loadProject.setLocal(true);
      xmiManager.saveResource(loadProject.eResource());
    }
 catch (    PersistenceException e) {
    }
  }
 catch (  IOException e) {
    throw new InvocationTargetException(e);
  }
}
Program: 124012
Project: 124012
Buggy source:
private boolean collectProjectFilesFromDirectory(Collection files,File directory,Set directoriesVisited){
  File[] contents=directory.listFiles();
  if (contents == null)   return false;
  if (directoriesVisited == null) {
    directoriesVisited=new HashSet();
    try {
      directoriesVisited.add(directory.getCanonicalPath());
    }
 catch (    IOException exception) {
      StatusManager.getManager().handle(StatusUtil.newStatus(IStatus.ERROR,exception.getLocalizedMessage(),exception));
    }
  }
  final String dotProject="String_Node_Str";
  for (int i=0; i < contents.length; i++) {
    File file=contents[i];
    if (file.isFile() && file.getName().equals(dotProject)) {
      files.add(file);
      return true;
    }
  }
  for (int i=0; i < contents.length; i++) {
    if (contents[i].isDirectory()) {
      if (!contents[i].getName().equals(METADATA_FOLDER)) {
        try {
          String canonicalPath=contents[i].getCanonicalPath();
          if (!directoriesVisited.add(canonicalPath)) {
            continue;
          }
        }
 catch (        IOException exception) {
          StatusManager.getManager().handle(StatusUtil.newStatus(IStatus.ERROR,exception.getLocalizedMessage(),exception));
        }
        collectProjectFilesFromDirectory(files,contents[i],directoriesVisited);
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean collectProjectFilesFromDirectory(Collection files,File directory,Set directoriesVisited){
  File[] contents=directory.listFiles();
  if (contents == null)   return false;
  if (directoriesVisited == null) {
    directoriesVisited=new HashSet();
    try {
      directoriesVisited.add(directory.getCanonicalPath());
    }
 catch (    IOException exception) {
      StatusManager.getManager().handle(StatusUtil.newStatus(IStatus.ERROR,exception.getLocalizedMessage(),exception));
    }
  }
  final String dotProject=TALEND_PROJECT;
  for (int i=0; i < contents.length; i++) {
    File file=contents[i];
    if (file.isFile() && file.getName().equals(dotProject)) {
      files.add(file);
      return true;
    }
  }
  for (int i=0; i < contents.length; i++) {
    if (contents[i].isDirectory()) {
      if (!contents[i].getName().equals(METADATA_FOLDER)) {
        try {
          String canonicalPath=contents[i].getCanonicalPath();
          if (!directoriesVisited.add(canonicalPath)) {
            continue;
          }
        }
 catch (        IOException exception) {
          StatusManager.getManager().handle(StatusUtil.newStatus(IStatus.ERROR,exception.getLocalizedMessage(),exception));
        }
        collectProjectFilesFromDirectory(files,contents[i],directoriesVisited);
      }
    }
  }
  return true;
}
Program: 124013
Project: 124013
Buggy source:
private boolean collectProjectFilesFromProvider(Collection files,Object entry,int level){
  List children=structureProvider.getChildren(entry);
  if (children == null) {
    children=new ArrayList(1);
  }
  boolean isContainsFile=false;
  Iterator childrenEnum=children.iterator();
  for (int i=0; i < children.size(); i++) {
    Object child=children.get(i);
    if (!structureProvider.isFolder(child)) {
      String elementLabel=structureProvider.getLabel(child);
      if (elementLabel.equals("String_Node_Str")) {
        isContainsFile=true;
      }
    }
  }
  while (childrenEnum.hasNext()) {
    Object child=childrenEnum.next();
    if (structureProvider.isFolder(child)) {
      collectProjectFilesFromProvider(files,child,level + 1);
    }
    String elementLabel=structureProvider.getLabel(child);
    if (elementLabel.equals("String_Node_Str") && isContainsFile) {
      files.add(new TalendProjectRecord(child,entry,level));
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean collectProjectFilesFromProvider(Collection files,Object entry,int level){
  List children=structureProvider.getChildren(entry);
  if (children == null) {
    children=new ArrayList(1);
  }
  boolean isContainsFile=false;
  Iterator childrenEnum=children.iterator();
  for (int i=0; i < children.size(); i++) {
    Object child=children.get(i);
    if (!structureProvider.isFolder(child)) {
      String elementLabel=structureProvider.getLabel(child);
      if (elementLabel.equals(TALEND_PROJECT)) {
        isContainsFile=true;
      }
    }
  }
  while (childrenEnum.hasNext()) {
    Object child=childrenEnum.next();
    if (structureProvider.isFolder(child)) {
      collectProjectFilesFromProvider(files,child,level + 1);
    }
    String elementLabel=structureProvider.getLabel(child);
    if (elementLabel.equals("String_Node_Str") && isContainsFile) {
      files.add(new TalendProjectRecord(child,entry,level));
    }
  }
  return true;
}
Program: 124016
Project: 124016
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ERepositoryObjectType.PROCESS) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getProperties(EProperties.CONTENT_TYPE) != ERepositoryObjectType.PROCESS) {
      canWork=false;
      break;
    }
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT && node.getChildren().isEmpty()) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}
Program: 124017
Project: 124017
Buggy source:
@Override public JobScriptsManager createJobScriptsManager(){
  Map<ExportChoice,Object> exportChoiceMap=getExportChoiceMap();
  String launcher=(getCurrentExportType() == JobExportType.POJO) ? launcherCombo.getText() : "String_Node_Str";
  String context=(contextCombo == null || contextCombo.isDisposed()) ? "String_Node_Str" : contextCombo.getText();
  JobScriptsManager manager=JobScriptsManagerFactory.createManagerInstance(exportChoiceMap,context,launcher,IProcessor.NO_STATISTICS,IProcessor.NO_TRACES,getCurrentExportType());
  manager.setDestinationPath(getDestinationValue());
  return manager;
}

Fixed version (ground truth):
@Override public JobScriptsManager createJobScriptsManager(){
  Map<ExportChoice,Object> exportChoiceMap=getExportChoiceMap();
  String launcher=(getCurrentExportType1() == JobExportType.POJO) ? launcherCombo.getText() : "String_Node_Str";
  String context=(contextCombo == null || contextCombo.isDisposed()) ? "String_Node_Str" : contextCombo.getText();
  JobScriptsManager manager=JobScriptsManagerFactory.createManagerInstance(exportChoiceMap,context,launcher,IProcessor.NO_STATISTICS,IProcessor.NO_TRACES,getCurrentExportType1());
  manager.setDestinationPath(getDestinationValue());
  return manager;
}
Program: 124022
Project: 124022
Buggy source:
@Override protected String getOutputSuffix(){
switch (getCurrentExportType()) {
case WSWAR:
    return "String_Node_Str";
case JBOSSESB:
  return "String_Node_Str";
case OSGI:
return "String_Node_Str";
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
@Override protected String getOutputSuffix(){
switch (getCurrentExportType1()) {
case WSWAR:
    return "String_Node_Str";
case JBOSSESB:
  return "String_Node_Str";
case OSGI:
return "String_Node_Str";
default :
return "String_Node_Str";
}
}
Program: 124024
Project: 124024
Buggy source:
protected void restoreWidgetValuesForOSGI(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    if (directoryNames != null && directoryNames.length > 0) {
      String fileName=this.getDefaultFileName().get(0) + "String_Node_Str" + this.getDefaultFileName().get(1)+ getOutputSuffix();
      for (int i=0; i < directoryNames.length; i++) {
        String destination=new Path(directoryNames[i]).append(fileName).toOSString();
        addDestinationItem(destination);
        setDestinationValue(destination);
      }
    }
 else {
      setDefaultDestinationForOSGI();
    }
  }
 else {
    setDefaultDestinationForOSGI();
  }
}

Fixed version (ground truth):
protected void restoreWidgetValuesForOSGI(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    if (directoryNames != null && directoryNames.length > 0) {
      String fileName=getDefaultFileNameWithType();
      for (int i=0; i < directoryNames.length; i++) {
        String destination=new Path(directoryNames[i]).append(fileName).toOSString();
        addDestinationItem(destination);
        setDestinationValue(destination);
      }
    }
 else {
      setDefaultDestinationForOSGI();
    }
  }
 else {
    setDefaultDestinationForOSGI();
  }
}
Program: 124026
Project: 124026
Buggy source:
protected void createOptionsGroupButtons(Composite parent){
  GridLayout layout=new GridLayout();
  optionsGroupComposite=new Composite(parent,SWT.NONE);
  GridData gridData=new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
  gridData.minimumHeight=200;
  optionsGroupComposite.setLayoutData(gridData);
  optionsGroupComposite.setLayout(layout);
  Group optionsGroup=new Group(optionsGroupComposite,SWT.NONE);
  optionsGroup.setLayout(layout);
  optionsGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
  optionsGroup.setText(IDEWorkbenchMessages.WizardExportPage_options);
  optionsGroup.setFont(parent.getFont());
  Font font=optionsGroup.getFont();
  optionsGroup.setLayout(new GridLayout(1,true));
  Composite left=new Composite(optionsGroup,SWT.NONE);
  gridData=new GridData(SWT.LEFT,SWT.TOP,true,false);
  left.setLayoutData(gridData);
  left.setLayout(new GridLayout(3,true));
switch (getCurrentExportType()) {
case POJO:
    createOptions(left,font);
  restoreWidgetValuesForPOJO();
break;
case JBOSSESB:
createOptionsForJbossESB(left,font);
restoreWidgetValuesForESB();
break;
case PETALSESB:
createOptionsforPetalsESB(left,font);
restoreWidgetValuesForPetalsESB();
restoreWidgetValues();
break;
case OSGI:
createOptionsForOSGIESB(left,font);
restoreWidgetValuesForOSGI();
break;
default :
createOptionsForWS(left,font);
break;
}
}

Fixed version (ground truth):
protected void createOptionsGroupButtons(Composite parent){
  GridLayout layout=new GridLayout();
  optionsGroupComposite=new Composite(parent,SWT.NONE);
  GridData gridData=new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
  gridData.minimumHeight=200;
  optionsGroupComposite.setLayoutData(gridData);
  optionsGroupComposite.setLayout(layout);
  Group optionsGroup=new Group(optionsGroupComposite,SWT.NONE);
  optionsGroup.setLayout(layout);
  optionsGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
  optionsGroup.setText(IDEWorkbenchMessages.WizardExportPage_options);
  optionsGroup.setFont(parent.getFont());
  Font font=optionsGroup.getFont();
  optionsGroup.setLayout(new GridLayout(1,true));
  Composite left=new Composite(optionsGroup,SWT.NONE);
  gridData=new GridData(SWT.LEFT,SWT.TOP,true,false);
  left.setLayoutData(gridData);
  left.setLayout(new GridLayout(3,true));
switch (getCurrentExportType1()) {
case POJO:
    createOptions(left,font);
  restoreWidgetValuesForPOJO();
break;
case JBOSSESB:
createOptionsForJbossESB(left,font);
restoreWidgetValuesForESB();
break;
case PETALSESB:
createOptionsforPetalsESB(left,font);
restoreWidgetValuesForPetalsESB();
restoreWidgetValues();
break;
case OSGI:
createOptionsForOSGIESB(left,font);
restoreWidgetValuesForOSGI();
break;
default :
createOptionsForWS(left,font);
break;
}
}
Program: 124027
Project: 124027
Buggy source:
@Override public boolean checkExport(){
  setErrorMessage(null);
  if (!super.checkExport()) {
    return false;
  }
  if (getCurrentExportType().equals(JobExportType.PETALSESB)) {
    chkButton.setVisible(false);
    zipOption=null;
    if (isMultiNodes()) {
      setErrorMessage(Messages.getString("String_Node_Str"));
    }
    validateOptionsGroup();
  }
  if (getCurrentExportType().equals(JobExportType.JBOSSESB)) {
    if (isMultiNodes()) {
      setErrorMessage(Messages.getString("String_Node_Str"));
    }
    String requiredJar="String_Node_Str";
    List<ModuleNeeded> toCheck=ModulesNeededProvider.getModulesNeeded();
    for (    ModuleNeeded current : toCheck) {
      if (requiredJar.equals(current.getModuleName())) {
        if (current.getStatus() == ELibraryInstallStatus.NOT_INSTALLED) {
          StringBuilder buff=new StringBuilder();
          buff.append(Messages.getString("String_Node_Str"));
          buff.append(Messages.getString("String_Node_Str"));
          setErrorMessage(buff.toString());
          break;
        }
      }
    }
  }
  if (getCurrentExportType().equals(JobExportType.OSGI)) {
    if (isMultiNodes()) {
      setErrorMessage("String_Node_Str");
    }
  }
  if (getCheckNodes().length == 0) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
  boolean noError=getErrorMessage() == null;
  setPageComplete(noError);
  return noError;
}

Fixed version (ground truth):
@Override public boolean checkExport(){
  setErrorMessage(null);
  if (!super.checkExport()) {
    return false;
  }
  if (getCurrentExportType1().equals(JobExportType.PETALSESB)) {
    chkButton.setVisible(false);
    zipOption=null;
    if (isMultiNodes()) {
      setErrorMessage(Messages.getString("String_Node_Str"));
    }
    validateOptionsGroup();
  }
  if (getCurrentExportType1().equals(JobExportType.JBOSSESB)) {
    if (isMultiNodes()) {
      setErrorMessage(Messages.getString("String_Node_Str"));
    }
    String requiredJar="String_Node_Str";
    List<ModuleNeeded> toCheck=ModulesNeededProvider.getModulesNeeded();
    for (    ModuleNeeded current : toCheck) {
      if (requiredJar.equals(current.getModuleName())) {
        if (current.getStatus() == ELibraryInstallStatus.NOT_INSTALLED) {
          StringBuilder buff=new StringBuilder();
          buff.append(Messages.getString("String_Node_Str"));
          buff.append(Messages.getString("String_Node_Str"));
          setErrorMessage(buff.toString());
          break;
        }
      }
    }
  }
  if (getCurrentExportType1().equals(JobExportType.OSGI)) {
    if (isMultiNodes()) {
      setErrorMessage("String_Node_Str");
    }
  }
  if (getCheckNodes().length == 0) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
  boolean noError=getErrorMessage() == null;
  setPageComplete(noError);
  return noError;
}
Program: 124029
Project: 124029
Buggy source:
/** 
 * DOC smallet Comment method "afterImportAs".
 * @param newName
 * @param technicalName
 * @throws InvocationTargetException
 */
private static void afterImportAs(String newName,String technicalName) throws InvocationTargetException {
  final IWorkspace workspace=org.eclipse.core.resources.ResourcesPlugin.getWorkspace();
  IContainer containers=(IProject)workspace.getRoot().findMember(new Path(technicalName));
  IResource file2=containers.findMember(IProjectDescription.DESCRIPTION_FILE_NAME);
  try {
    FilesUtils.replaceInFile("String_Node_Str",file2.getLocation().toOSString(),"String_Node_Str" + technicalName + "String_Node_Str");
    IResource file3=containers.findMember(OLD_TALEND_PROJECT_FILE_NAME);
    if (file3 == null || !file3.exists()) {
      file3=containers.findMember(TALEND_PROJECT_FILE_NAME);
    }
    replaceInFile("String_Node_Str",file3.getLocation().toOSString(),"String_Node_Str" + newName + "String_Node_Str");
    replaceInFile("String_Node_Str",file3.getLocation().toOSString(),"String_Node_Str" + technicalName + "String_Node_Str");
  }
 catch (  IOException e) {
    throw new InvocationTargetException(e);
  }
}

Fixed version (ground truth):
/** 
 * DOC smallet Comment method "afterImportAs".
 * @param newName
 * @param technicalName
 * @throws InvocationTargetException
 */
private static void afterImportAs(String newName,String technicalName) throws InvocationTargetException {
  final IWorkspace workspace=org.eclipse.core.resources.ResourcesPlugin.getWorkspace();
  IContainer containers=(IProject)workspace.getRoot().findMember(new Path(technicalName));
  IResource file2=containers.findMember(IProjectDescription.DESCRIPTION_FILE_NAME);
  try {
    FilesUtils.replaceInFile("String_Node_Str",file2.getLocation().toOSString(),"String_Node_Str" + technicalName + "String_Node_Str");
    IResource file3=containers.findMember(OLD_TALEND_PROJECT_FILE_NAME);
    if (file3 == null || !file3.exists()) {
      file3=containers.findMember(TALEND_PROJECT_FILE_NAME);
    }
    replaceInFile("String_Node_Str",file3.getLocation().toOSString(),"String_Node_Str" + newName + "String_Node_Str");
    replaceInFile("String_Node_Str",file3.getLocation().toOSString(),"String_Node_Str" + technicalName + "String_Node_Str");
    final IProject project=workspace.getRoot().getProject(technicalName);
    XmiResourceManager xmiManager=new XmiResourceManager();
    try {
      final Project loadProject=xmiManager.loadProject(project);
      loadProject.setLocal(true);
      xmiManager.saveResource(loadProject.eResource());
    }
 catch (    PersistenceException e) {
    }
  }
 catch (  IOException e) {
    throw new InvocationTargetException(e);
  }
}
Program: 124030
Project: 124030
Buggy source:
private boolean collectProjectFilesFromDirectory(Collection files,File directory,Set directoriesVisited){
  File[] contents=directory.listFiles();
  if (contents == null)   return false;
  if (directoriesVisited == null) {
    directoriesVisited=new HashSet();
    try {
      directoriesVisited.add(directory.getCanonicalPath());
    }
 catch (    IOException exception) {
      StatusManager.getManager().handle(StatusUtil.newStatus(IStatus.ERROR,exception.getLocalizedMessage(),exception));
    }
  }
  final String dotProject="String_Node_Str";
  for (int i=0; i < contents.length; i++) {
    File file=contents[i];
    if (file.isFile() && file.getName().equals(dotProject)) {
      files.add(file);
      return true;
    }
  }
  for (int i=0; i < contents.length; i++) {
    if (contents[i].isDirectory()) {
      if (!contents[i].getName().equals(METADATA_FOLDER)) {
        try {
          String canonicalPath=contents[i].getCanonicalPath();
          if (!directoriesVisited.add(canonicalPath)) {
            continue;
          }
        }
 catch (        IOException exception) {
          StatusManager.getManager().handle(StatusUtil.newStatus(IStatus.ERROR,exception.getLocalizedMessage(),exception));
        }
        collectProjectFilesFromDirectory(files,contents[i],directoriesVisited);
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean collectProjectFilesFromDirectory(Collection files,File directory,Set directoriesVisited){
  File[] contents=directory.listFiles();
  if (contents == null)   return false;
  if (directoriesVisited == null) {
    directoriesVisited=new HashSet();
    try {
      directoriesVisited.add(directory.getCanonicalPath());
    }
 catch (    IOException exception) {
      StatusManager.getManager().handle(StatusUtil.newStatus(IStatus.ERROR,exception.getLocalizedMessage(),exception));
    }
  }
  final String dotProject=TALEND_PROJECT;
  for (int i=0; i < contents.length; i++) {
    File file=contents[i];
    if (file.isFile() && file.getName().equals(dotProject)) {
      files.add(file);
      return true;
    }
  }
  for (int i=0; i < contents.length; i++) {
    if (contents[i].isDirectory()) {
      if (!contents[i].getName().equals(METADATA_FOLDER)) {
        try {
          String canonicalPath=contents[i].getCanonicalPath();
          if (!directoriesVisited.add(canonicalPath)) {
            continue;
          }
        }
 catch (        IOException exception) {
          StatusManager.getManager().handle(StatusUtil.newStatus(IStatus.ERROR,exception.getLocalizedMessage(),exception));
        }
        collectProjectFilesFromDirectory(files,contents[i],directoriesVisited);
      }
    }
  }
  return true;
}