nus-yam/ex-repair huggingface dataset:
Program: 129664
Project: 129664
Buggy source:
@Override protected void doRun(){
  if (sourceNode == null) {
    return;
  }
  Property property=(Property)sourceNode.getObject().getProperty();
  Property updatedProperty=null;
  try {
    updatedProperty=ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(property.getItem())),property.getId()).getProperty();
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  String initNameValue="String_Node_Str" + sourceNode.getObject().getProperty().getItem().getProperty().getLabel();
  CopyObjectAction copyObjectAction=CopyObjectAction.getInstance();
  final TreeSelection selectionInClipboard=(TreeSelection)selection;
  promptForSavingIfNecessary((RepositoryNode)selection.getFirstElement());
  String jobNameValue=null;
  try {
    jobNameValue=getDuplicateName(initNameValue,selectionInClipboard);
  }
 catch (  BusinessException e) {
    jobNameValue="String_Node_Str";
  }
  InputDialog jobNewNameDialog=new InputDialog(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),jobNameValue,new IInputValidator(){
    public String isValid(    String newText){
      return validJobName(newText,selectionInClipboard);
    }
  }
);
  if (jobNewNameDialog.open() != Dialog.OK) {
    return;
  }
  String jobNewName=jobNewNameDialog.getValue();
  createOperation(jobNewName,sourceNode,copyObjectAction,selectionInClipboard);
  RepositoryManager.refreshCreatedNode(sourceNode.getObjectType());
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (sourceNode == null) {
    return;
  }
  Property property=sourceNode.getObject().getProperty();
  Property updatedProperty=null;
  try {
    updatedProperty=ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(property.getItem())),property.getId()).getProperty();
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  String initNameValue="String_Node_Str" + sourceNode.getObject().getProperty().getItem().getProperty().getLabel();
  CopyObjectAction copyObjectAction=CopyObjectAction.getInstance();
  final TreeSelection selectionInClipboard=(TreeSelection)selection;
  promptForSavingIfNecessary((RepositoryNode)selection.getFirstElement());
  String jobNameValue=null;
  try {
    jobNameValue=getDuplicateName(initNameValue,selectionInClipboard);
  }
 catch (  BusinessException e) {
    jobNameValue="String_Node_Str";
  }
  InputDialog jobNewNameDialog=new InputDialog(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),jobNameValue,new IInputValidator(){
    public String isValid(    String newText){
      return validJobName(newText,selectionInClipboard);
    }
  }
);
  if (jobNewNameDialog.open() != Dialog.OK) {
    return;
  }
  String jobNewName=jobNewNameDialog.getValue();
  createOperation(jobNewName,sourceNode,copyObjectAction,selectionInClipboard);
}
Program: 129665
Project: 129665
Buggy source:
private void addExtensionRepositoryNodes(List<ERepositoryObjectType> arraysList){
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  for (int i=0; i < configurationElements.length; i++) {
    IConfigurationElement element=configurationElements[i];
    String type=element.getAttribute("String_Node_Str");
    ERepositoryObjectType repositoryNodeType=(ERepositoryObjectType)ERepositoryObjectType.valueOf(ERepositoryObjectType.class,type);
    if (repositoryNodeType != null) {
      arraysList.add(repositoryNodeType);
    }
  }
}

Fixed version (ground truth):
private void addExtensionRepositoryNodes(List<ERepositoryObjectType> arraysList){
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  for (int i=0; i < configurationElements.length; i++) {
    IConfigurationElement element=configurationElements[i];
    String type=element.getAttribute("String_Node_Str");
    ERepositoryObjectType repositoryNodeType=ERepositoryObjectType.valueOf(ERepositoryObjectType.class,type);
    if (repositoryNodeType != null) {
      arraysList.add(repositoryNodeType);
    }
  }
}
Program: 129666
Project: 129666
Buggy source:
private void duplicateSingleVersionItem(final Item item,final IPath path,final String newName){
  RepositoryWorkUnit<Object> rwu=new RepositoryWorkUnit<Object>(this.getText(),this){
    @Override protected void run() throws LoginException, PersistenceException {
      try {
        final Item newItem=factory.copy(item,path,true);
        newItem.getProperty().setLabel(newName);
        newItem.getProperty().setDisplayName(newName);
        if (newItem instanceof RoutineItem) {
          synDuplicatedRoutine((RoutineItem)newItem);
        }
        ICamelDesignerCoreService service=null;
        if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
          service=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
        }
        if (service != null && service.isInstanceofCamelBeans(item)) {
          synDuplicatedBean(newItem);
        }
        if (newItem instanceof ProcessItem) {
          RelationshipItemBuilder.getInstance().addOrUpdateItem((ProcessItem)newItem);
        }
        if (newItem instanceof ConnectionItem) {
          ConnectionItem connectionItem=(ConnectionItem)newItem;
          connectionItem.getConnection().getSupplierDependency().clear();
        }
        factory.save(newItem);
      }
 catch (      Exception e) {
        ExceptionHandler.process(e);
      }
    }
  }
;
  rwu.setAvoidUnloadResources(true);
  factory.executeRepositoryWorkUnit(rwu);
}

Fixed version (ground truth):
private void duplicateSingleVersionItem(final Item item,final IPath path,final String newName){
  RepositoryWorkUnit<Object> rwu=new RepositoryWorkUnit<Object>(this.getText(),this){
    @Override protected void run() throws LoginException, PersistenceException {
      try {
        final Item newItem=factory.copy(item,path,true);
        newItem.getProperty().setLabel(newName);
        newItem.getProperty().setDisplayName(newName);
        if (newItem instanceof RoutineItem) {
          synDuplicatedRoutine((RoutineItem)newItem);
        }
        ICamelDesignerCoreService service=null;
        if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
          service=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
        }
        if (service != null && service.isInstanceofCamelBeans(item)) {
          synDuplicatedBean(newItem);
        }
        if (newItem instanceof ProcessItem) {
          RelationshipItemBuilder.getInstance().addOrUpdateItem(newItem);
        }
        if (newItem instanceof ConnectionItem) {
          ConnectionItem connectionItem=(ConnectionItem)newItem;
          connectionItem.getConnection().getSupplierDependency().clear();
        }
        factory.save(newItem);
      }
 catch (      Exception e) {
        ExceptionHandler.process(e);
      }
    }
  }
;
  rwu.setAvoidUnloadResources(true);
  factory.executeRepositoryWorkUnit(rwu);
}
Program: 129668
Project: 129668
Buggy source:
/** 
 * ggu Comment method "refreshRelations". bug 12883
 */
private void refreshRelations(){
  if (!DeleteActionCache.getInstance().isDocRefresh()) {
    RepositoryManager.refreshCreatedNode(ERepositoryObjectType.DOCUMENTATION);
  }
  RepositoryManager.refreshDeletedNode(null);
  IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (activeWorkbenchWindow != null && GlobalServiceRegister.getDefault().isServiceRegistered(IDiagramModelService.class)) {
    IWorkbenchPage page=activeWorkbenchWindow.getActivePage();
    IDiagramModelService sevice=(IDiagramModelService)GlobalServiceRegister.getDefault().getService(IDiagramModelService.class);
    if (page != null && sevice != null) {
      for (      IEditorReference editors : page.getEditorReferences()) {
        sevice.refreshBusinessModel(editors);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * ggu Comment method "refreshRelations". bug 12883
 */
private void refreshRelations(){
  RepositoryManager.refreshDeletedNode(null);
  IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (activeWorkbenchWindow != null && GlobalServiceRegister.getDefault().isServiceRegistered(IDiagramModelService.class)) {
    IWorkbenchPage page=activeWorkbenchWindow.getActivePage();
    IDiagramModelService sevice=(IDiagramModelService)GlobalServiceRegister.getDefault().getService(IDiagramModelService.class);
    if (page != null && sevice != null) {
      for (      IEditorReference editors : page.getEditorReferences()) {
        sevice.refreshBusinessModel(editors);
      }
    }
  }
}
Program: 129669
Project: 129669
Buggy source:
@Override protected void doRun(){
  IStructuredSelection selection=(IStructuredSelection)getSelection();
  RepositoryNode target=(RepositoryNode)selection.getFirstElement();
  CopyObjectAction copyObjectAction=CopyObjectAction.getInstance();
  TreeSelection selectionInClipboard=(TreeSelection)LocalSelectionTransfer.getTransfer().getSelection();
  if (selectionInClipboard != null) {
    for (    Object currentSource : selectionInClipboard.toArray()) {
      try {
        if (copyObjectAction.validateAction((RepositoryNode)currentSource,target)) {
          copyObjectAction.execute((RepositoryNode)currentSource,target);
        }
 else {
          MessageDialog.openWarning(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
        }
      }
 catch (      BusinessException e) {
        MessageBoxExceptionHandler.process(e);
      }
catch (      Exception e) {
        ExceptionHandler.process(e);
      }
    }
    ERepositoryObjectType contentType=target.getContentType();
    if (contentType == null) {
      contentType=target.getObjectType();
    }
    RepositoryManager.refreshCreatedNode(contentType);
    if (contentType.equals(ERepositoryObjectType.METADATA_CON_TABLE)) {
      RepositoryManager.refreshCreatedNode(ERepositoryObjectType.METADATA_CONNECTIONS);
    }
    RepositoryManager.refreshCreatedNode(target.getContentType());
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  IStructuredSelection selection=(IStructuredSelection)getSelection();
  RepositoryNode target=(RepositoryNode)selection.getFirstElement();
  CopyObjectAction copyObjectAction=CopyObjectAction.getInstance();
  TreeSelection selectionInClipboard=(TreeSelection)LocalSelectionTransfer.getTransfer().getSelection();
  if (selectionInClipboard != null) {
    for (    Object currentSource : selectionInClipboard.toArray()) {
      try {
        if (copyObjectAction.validateAction((RepositoryNode)currentSource,target)) {
          copyObjectAction.execute((RepositoryNode)currentSource,target);
        }
 else {
          MessageDialog.openWarning(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
        }
      }
 catch (      BusinessException e) {
        MessageBoxExceptionHandler.process(e);
      }
catch (      Exception e) {
        ExceptionHandler.process(e);
      }
    }
    ERepositoryObjectType contentType=target.getContentType();
    if (contentType == null) {
      contentType=target.getObjectType();
    }
  }
}
Program: 129670
Project: 129670
Buggy source:
/** 
 * Getter for visible.
 * @return the visible
 */
public boolean isVisible(){
  return this.visible;
}

Fixed version (ground truth):
/** 
 * Getter for visible.
 * @return the visible
 */
@Override public boolean isVisible(){
  return this.visible;
}
Program: 129673
Project: 129673
Buggy source:
public ConnectionItem getConnectionItem(){
  return this.connectionItem;
}

Fixed version (ground truth):
@Override public ConnectionItem getConnectionItem(){
  return this.connectionItem;
}
Program: 129676
Project: 129676
Buggy source:
@Override public Saveable[] getSaveables(){
  return null;
}

Fixed version (ground truth):
@Override public Saveable[] getSaveables(){
  return new Saveable[0];
}
Program: 129680
Project: 129680
Buggy source:
@Override public void onFinish(ITestContext testContext){
  try {
    if (testCaseScreenRecorder != null) {
      testCaseScreenRecorder.stop();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    testCaseScreenRecorder=null;
  }
  super.onFinish(testContext);
}

Fixed version (ground truth):
@Override public void onFinish(ITestContext testContext){
  try {
    if (testCaseScreenRecorder != null && testCaseScreenRecorder.getState() == State.RECORDING) {
      testCaseScreenRecorder.stop();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    testCaseScreenRecorder=null;
  }
  super.onFinish(testContext);
}
Program: 129682
Project: 129682
Buggy source:
@Override protected void okPressed(){
  IPreferenceStore preferenceStore=getPreferenceStore();
  final List<String> filteredContents=getFilteredContents();
  String relust=convertToString(filteredContents,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_NODE,relust.length() > 2 ? relust.substring(0,relust.length() - 2) : relust);
  String status=convertToString(uncheckedStatus,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_STATUS,status.length() > 2 ? status.substring(0,status.length() - 2) : status);
  String users=convertToString(uncheckedUser,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_USER,users.length() > 2 ? users.substring(0,users.length() - 2) : users);
  boolean canUserFilterEnable=this.userFilterPattern.getText() != null && !"String_Node_Str".equals(this.userFilterPattern.getText());
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_NAME,this.userFilterPattern.getText());
  preferenceStore.setValue(IRepositoryPrefConstants.TAG_USER_DEFINED_PATTERNS_ENABLED,this.enableUserPatternBtn.getSelection() && canUserFilterEnable);
  preferenceStore.setValue(IRepositoryPrefConstants.USER_FILTER_TABLE_ENABLED,!allUsersBtn.getSelection());
  super.okPressed();
  RepositoryNodeFilterHelper.filter(actionSite,isActivedFilter(),false);
}

Fixed version (ground truth):
@Override protected void okPressed(){
  IPreferenceStore preferenceStore=getPreferenceStore();
  final List<String> filteredContents=getFilteredContents();
  String relust=convertToString(filteredContents,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_NODE,relust.length() > 2 ? relust.substring(0,relust.length() - 2) : relust);
  String status=convertToString(uncheckedStatus,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_STATUS,status.length() > 2 ? status.substring(0,status.length() - 2) : status);
  String users=convertToString(uncheckedUser,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_USER,users.length() > 2 ? users.substring(0,users.length() - 2) : users);
  boolean canUserFilterEnable=this.userFilterPattern.getText() != null && !"String_Node_Str".equals(this.userFilterPattern.getText());
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_NAME,this.userFilterPattern.getText());
  preferenceStore.setValue(IRepositoryPrefConstants.TAG_USER_DEFINED_PATTERNS_ENABLED,this.enableUserPatternBtn.getSelection() && canUserFilterEnable);
  preferenceStore.setValue(IRepositoryPrefConstants.USER_FILTER_TABLE_ENABLED,!allUsersBtn.getSelection());
  super.okPressed();
  RepositoryNodeFilterHelper.filter(actionSite,isActivedFilter(),isPerspectiveFilter(),false);
}
Program: 129683
Project: 129683
Buggy source:
public RepositoryFilterSettingDialog(final ICommonActionExtensionSite actionSite,final boolean activedFilter){
  super(actionSite.getViewSite().getShell());
  setShellStyle(getShellStyle() | SWT.MAX | SWT.MIN| SWT.RESIZE| SWT.APPLICATION_MODAL);
  this.actionSite=actionSite;
  this.activedFilter=activedFilter;
}

Fixed version (ground truth):
public RepositoryFilterSettingDialog(final ICommonActionExtensionSite actionSite,final boolean activedFilter,boolean isPerspectiveFilter){
  super(actionSite.getViewSite().getShell());
  setShellStyle(getShellStyle() | SWT.MAX | SWT.MIN| SWT.RESIZE| SWT.APPLICATION_MODAL);
  this.actionSite=actionSite;
  this.activedFilter=activedFilter;
  this.isPerspectiveFilter=isPerspectiveFilter;
}
Program: 129684
Project: 129684
Buggy source:
@Override public void restoreState(IMemento aMemento){
  super.restoreState(aMemento);
  doFiltering(isActivedFilter(),true);
}

Fixed version (ground truth):
@Override public void restoreState(IMemento aMemento){
  super.restoreState(aMemento);
  if (aMemento != null) {
    Integer isFilteringInt=aMemento.getInteger(IS_FILTERING_WITH_PERSPECTIVE);
    if (isFilteringInt != null) {
      isPerspectiveFiltering=isFilteringInt.intValue() == 1;
    }
  }
  doFiltering(isActivedFilter(),true);
}
Program: 129685
Project: 129685
Buggy source:
private void doFiltering(boolean filtering,boolean restoring){
  RepositoryNodeFilterHelper.filter(this.getActionSite(),filtering,restoring);
}

Fixed version (ground truth):
private void doFiltering(boolean filtering,boolean restoring){
  RepositoryNodeFilterHelper.filter(this.getActionSite(),filtering,isPerspectiveFiltering,restoring);
}
Program: 129686
Project: 129686
Buggy source:
@Override public void run(){
  super.run();
  final ICommonActionExtensionSite actionSite=RepositoryFilterSettingActionProvider.this.getActionSite();
  RepositoryFilterSettingDialog dialog=new RepositoryFilterSettingDialog(actionSite,isActivedFilter());
  if (dialog.open() == Window.OK) {
    actionSite.getStructuredViewer().refresh();
  }
}

Fixed version (ground truth):
@Override public void run(){
  super.run();
  final ICommonActionExtensionSite actionSite=RepositoryFilterSettingActionProvider.this.getActionSite();
  RepositoryFilterSettingDialog dialog=new RepositoryFilterSettingDialog(actionSite,isActivedFilter(),isPecpectiveFiltering);
  if (dialog.open() == Window.OK) {
    actionSite.getStructuredViewer().refresh();
  }
}
Program: 129687
Project: 129687
Buggy source:
public static void filter(final ICommonActionExtensionSite commonActionSite,boolean activedFilter,boolean restoring){
  processContentExtensions(commonActionSite,activedFilter);
  processCommonFilters(commonActionSite,activedFilter);
}

Fixed version (ground truth):
public static void filter(final ICommonActionExtensionSite commonActionSite,boolean activedFilter,boolean isPerspectiveFilter,boolean restoring){
  processContentExtensions(commonActionSite,activedFilter,isPerspectiveFilter);
  processCommonFilters(commonActionSite,activedFilter);
}
Program: 129689
Project: 129689
Buggy source:
/** 
 * TableForm Constructor to use by RCP Wizard.
 * @param parent
 * @param connection
 * @param page
 * @param metadataTable
 * @param page
 * @param managerConnection2
 */
public DatabaseTableForm(Composite parent,ConnectionItem connectionItem,MetadataTable metadataTable,ManagerConnection managerConnection,IWizardPage page,DatabaseConnection temConnection,IMetadataConnection metadataconnection){
  super(parent,SWT.NONE);
  this.managerConnection=managerConnection;
  this.connectionItem=connectionItem;
  this.parentWizardPage=page;
  this.temConnection=temConnection;
  this.metadataTable=metadataTable;
  this.metadataconnection=metadataconnection;
  final Set<MetadataTable> tables=ConnectionHelper.getTables(temConnection);
  for (  MetadataTable t : tables) {
    if (metadataTable != null && t.getLabel().equals(metadataTable.getLabel())) {
      this.metadataTable=t;
      break;
    }
  }
  this.typeName=EDatabaseTypeName.getTypeFromDbType(metadataconnection.getDbType());
  if (typeName != null && typeName.isUseProvider()) {
    this.provider=ExtractMetaDataFromDataBase.getProviderByDbType(metadataconnection.getDbType());
  }
  setupForm();
}

Fixed version (ground truth):
/** 
 * TableForm Constructor to use by RCP Wizard.
 * @param parent
 * @param connection
 * @param page
 * @param metadataTable
 * @param page
 * @param managerConnection2
 */
public DatabaseTableForm(Composite parent,ConnectionItem connectionItem,MetadataTable metadataTable,ManagerConnection managerConnection,IWizardPage page,DatabaseConnection temConnection,IMetadataConnection metadataconnection){
  super(parent,SWT.NONE);
  this.managerConnection=managerConnection;
  this.connectionItem=connectionItem;
  this.parentWizardPage=page;
  this.temConnection=temConnection;
  this.metadataTable=metadataTable;
  this.metadataconnection=metadataconnection;
  final Set<MetadataTable> tables=ConnectionHelper.getTables(temConnection);
  for (  MetadataTable t : tables) {
    this.metadataTable=t;
    break;
  }
  this.typeName=EDatabaseTypeName.getTypeFromDbType(metadataconnection.getDbType());
  if (typeName != null && typeName.isUseProvider()) {
    this.provider=ExtractMetaDataFromDataBase.getProviderByDbType(metadataconnection.getDbType());
  }
  setupForm();
}
Program: 129692
Project: 129692
Buggy source:
/** 
 * TableForm Constructor to use by RCP Wizard.
 * @param parent
 * @param connection
 * @param page
 * @param metadataTable
 * @param page
 * @param managerConnection2
 */
public DatabaseTableForm(Composite parent,ConnectionItem connectionItem,MetadataTable metadataTable,ManagerConnection managerConnection,IWizardPage page,DatabaseConnection temConnection,IMetadataConnection metadataconnection){
  super(parent,SWT.NONE);
  this.managerConnection=managerConnection;
  this.connectionItem=connectionItem;
  this.parentWizardPage=page;
  this.temConnection=temConnection;
  this.metadataTable=metadataTable;
  this.metadataconnection=metadataconnection;
  final Set<MetadataTable> tables=ConnectionHelper.getTables(temConnection);
  for (  MetadataTable t : tables) {
    if (metadataTable != null && t.getLabel().equals(metadataTable.getLabel())) {
      this.metadataTable=t;
      break;
    }
  }
  this.typeName=EDatabaseTypeName.getTypeFromDbType(metadataconnection.getDbType());
  if (typeName != null && typeName.isUseProvider()) {
    this.provider=ExtractMetaDataFromDataBase.getProviderByDbType(metadataconnection.getDbType());
  }
  setupForm();
}

Fixed version (ground truth):
/** 
 * TableForm Constructor to use by RCP Wizard.
 * @param parent
 * @param connection
 * @param page
 * @param metadataTable
 * @param page
 * @param managerConnection2
 */
public DatabaseTableForm(Composite parent,ConnectionItem connectionItem,MetadataTable metadataTable,ManagerConnection managerConnection,IWizardPage page,DatabaseConnection temConnection,IMetadataConnection metadataconnection){
  super(parent,SWT.NONE);
  this.managerConnection=managerConnection;
  this.connectionItem=connectionItem;
  this.parentWizardPage=page;
  this.temConnection=temConnection;
  this.metadataTable=metadataTable;
  this.metadataconnection=metadataconnection;
  final Set<MetadataTable> tables=ConnectionHelper.getTables(temConnection);
  for (  MetadataTable t : tables) {
    this.metadataTable=t;
    break;
  }
  this.typeName=EDatabaseTypeName.getTypeFromDbType(metadataconnection.getDbType());
  if (typeName != null && typeName.isUseProvider()) {
    this.provider=ExtractMetaDataFromDataBase.getProviderByDbType(metadataconnection.getDbType());
  }
  setupForm();
}
Program: 129693
Project: 129693
Buggy source:
@Override public void onFinish(ITestContext testContext){
  System.out.println("String_Node_Str");
  try {
    System.out.println("String_Node_Str");
    if (testCaseScreenRecorder != null) {
      testCaseScreenRecorder.stop();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    testCaseScreenRecorder=null;
  }
  super.onFinish(testContext);
}

Fixed version (ground truth):
@Override public void onFinish(ITestContext testContext){
  try {
    if (testCaseScreenRecorder != null) {
      testCaseScreenRecorder.stop();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    testCaseScreenRecorder=null;
  }
  super.onFinish(testContext);
}
Program: 129695
Project: 129695
Buggy source:
@Override public void onTestStart(ITestResult tr){
  String testCaseInfo=this.getTestCaseInfo(tr);
  try {
    testCaseScreenRecorder=testCaseRecorder.getScreenRecorder(getAbsoluteFolderPath("String_Node_Str") + "String_Node_Str" + testCaseInfo);
    logger.info(getAbsoluteFolderPath("String_Node_Str") + "String_Node_Str" + testCaseInfo);
  }
 catch (  Exception e) {
    logger.info(e.getMessage());
    e.printStackTrace();
  }
  if (testCaseScreenRecorder == null) {
{
      logger.info("String_Node_Str");
    }
  }
  super.onTestStart(tr);
}

Fixed version (ground truth):
@Override public void onTestStart(ITestResult tr){
  String testCaseInfo=this.getTestCaseInfo(tr);
  try {
    testCaseScreenRecorder=testCaseRecorder.getScreenRecorder(getAbsoluteFolderPath("String_Node_Str") + "String_Node_Str" + testCaseInfo);
    logger.info(getAbsoluteFolderPath("String_Node_Str") + "String_Node_Str" + testCaseInfo);
    if (testCaseScreenRecorder == null) {
      logger.info("String_Node_Str");
    }
    testCaseScreenRecorder.start();
  }
 catch (  Exception e) {
    logger.info(e.getMessage());
    e.printStackTrace();
  }
  super.onTestStart(tr);
}
Program: 129696
Project: 129696
Buggy source:
public void deleteFolder(Project project,ERepositoryObjectType type,IPath path,boolean fromEmptyRecycleBin) throws PersistenceException {
  if (RepositoryConstants.isSystemFolder(path.toString()) || RepositoryConstants.isGeneratedFolder(path.toString()) || RepositoryConstants.isJobsFolder(path.toString())|| RepositoryConstants.isJobletsFolder(path.toString())) {
    return;
  }
  IProject fsProject=ResourceModelUtils.getProject(project);
  String completePath=new Path(ERepositoryObjectType.getFolderName(type)).append(path).toString();
  IFolder folder=ResourceUtils.getFolder(fsProject,completePath,true);
  getFolderHelper(project.getEmfProject()).deleteFolder(completePath);
  if (!fromEmptyRecycleBin) {
    saveProject(project);
  }
  ResourceUtils.deleteResource(folder);
}

Fixed version (ground truth):
public void deleteFolder(Project project,ERepositoryObjectType type,IPath path,boolean fromEmptyRecycleBin) throws PersistenceException {
  if (RepositoryConstants.isSystemFolder(path.toString()) || RepositoryConstants.isGeneratedFolder(path.toString()) || RepositoryConstants.isJobsFolder(path.toString())|| RepositoryConstants.isJobletsFolder(path.toString())) {
    return;
  }
  IProject fsProject=ResourceModelUtils.getProject(project);
  String completePath=new Path(ERepositoryObjectType.getFolderName(type)).append(path).toString();
  IFolder folder=ResourceUtils.getFolder(fsProject,completePath,true);
  ResourceUtils.deleteResource(folder);
  getFolderHelper(project.getEmfProject()).deleteFolder(completePath);
  if (!fromEmptyRecycleBin) {
    saveProject(project);
  }
}
Program: 129697
Project: 129697
Buggy source:
/** 
 * This calls the refresh of the toplevel node, this must be invoke from the UI thread.
 * @param topLevelNode
 */
protected void refreshTopLevelNode(){
  RepositoryNode topLevelNode=getTopLevelNode();
  if (topLevelNode != null) {
    if (isReInit()) {
      topLevelNode.setInitialized(false);
      topLevelNode.getChildren().clear();
    }
    beforeRefreshTopLevelNode();
    if (topLevelNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)topLevelNode.getParent()).clearNodeAndProjectCash();
    }
    viewer.refresh(topLevelNode);
  }
}

Fixed version (ground truth):
/** 
 * This calls the refresh of the toplevel node, this must be invoke from the UI thread.
 * @param topLevelNode
 */
protected void refreshTopLevelNode(){
  RepositoryNode topLevelNode=getTopLevelNode();
  if (topLevelNode != null) {
    if (isReInit()) {
      topLevelNode.setInitialized(false);
      topLevelNode.getChildren().clear();
    }
    beforeRefreshTopLevelNode();
    if (topLevelNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)topLevelNode.getParent()).clearNodeAndProjectCash();
    }
    if (viewer != null) {
      viewer.refresh(topLevelNode);
    }
  }
}
Program: 129698
Project: 129698
Buggy source:
@Override public void inputChanged(Viewer arg0,Object arg1,Object arg2){
  this.viewer=(CommonViewer)arg0;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  if (workspace != null) {
    if (resouceChangeVisitor != null) {
      workspace.removeResourceChangeListener(resouceChangeVisitor);
    }
    resouceChangeVisitor=createResourceChangedVisitor();
    workspace.addResourceChangeListener(resouceChangeVisitor,IResourceChangeEvent.POST_CHANGE);
  }
}

Fixed version (ground truth):
@Override public void inputChanged(Viewer arg0,Object arg1,Object arg2){
  if (arg0 instanceof CommonViewer) {
    this.viewer=(CommonViewer)arg0;
  }
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  if (workspace != null) {
    if (resouceChangeVisitor != null) {
      workspace.removeResourceChangeListener(resouceChangeVisitor);
    }
    resouceChangeVisitor=createResourceChangedVisitor();
    workspace.addResourceChangeListener(resouceChangeVisitor,IResourceChangeEvent.POST_CHANGE);
  }
}
Program: 129699
Project: 129699
Buggy source:
@Override public void notifyChanged(Notification notification){
  if (notification.getFeature() == PropertiesPackage.eINSTANCE.getProject_DeletedFolders()) {
    if (viewer.getControl() != null) {
      viewer.getControl().getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          refreshTopLevelNode();
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  if (notification.getFeature() == PropertiesPackage.eINSTANCE.getProject_DeletedFolders()) {
    if (viewer != null && viewer.getControl() != null) {
      viewer.getControl().getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          refreshTopLevelNode();
        }
      }
);
    }
  }
}
Program: 129700
Project: 129700
Buggy source:
@Override public void resourceChanged(IResourceChangeEvent event){
  final Control ctrl=viewer.getControl();
  if (ctrl == null || ctrl.isDisposed()) {
    return;
  }
  final Collection<Runnable> runnables=new ArrayList<Runnable>();
  visitor.setRunnables(runnables);
  try {
    event.getDelta().accept(visitor);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  if (!runnables.isEmpty()) {
    if (ctrl.getDisplay().getThread() == Thread.currentThread()) {
      runUpdates(runnables);
    }
 else {
      ctrl.getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          Control ctrl2=viewer.getControl();
          if (ctrl2 == null || ctrl2.isDisposed()) {
            return;
          }
          runUpdates(runnables);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override public void resourceChanged(IResourceChangeEvent event){
  if (viewer == null) {
    return;
  }
  final Control ctrl=viewer.getControl();
  if (ctrl == null || ctrl.isDisposed()) {
    return;
  }
  final Collection<Runnable> runnables=new ArrayList<Runnable>();
  visitor.setRunnables(runnables);
  try {
    event.getDelta().accept(visitor);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  if (!runnables.isEmpty()) {
    if (ctrl.getDisplay().getThread() == Thread.currentThread()) {
      runUpdates(runnables);
    }
 else {
      ctrl.getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          Control ctrl2=viewer.getControl();
          if (ctrl2 == null || ctrl2.isDisposed()) {
            return;
          }
          runUpdates(runnables);
        }
      }
);
    }
  }
}
Program: 129701
Project: 129701
Buggy source:
@Override public void init(ICommonActionExtensionSite aSite){
  super.init(aSite);
  helper.setCommonViewer(getCommonViewer());
  helper.setNavigatorContentService(getNavigatorContentService());
  helper.setActionProviderId(this.getActionSite().getExtensionId());
}

Fixed version (ground truth):
@Override public void init(ICommonActionExtensionSite aSite){
  super.init(aSite);
  helper.setTreeViewer(getCommonViewer());
  helper.setNavigatorContentService(getNavigatorContentService());
  helper.setActionProviderId(this.getActionSite().getExtensionId());
}
Program: 129703
Project: 129703
Buggy source:
/** 
 * DOC ocarbone Comment method "initTreeNodes".
 */
private void initTreeNavigatorNodes(){
  List<MetadataTable> tables=ConnectionHelper.getTablesWithOrders(getConnection());
  if (metadataTable == null || tables != null && tables.isEmpty()) {
    if (tables != null && !tables.isEmpty()) {
      boolean isAllDeleted=true;
      for (int i=0; i < tables.size(); i++) {
        if (!TableHelper.isDeleted((MetadataTable)tables.toArray()[i])) {
          metadataTable=(MetadataTable)tables.toArray()[i];
          isAllDeleted=false;
        }
      }
      if (isAllDeleted) {
        addMetadataTable(true);
      }
    }
 else {
      addMetadataTable(false);
    }
  }
  tableNavigator.removeAll();
  List<String> tablenames=new ArrayList<String>();
  for (  MetadataTable t : tables) {
    tablenames.add(t.getLabel());
  }
  String[] allTableLabel=tablenames.toArray(new String[0]);
  Arrays.sort(allTableLabel);
  for (int i=0; i < allTableLabel.length; i++) {
    if (allTableLabel[i].equals(metadataTable.getLabel())) {
      TableItem subItem=new TableItem(tableNavigator,SWT.NONE);
      subItem.setText(allTableLabel[i]);
      tableNavigator.setSelection(subItem);
    }
 else     if (!TableHelper.isDeleted(TableHelper.findByLabel(getConnection(),allTableLabel[i]))) {
      TableItem subItem=new TableItem(tableNavigator,SWT.NULL);
      subItem.setText(allTableLabel[i]);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC ocarbone Comment method "initTreeNodes".
 */
private void initTreeNavigatorNodes(){
  List<MetadataTable> tables=ConnectionHelper.getTablesWithOrders(getConnection());
  if (metadataTable == null || tables != null && tables.isEmpty()) {
    if (tables != null && !tables.isEmpty()) {
      boolean isAllDeleted=true;
      for (int i=0; i < tables.size(); i++) {
        if (!TableHelper.isDeleted((MetadataTable)tables.toArray()[i])) {
          metadataTable=(MetadataTable)tables.toArray()[i];
          isAllDeleted=false;
        }
      }
      if (isAllDeleted) {
        addMetadataTable(true);
      }
    }
 else {
      addMetadataTable(false);
    }
  }
  tableNavigator.removeAll();
  List<String> tablenames=new ArrayList<String>();
  for (  MetadataTable t : tables) {
    tablenames.add(t.getLabel());
  }
  String[] allTableLabel=tablenames.toArray(new String[0]);
  Arrays.sort(allTableLabel);
  for (int i=0; i < allTableLabel.length; i++) {
    if (allTableLabel[i].equals(metadataTable.getLabel())) {
      TableItem subItem=new TableItem(tableNavigator,SWT.NONE);
      subItem.setText(allTableLabel[i]);
      tableNavigator.setSelection(subItem);
    }
 else {
      TableItem subItem=new TableItem(tableNavigator,SWT.NULL);
      subItem.setText(allTableLabel[i]);
    }
  }
}
Program: 129705
Project: 129705
Buggy source:
public Set<String> getNeededLibrariesForProcess(IProcess process,boolean withChildrens,boolean... exportAsOSGI);

Fixed version (ground truth):
public Set<ModuleNeeded> getNeededLibrariesForProcess(IProcess process,boolean withChildrens);
Program: 129706
Project: 129706
Buggy source:
/** 
 * @return the modulesNeededPerJob
 */
public Set<String> getModulesNeededPerJob(String jobId,String jobVersion){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (!modulesNeededPerJob.containsKey(key)) {
    modulesNeededPerJob.put(key,new HashSet<String>());
  }
  return modulesNeededPerJob.get(key);
}

Fixed version (ground truth):
/** 
 * @return the modulesNeededPerJob
 */
public Set<ModuleNeeded> getModulesNeededPerJob(String jobId,String jobVersion){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (!modulesNeededPerJob.containsKey(key)) {
    modulesNeededPerJob.put(key,new HashSet<ModuleNeeded>());
  }
  return modulesNeededPerJob.get(key);
}
Program: 129707
Project: 129707
Buggy source:
private LastGenerationInfo(){
  modulesNeededPerJob=new HashMap<String,Set<String>>();
  contextPerJob=new HashMap<String,Set<String>>();
  modulesNeededWithSubjobPerJob=new HashMap<String,Set<String>>();
  lastGeneratedjobs=new HashSet<JobInfo>();
  routinesNeededPerJob=new HashMap<String,Set<String>>();
  routinesNeededWithSubjobPerJob=new HashMap<String,Set<String>>();
  useDynamic=new HashMap<String,Boolean>();
}

Fixed version (ground truth):
private LastGenerationInfo(){
  modulesNeededPerJob=new HashMap<String,Set<ModuleNeeded>>();
  contextPerJob=new HashMap<String,Set<String>>();
  modulesNeededWithSubjobPerJob=new HashMap<String,Set<ModuleNeeded>>();
  lastGeneratedjobs=new HashSet<JobInfo>();
  routinesNeededPerJob=new HashMap<String,Set<String>>();
  routinesNeededWithSubjobPerJob=new HashMap<String,Set<String>>();
  useDynamic=new HashMap<String,Boolean>();
}
Program: 129708
Project: 129708
Buggy source:
/** 
 * Sets the modulesNeededPerJob.
 * @param modulesNeededPerJob the modulesNeededPerJob to set
 */
public void setModulesNeededPerJob(String jobId,String jobVersion,Set<String> modulesNeeded){
  String key=jobId + "String_Node_Str" + jobVersion;
  modulesNeededPerJob.put(key,new HashSet<String>(modulesNeeded));
}

Fixed version (ground truth):
/** 
 * Sets the modulesNeededPerJob.
 * @param modulesNeededPerJob the modulesNeededPerJob to set
 */
public void setModulesNeededPerJob(String jobId,String jobVersion,Set<ModuleNeeded> modulesNeeded){
  String key=jobId + "String_Node_Str" + jobVersion;
  modulesNeededPerJob.put(key,new HashSet<ModuleNeeded>(modulesNeeded));
}
Program: 129709
Project: 129709
Buggy source:
/** 
 * @return the modulesNeededPerJob
 */
public Set<String> getModulesNeededWithSubjobPerJob(String jobId,String jobVersion){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (!modulesNeededWithSubjobPerJob.containsKey(key)) {
    modulesNeededWithSubjobPerJob.put(key,new HashSet<String>());
  }
  return modulesNeededWithSubjobPerJob.get(key);
}

Fixed version (ground truth):
/** 
 * @return the modulesNeededPerJob
 */
public Set<ModuleNeeded> getModulesNeededWithSubjobPerJob(String jobId,String jobVersion){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (!modulesNeededWithSubjobPerJob.containsKey(key)) {
    modulesNeededWithSubjobPerJob.put(key,new HashSet<ModuleNeeded>());
  }
  return modulesNeededWithSubjobPerJob.get(key);
}
Program: 129710
Project: 129710
Buggy source:
/** 
 * Sets the modulesNeededWithSubjobPerJob.
 * @param modulesNeededWithSubjobPerJob the modulesNeededWithSubjobPerJob to set
 */
public void setModulesNeededWithSubjobPerJob(String jobId,String jobVersion,Set<String> modulesNeeded){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (modulesNeeded == null) {
    modulesNeededWithSubjobPerJob.put(key,null);
  }
 else {
    modulesNeededWithSubjobPerJob.put(key,new HashSet<String>(modulesNeeded));
  }
}

Fixed version (ground truth):
/** 
 * Sets the modulesNeededWithSubjobPerJob.
 * @param modulesNeededWithSubjobPerJob the modulesNeededWithSubjobPerJob to set
 */
public void setModulesNeededWithSubjobPerJob(String jobId,String jobVersion,Set<ModuleNeeded> modulesNeeded){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (modulesNeeded == null) {
    modulesNeededWithSubjobPerJob.put(key,null);
  }
 else {
    modulesNeededWithSubjobPerJob.put(key,new HashSet<ModuleNeeded>(modulesNeeded));
  }
}
Program: 129711
Project: 129711
Buggy source:
private static void generateBuildInfo(JobInfo jobInfo,IProgressMonitor progressMonitor,boolean isMainJob,IProcess currentProcess,String currentJobName) throws ProcessorException {
  if (isMainJob) {
    progressMonitor.subTask(Messages.getString("String_Node_Str") + currentJobName);
    CorePlugin.getDefault().getRunProcessService().updateLibraries(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()),currentProcess);
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA && codeModified) {
      try {
        ((IJavaProject)CorePlugin.getDefault().getRunProcessService().getJavaProject()).getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        throw new ProcessorException(e);
      }
    }
    codeModified=false;
  }
}

Fixed version (ground truth):
private static void generateBuildInfo(JobInfo jobInfo,IProgressMonitor progressMonitor,boolean isMainJob,IProcess currentProcess,String currentJobName) throws ProcessorException {
  if (isMainJob) {
    progressMonitor.subTask(Messages.getString("String_Node_Str") + currentJobName);
    Set<String> jarList=new HashSet<String>();
    Set<ModuleNeeded> neededModules=LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion());
    for (    ModuleNeeded module : neededModules) {
      jarList.add(module.getModuleName());
    }
    CorePlugin.getDefault().getRunProcessService().updateLibraries(jarList,currentProcess);
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA && codeModified) {
      try {
        ((IJavaProject)CorePlugin.getDefault().getRunProcessService().getJavaProject()).getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        throw new ProcessorException(e);
      }
    }
    codeModified=false;
  }
}
Program: 129712
Project: 129712
Buggy source:
/** 
 * DOC ocarbone Comment method "addMetadataTable".
 */
protected void addMetadataTable(boolean flag){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
  if (flag) {
    ProjectNodeHelper.addTableForSpecifiedDataPackage(getConnection(),metadataTable);
  }
 else {
    ProjectNodeHelper.addDefaultTableForSpecifiedDataPackage(getConnection(),metadataTable);
  }
  metadataTable.setId(factory.getNextId());
  metadataTable.setLabel(IndiceHelper.getIndexedLabel(metadataTable.getLabel(),existingNames));
  initTreeNavigatorNodes();
  initMetadataForm();
  if (tableCombo.getItemCount() > 0) {
    tableCombo.setEnabled(true);
  }
}

Fixed version (ground truth):
/** 
 * DOC ocarbone Comment method "addMetadataTable".
 */
protected void addMetadataTable(boolean flag){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
  if (flag) {
    ProjectNodeHelper.addTableForSpecifiedDataPackage(getConnection(),metadataTable);
  }
 else {
    ProjectNodeHelper.addDefaultTableForSpecifiedDataPackage(getConnection(),metadataTable);
  }
  metadataTable.setId(factory.getNextId());
  metadataTable.setLabel(IndiceHelper.getIndexedLabel(metadataTable.getLabel(),existingNames));
  metadataTable.setName(metadataTable.getLabel());
  initTreeNavigatorNodes();
  initMetadataForm();
  if (tableCombo.getItemCount() > 0) {
    tableCombo.setEnabled(true);
  }
}
Program: 129713
Project: 129713
Buggy source:
/** 
 * DOC ocarbone Comment method "initTreeNodes".
 */
private void initTreeNavigatorNodes(){
  List<MetadataTable> tables=ConnectionHelper.getTablesWithOrders(getConnection());
  if (metadataTable == null || tables != null && tables.isEmpty()) {
    if (tables != null && !tables.isEmpty()) {
      boolean isAllDeleted=true;
      for (int i=0; i < tables.size(); i++) {
        if (!TableHelper.isDeleted((MetadataTable)tables.toArray()[i])) {
          metadataTable=(MetadataTable)tables.toArray()[i];
          isAllDeleted=false;
        }
      }
      if (isAllDeleted) {
        addMetadataTable(true);
      }
    }
 else {
      addMetadataTable(false);
    }
  }
  tableNavigator.removeAll();
  List<String> tablenames=new ArrayList<String>();
  for (  MetadataTable t : tables) {
    tablenames.add(t.getLabel());
  }
  String[] allTableLabel=tablenames.toArray(new String[0]);
  Arrays.sort(allTableLabel);
  for (int i=0; i < allTableLabel.length; i++) {
    if (allTableLabel[i].equals(metadataTable.getLabel())) {
      TableItem subItem=new TableItem(tableNavigator,SWT.NONE);
      subItem.setText(allTableLabel[i]);
      tableNavigator.setSelection(subItem);
    }
 else     if (!TableHelper.isDeleted(TableHelper.findByLabel(getConnection(),allTableLabel[i]))) {
      TableItem subItem=new TableItem(tableNavigator,SWT.NULL);
      subItem.setText(allTableLabel[i]);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC ocarbone Comment method "initTreeNodes".
 */
private void initTreeNavigatorNodes(){
  List<MetadataTable> tables=ConnectionHelper.getTablesWithOrders(getConnection());
  if (metadataTable == null || tables != null && tables.isEmpty()) {
    if (tables != null && !tables.isEmpty()) {
      boolean isAllDeleted=true;
      for (int i=0; i < tables.size(); i++) {
        if (!TableHelper.isDeleted((MetadataTable)tables.toArray()[i])) {
          metadataTable=(MetadataTable)tables.toArray()[i];
          isAllDeleted=false;
        }
      }
      if (isAllDeleted) {
        addMetadataTable(true);
      }
    }
 else {
      addMetadataTable(false);
    }
  }
  tableNavigator.removeAll();
  List<String> tablenames=new ArrayList<String>();
  for (  MetadataTable t : tables) {
    tablenames.add(t.getLabel());
  }
  String[] allTableLabel=tablenames.toArray(new String[0]);
  Arrays.sort(allTableLabel);
  for (int i=0; i < allTableLabel.length; i++) {
    if (allTableLabel[i].equals(metadataTable.getLabel())) {
      TableItem subItem=new TableItem(tableNavigator,SWT.NONE);
      subItem.setText(allTableLabel[i]);
      tableNavigator.setSelection(subItem);
    }
 else {
      TableItem subItem=new TableItem(tableNavigator,SWT.NULL);
      subItem.setText(allTableLabel[i]);
    }
  }
}
Program: 129715
Project: 129715
Buggy source:
/** 
 * DOC ocarbone Comment method "addMetadataTable".
 */
protected void addMetadataTable(boolean flag){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
  if (flag) {
    ProjectNodeHelper.addTableForSpecifiedDataPackage(getConnection(),metadataTable);
  }
 else {
    ProjectNodeHelper.addDefaultTableForSpecifiedDataPackage(getConnection(),metadataTable);
  }
  metadataTable.setId(factory.getNextId());
  metadataTable.setLabel(IndiceHelper.getIndexedLabel(metadataTable.getLabel(),existingNames));
  initTreeNavigatorNodes();
  initMetadataForm();
  if (tableCombo.getItemCount() > 0) {
    tableCombo.setEnabled(true);
  }
}

Fixed version (ground truth):
/** 
 * DOC ocarbone Comment method "addMetadataTable".
 */
protected void addMetadataTable(boolean flag){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
  if (flag) {
    ProjectNodeHelper.addTableForSpecifiedDataPackage(getConnection(),metadataTable);
  }
 else {
    ProjectNodeHelper.addDefaultTableForSpecifiedDataPackage(getConnection(),metadataTable);
  }
  metadataTable.setId(factory.getNextId());
  metadataTable.setLabel(IndiceHelper.getIndexedLabel(metadataTable.getLabel(),existingNames));
  metadataTable.setName(metadataTable.getLabel());
  initTreeNavigatorNodes();
  initMetadataForm();
  if (tableCombo.getItemCount() > 0) {
    tableCombo.setEnabled(true);
  }
}
Program: 129716
Project: 129716
Buggy source:
public Set<String> getNeededLibrariesForProcess(IProcess process,boolean withChildrens,boolean... exportAsOSGI);

Fixed version (ground truth):
public Set<ModuleNeeded> getNeededLibrariesForProcess(IProcess process,boolean withChildrens);