nus-yam/ex-repair huggingface dataset:
Program: 141703
Project: 141703
Buggy source:
public List<IComponent> filterComponents(List<IComponent> allComponents){
  if (allComponents == null || allComponents.isEmpty() || !camelComponents.isEmpty()) {
    return camelComponents;
  }
  String categoryName=extractComponentsCategory().getName();
  for (  IComponent component : allComponents) {
    String compType=component.getPaletteType();
    if (compType != null && categoryName.equals(compType)) {
      camelComponents.add(component);
    }
  }
  return camelComponents;
}

Fixed version (ground truth):
@Override public List<IComponent> filterComponents(List<IComponent> allComponents){
  List<IComponent> camelComponents=new ArrayList<IComponent>();
  if (allComponents == null || allComponents.isEmpty()) {
    return camelComponents;
  }
  String categoryName=extractComponentsCategory().getName();
  for (  IComponent component : allComponents) {
    String compType=component.getPaletteType();
    if (compType != null && categoryName.equals(compType)) {
      camelComponents.add(component);
    }
  }
  return camelComponents;
}
Program: 141704
Project: 141704
Buggy source:
@Override protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  BeanItem beanItem=(BeanItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openBeanEditor(beanItem,false);
    refresh(repositoryNode);
    CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
    CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<String>(),null);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  BeanItem beanItem=(BeanItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openBeanEditor(beanItem,false);
    refresh(repositoryNode);
    CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
    CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<ModuleNeeded>(),null);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}
Program: 141709
Project: 141709
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != CamelRepositoryNodeType.repositoryRoutesType) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != CamelRepositoryNodeType.repositoryRoutesType) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 141710
Project: 141710
Buggy source:
@Override protected void doRun(){
  IRepositoryNode node=null;
  CamelNewProcessWizard processWizard=null;
  if (isToolbar()) {
    processWizard=new CamelNewProcessWizard(null);
  }
 else {
    ISelection selection=getSelection();
    if (selection == null) {
      return;
    }
    Object obj=((IStructuredSelection)selection).getFirstElement();
    node=(IRepositoryNode)obj;
    ItemCacheManager.clearCache();
    IRepositoryService service=DesignerPlugin.getDefault().getRepositoryService();
    IPath path=service.getRepositoryPath((RepositoryNode)node);
    if (RepositoryConstants.isSystemFolder(path.toString())) {
      return;
    }
    processWizard=new CamelNewProcessWizard(path);
  }
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),processWizard);
  if (dlg.open() == Window.OK) {
    if (processWizard.getProcess() == null) {
      return;
    }
    CamelProcessEditorInput fileEditorInput;
    try {
      fileEditorInput=new CamelProcessEditorInput(processWizard.getProcess(),false,true,false);
      IRepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(fileEditorInput.getItem().getProperty().getId(),false);
      fileEditorInput.setRepositoryNode(repositoryNode);
      IWorkbenchPage page=getActivePage();
      page.openEditor(fileEditorInput,CamelMultiPageTalendEditor.ID,true);
    }
 catch (    PartInitException e) {
      ExceptionHandler.process(e);
    }
catch (    PersistenceException e) {
      MessageBoxExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  IRepositoryNode node=null;
  CamelNewProcessWizard processWizard=null;
  if (isToolbar()) {
    processWizard=new CamelNewProcessWizard(null);
  }
 else {
    ISelection selection=getSelection();
    if (selection == null) {
      return;
    }
    Object obj=((IStructuredSelection)selection).getFirstElement();
    node=(IRepositoryNode)obj;
    ItemCacheManager.clearCache();
    IRepositoryService service=DesignerPlugin.getDefault().getRepositoryService();
    IPath path=service.getRepositoryPath(node);
    if (RepositoryConstants.isSystemFolder(path.toString())) {
      return;
    }
    processWizard=new CamelNewProcessWizard(path);
  }
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),processWizard);
  if (dlg.open() == Window.OK) {
    if (processWizard.getProcess() == null) {
      return;
    }
    CamelProcessEditorInput fileEditorInput;
    try {
      fileEditorInput=new CamelProcessEditorInput(processWizard.getProcess(),false,true,false);
      IRepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(fileEditorInput.getItem().getProperty().getId(),false);
      fileEditorInput.setRepositoryNode(repositoryNode);
      IWorkbenchPage page=getActivePage();
      page.openEditor(fileEditorInput,CamelMultiPageTalendEditor.ID,true);
    }
 catch (    PartInitException e) {
      ExceptionHandler.process(e);
    }
catch (    PersistenceException e) {
      MessageBoxExceptionHandler.process(e);
    }
  }
}
Program: 141711
Project: 141711
Buggy source:
public void run(IIntroSite site,Properties params){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
  }
 else {
    PlatformUI.getWorkbench().getIntroManager().closeIntro(PlatformUI.getWorkbench().getIntroManager().getIntro());
    selectRootObject(params);
    doRun();
  }
}

Fixed version (ground truth):
@Override public void run(IIntroSite site,Properties params){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
  }
 else {
    PlatformUI.getWorkbench().getIntroManager().closeIntro(PlatformUI.getWorkbench().getIntroManager().getIntro());
    selectRootObject(params);
    doRun();
  }
}
Program: 141712
Project: 141712
Buggy source:
public IRepositoryNode getProcessNode(){
  ERepositoryObjectType repositoryNodeType=(ERepositoryObjectType)ERepositoryObjectType.valueOf(ERepositoryObjectType.class,CamelRepositoryNodeType.ROUTES);
  IRepositoryNode repositoryNode=ProjectRepositoryNode.getInstance().getRootRepositoryNode(repositoryNodeType);
  return repositoryNode;
}

Fixed version (ground truth):
@Override public IRepositoryNode getProcessNode(){
  ERepositoryObjectType repositoryNodeType=ERepositoryObjectType.valueOf(ERepositoryObjectType.class,CamelRepositoryNodeType.ROUTES);
  IRepositoryNode repositoryNode=ProjectRepositoryNode.getInstance().getRootRepositoryNode(repositoryNodeType);
  return repositoryNode;
}
Program: 141713
Project: 141713
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != CamelRepositoryNodeType.repositoryBeansType) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != CamelRepositoryNodeType.repositoryBeansType) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 141714
Project: 141714
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != CamelRepositoryNodeType.repositoryRouteResourceType) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != CamelRepositoryNodeType.repositoryRouteResourceType) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 141715
Project: 141715
Buggy source:
@Override protected void doRun(){
  IRepositoryNode node=null;
  NewRouteResourceWizard wizard=null;
  ISelection selection=getSelection();
  if (selection == null) {
    return;
  }
  Object obj=((IStructuredSelection)selection).getFirstElement();
  node=(IRepositoryNode)obj;
  IRepositoryService service=DesignerPlugin.getDefault().getRepositoryService();
  IPath path=service.getRepositoryPath((RepositoryNode)node);
  if (RepositoryConstants.isSystemFolder(path.toString())) {
    return;
  }
  wizard=new NewRouteResourceWizard(path);
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),wizard);
  int open=dlg.open();
  if (open == Window.OK) {
    RouteResourceItem item=wizard.getItem();
    IWorkbenchPage page=getActivePage();
    RouteResourceEditorUtil.openEditor(page,null,item);
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  IRepositoryNode node=null;
  NewRouteResourceWizard wizard=null;
  ISelection selection=getSelection();
  if (selection == null) {
    return;
  }
  Object obj=((IStructuredSelection)selection).getFirstElement();
  node=(IRepositoryNode)obj;
  IRepositoryService service=DesignerPlugin.getDefault().getRepositoryService();
  IPath path=service.getRepositoryPath(node);
  if (RepositoryConstants.isSystemFolder(path.toString())) {
    return;
  }
  wizard=new NewRouteResourceWizard(path);
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),wizard);
  int open=dlg.open();
  if (open == Window.OK) {
    RouteResourceItem item=wizard.getItem();
    IWorkbenchPage page=getActivePage();
    RouteResourceEditorUtil.openEditor(page,null,item);
  }
}
Program: 141716
Project: 141716
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 141717
Project: 141717
Buggy source:
public void run(IIntroSite site,Properties params){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
  }
 else {
    PlatformUI.getWorkbench().getIntroManager().closeIntro(PlatformUI.getWorkbench().getIntroManager().getIntro());
    selectRootObject(params);
    doRun();
  }
}

Fixed version (ground truth):
@Override public void run(IIntroSite site,Properties params){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
  }
 else {
    PlatformUI.getWorkbench().getIntroManager().closeIntro(PlatformUI.getWorkbench().getIntroManager().getIntro());
    selectRootObject(params);
    doRun();
  }
}
Program: 141718
Project: 141718
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
      if (node.getObjectType() != CamelRepositoryNodeType.repositoryRoutesType) {
        canWork=false;
      }
    break;
default :
  canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
      if (node.getObjectType() != CamelRepositoryNodeType.repositoryRoutesType) {
        canWork=false;
      }
    break;
default :
  canWork=false;
}
if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.LOCK_BY_USER) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 141719
Project: 141719
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
      if (node.getObjectType() != CamelRepositoryNodeType.repositoryBeansType) {
        canWork=false;
      }
    break;
default :
  canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
      if (node.getObjectType() != CamelRepositoryNodeType.repositoryBeansType) {
        canWork=false;
      }
    break;
default :
  canWork=false;
}
if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.LOCK_BY_USER) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 141720
Project: 141720
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
    if (CamelEditorUtil.hasEditorOpened(node)) {
      canWork=false;
    }
 else {
switch (node.getType()) {
case REPOSITORY_ELEMENT:
        if (node.getObjectType() != CamelRepositoryNodeType.repositoryRoutesType) {
          canWork=false;
        }
      break;
default :
    canWork=false;
}
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
    if (CamelEditorUtil.hasEditorOpened(node)) {
      canWork=false;
    }
 else {
switch (node.getType()) {
case REPOSITORY_ELEMENT:
        if (node.getObjectType() != CamelRepositoryNodeType.repositoryRoutesType) {
          canWork=false;
        }
      break;
default :
    canWork=false;
}
}
if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.LOCK_BY_USER) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 141721
Project: 141721
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
      if (node.getObjectType() != CamelRepositoryNodeType.repositoryBeansType) {
        canWork=false;
      }
    break;
default :
  canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
      if (node.getObjectType() != CamelRepositoryNodeType.repositoryBeansType) {
        canWork=false;
      }
    break;
default :
  canWork=false;
}
if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.LOCK_BY_USER) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 141722
Project: 141722
Buggy source:
public void run(final IProgressMonitor monitor) throws CoreException {
  if (!alreadyEditedByUser) {
    refreshNewJob();
    try {
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  boolean locked=processObject.getRepositoryStatus().equals(ERepositoryStatus.LOCK_BY_USER);
  openAnotherVersion((RepositoryNode)processObject.getRepositoryNode(),!locked);
  try {
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public void run(final IProgressMonitor monitor) throws CoreException {
  if (!alreadyEditedByUser) {
    refreshNewJob();
    try {
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  try {
    ProxyRepositoryFactory.getInstance().lock(processObject);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  LoginException e) {
    ExceptionHandler.process(e);
  }
  boolean locked=processObject.getRepositoryStatus().equals(ERepositoryStatus.LOCK_BY_USER);
  openAnotherVersion((RepositoryNode)processObject.getRepositoryNode(),!locked);
  try {
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}
Program: 141724
Project: 141724
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  String version=getProperty().getVersion();
  version=VersionUtils.upMinor(version);
  versionText.setText(version);
  getProperty().setVersion(version);
  updatePageStatus();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  String version=getProperty().getVersion();
  version=VersionUtils.upMinor(version);
  versionText.setText(version);
  newVersion=version;
  updatePageStatus();
}
Program: 141725
Project: 141725
Buggy source:
private void addListener(){
  createNewVersionButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      boolean create=createNewVersionButton.getSelection();
      versionModifComposite.setEnabled(create);
      versionListComposite.setEnabled(!create);
      refreshButtonState(create);
      createNewVersionJob=create;
      updatePageStatus();
    }
  }
);
  versionMajorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMajor(version);
      versionText.setText(version);
      getProperty().setVersion(version);
      updatePageStatus();
    }
  }
);
  versionMinorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMinor(version);
      versionText.setText(version);
      getProperty().setVersion(version);
      updatePageStatus();
    }
  }
);
}

Fixed version (ground truth):
private void addListener(){
  createNewVersionButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      boolean create=createNewVersionButton.getSelection();
      versionModifComposite.setEnabled(create);
      versionListComposite.setEnabled(!create);
      refreshButtonState(create);
      createNewVersionJob=create;
      updatePageStatus();
    }
  }
);
  versionMajorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMajor(version);
      versionText.setText(version);
      newVersion=version;
      updatePageStatus();
    }
  }
);
  versionMinorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMinor(version);
      versionText.setText(version);
      newVersion=version;
      updatePageStatus();
    }
  }
);
}
Program: 141726
Project: 141726
Buggy source:
@Override public boolean performCancel(){
  if (!alreadyEditedByUser) {
    restoreVersion();
  }
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  return super.performCancel();
}
Program: 141727
Project: 141727
Buggy source:
public void run(final IProgressMonitor monitor) throws CoreException {
  if (!alreadyEditedByUser) {
    refreshNewJob();
    try {
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  try {
    ProxyRepositoryFactory.getInstance().lock(processObject);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  LoginException e) {
    ExceptionHandler.process(e);
  }
  boolean locked=processObject.getRepositoryStatus().equals(ERepositoryStatus.LOCK_BY_USER);
  openAnotherVersion((RepositoryNode)processObject.getRepositoryNode(),!locked);
  try {
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public void run(final IProgressMonitor monitor) throws CoreException {
  if (!alreadyEditedByUser) {
    getProperty().setVersion(mainPage.getNewVersion());
    refreshNewJob();
    try {
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  try {
    ProxyRepositoryFactory.getInstance().lock(processObject);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  LoginException e) {
    ExceptionHandler.process(e);
  }
  boolean locked=processObject.getRepositoryStatus().equals(ERepositoryStatus.LOCK_BY_USER);
  openAnotherVersion((RepositoryNode)processObject.getRepositoryNode(),!locked);
  try {
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}
Program: 141730
Project: 141730
Buggy source:
public Date getOrder(){
  GregorianCalendar gc=new GregorianCalendar(2012,12,17,14,00,00);
  return gc.getTime();
}

Fixed version (ground truth):
public Date getOrder(){
  GregorianCalendar gc=new GregorianCalendar(2012,11,17,14,00,00);
  return gc.getTime();
}
Program: 141731
Project: 141731
Buggy source:
public Set<ResourceDependencyModel> getResourceModel(INode node){
  Set<ResourceDependencyModel> models=new HashSet<ResourceDependencyModel>();
  String name=node.getComponent().getName();
  Set<ExResourceParamModel> resourceParams=extensionMap.get(name);
  if (resourceParams == null) {
    return models;
  }
  for (  ExResourceParamModel model : resourceParams) {
    boolean eualate=model.eualate(node);
    if (eualate) {
      String paramName=model.getParamName();
      ResourceDependencyModel denpModel=createDenpendencyModel(paramName,node);
      boolean isContained=false;
      for (      ResourceDependencyModel rdm : models) {
        if (rdm.equals(denpModel)) {
          rdm.getRefNodes().add(node.getUniqueName());
          isContained=true;
          break;
        }
      }
      if (!isContained) {
        denpModel.getRefNodes().add(node.getUniqueName());
        models.add(denpModel);
      }
    }
  }
  return models;
}

Fixed version (ground truth):
public Set<ResourceDependencyModel> getResourceModel(INode node){
  Set<ResourceDependencyModel> models=new HashSet<ResourceDependencyModel>();
  String name=node.getComponent().getName();
  Set<ExResourceParamModel> resourceParams=extensionMap.get(name);
  if (resourceParams == null) {
    return models;
  }
  for (  ExResourceParamModel model : resourceParams) {
    boolean eualate=model.eualate(node);
    if (eualate) {
      String paramName=model.getParamName();
      ResourceDependencyModel denpModel=createDenpendencyModel(paramName,node);
      if (denpModel == null) {
        continue;
      }
      boolean isContained=false;
      for (      ResourceDependencyModel rdm : models) {
        if (rdm.equals(denpModel)) {
          rdm.getRefNodes().add(node.getUniqueName());
          isContained=true;
          break;
        }
      }
      if (!isContained) {
        denpModel.getRefNodes().add(node.getUniqueName());
        models.add(denpModel);
      }
    }
  }
  return models;
}
Program: 141732
Project: 141732
Buggy source:
/** 
 * @param id
 * @param version
 * @return
 */
public static ResourceDependencyModel createDependency(String id,String version){
  IRepositoryViewObject rvo=null;
  try {
    if (RouteResourceUtil.LATEST_VERSION.equals(version)) {
      rvo=ProxyRepositoryFactory.getInstance().getLastVersion(id);
    }
 else {
      rvo=ProxyRepositoryFactory.getInstance().getSpecificVersion(id,version,true);
    }
  }
 catch (  PersistenceException e) {
    e.printStackTrace();
  }
  Item item=rvo.getProperty().getItem();
  ResourceDependencyModel resourceDependencyModel=new ResourceDependencyModel((RouteResourceItem)item);
  resourceDependencyModel.setSelectedVersion(version);
  resourceDependencyModel.setBuiltIn(true);
  return resourceDependencyModel;
}

Fixed version (ground truth):
/** 
 * @param id
 * @param version
 * @return
 */
public static ResourceDependencyModel createDependency(String id,String version){
  IRepositoryViewObject rvo=null;
  try {
    if (RouteResourceUtil.LATEST_VERSION.equals(version)) {
      rvo=ProxyRepositoryFactory.getInstance().getLastVersion(id);
    }
 else {
      rvo=ProxyRepositoryFactory.getInstance().getSpecificVersion(id,version,true);
    }
  }
 catch (  PersistenceException e) {
    e.printStackTrace();
  }
  if (rvo != null) {
    Item item=rvo.getProperty().getItem();
    ResourceDependencyModel resourceDependencyModel=new ResourceDependencyModel((RouteResourceItem)item);
    resourceDependencyModel.setSelectedVersion(version);
    resourceDependencyModel.setBuiltIn(true);
    return resourceDependencyModel;
  }
  return null;
}
Program: 141733
Project: 141733
Buggy source:
/** 
 * @param routeItem
 * @param model
 */
public static void addResourceDependency(Item routeItem,ResourceDependencyModel model){
  Property property=routeItem.getProperty();
  String newModelId=model.getItem().getProperty().getId();
  String newStoreValue="String_Node_Str";
  EMap additionalProperties=property.getAdditionalProperties();
  if (additionalProperties != null) {
    String resourcesObj=(String)additionalProperties.get(ROUTE_RESOURCES_PROP);
    if (resourcesObj != null) {
      boolean duplicated=false;
      String[] resourceIdVersions=resourcesObj.split(COMMA_TAG);
      for (      String idVersion : resourceIdVersions) {
        String[] parts=idVersion.split(REPACE_SLASH_TAG);
        String idPart=parts[0];
        if (model.getItem().getProperty().getId().equals(idPart)) {
          String newId=idPart + SLASH_TAG + model.getSelectedVersion();
          newStoreValue=resourcesObj.toString().replace(idVersion,newId);
          duplicated=true;
        }
      }
      if (!duplicated) {
        newStoreValue=resourcesObj + "String_Node_Str" + newModelId+ SLASH_TAG+ model.getSelectedVersion();
      }
    }
 else {
      newStoreValue=newModelId + SLASH_TAG + model.getSelectedVersion();
    }
  }
  additionalProperties.put(ROUTE_RESOURCES_PROP,newStoreValue);
  try {
    ProxyRepositoryFactory.getInstance().save(routeItem,false);
  }
 catch (  PersistenceException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @param routeItem
 * @param model
 */
public static void addResourceDependency(Item routeItem,ResourceDependencyModel model){
  Property property=routeItem.getProperty();
  String newModelId=model.getItem().getProperty().getId();
  String newStoreValue="String_Node_Str";
  EMap additionalProperties=property.getAdditionalProperties();
  if (additionalProperties != null) {
    String resourcesObj=(String)additionalProperties.get(ROUTE_RESOURCES_PROP);
    if (resourcesObj != null) {
      boolean duplicated=false;
      String[] resourceIdVersions=resourcesObj.split(COMMA_TAG);
      for (      String idVersion : resourceIdVersions) {
        String[] parts=idVersion.split(REPACE_SLASH_TAG);
        String idPart=parts[0];
        if (model.getItem().getProperty().getId().equals(idPart)) {
          String newId=idPart + SLASH_TAG + model.getSelectedVersion();
          newStoreValue=resourcesObj.toString().replace(idVersion,newId);
          duplicated=true;
        }
      }
      if (!duplicated) {
        newStoreValue=resourcesObj + "String_Node_Str" + newModelId+ SLASH_TAG+ model.getSelectedVersion();
      }
    }
 else {
      newStoreValue=newModelId + SLASH_TAG + model.getSelectedVersion();
    }
    additionalProperties.put(ROUTE_RESOURCES_PROP,newStoreValue);
  }
  try {
    ProxyRepositoryFactory.getInstance().save(routeItem,false);
  }
 catch (  PersistenceException e) {
    e.printStackTrace();
  }
}
Program: 141734
Project: 141734
Buggy source:
protected void doRun(){
  ISelection selection=getSelectedObject();
  if (selection == null) {
    return;
  }
  Object obj=((IStructuredSelection)selection).getFirstElement();
  if (obj == null) {
    return;
  }
  RepositoryNode node=(RepositoryNode)obj;
  openOrBindEditor(node);
}

Fixed version (ground truth):
protected void doRun(){
  ISelection selection=getSelection();
  if (selection == null) {
    return;
  }
  Object obj=((IStructuredSelection)selection).getFirstElement();
  if (obj == null) {
    return;
  }
  RepositoryNode node=(RepositoryNode)obj;
  openOrBindEditor(node);
}
Program: 141735
Project: 141735
Buggy source:
protected void doRun(){
  ISelection selection=getSelectedObject();
  if (selection == null) {
    return;
  }
  Object obj=((IStructuredSelection)selection).getFirstElement();
  if (obj == null) {
    return;
  }
  RepositoryNode node=(RepositoryNode)obj;
  opendTextEditor(node);
}

Fixed version (ground truth):
protected void doRun(){
  ISelection selection=getSelection();
  if (selection == null) {
    return;
  }
  Object obj=((IStructuredSelection)selection).getFirstElement();
  if (obj == null) {
    return;
  }
  RepositoryNode node=(RepositoryNode)obj;
  opendTextEditor(node);
}
Program: 141737
Project: 141737
Buggy source:
@Override protected void doRun(){
  ISelection selection=getSelectedObject();
  if (selection == null) {
    return;
  }
  Object obj=((IStructuredSelection)selection).getFirstElement();
  if (obj == null) {
    return;
  }
  RepositoryNode node=(RepositoryNode)obj;
  Property property=node.getObject().getProperty();
  CamelProcessItem processItem=null;
  if (property != null) {
    ItemCacheManager.clearCache();
    Assert.isTrue(property.getItem() instanceof CamelProcessItem);
    processItem=(CamelProcessItem)property.getItem();
    IWorkbenchPage page=getActivePage();
    try {
      final CamelProcessEditorInput fileEditorInput=new CamelProcessEditorInput(processItem,true,true);
      checkUnLoadedNodeForProcess(fileEditorInput);
      IEditorPart editorPart=page.findEditor(fileEditorInput);
      if (editorPart == null) {
        fileEditorInput.setRepositoryNode(node);
        editorPart=page.openEditor(fileEditorInput,CamelMultiPageTalendEditor.ID,true);
      }
 else {
        ((CamelMultiPageTalendEditor)editorPart).setReadOnly(fileEditorInput.setForceReadOnly(false));
        page.activate(editorPart);
      }
      if (editorPart instanceof AbstractMultiPageTalendEditor) {
        ((AbstractMultiPageTalendEditor)editorPart).updateTitleImage();
      }
      refresh(obj);
    }
 catch (    PartInitException e) {
      MessageBoxExceptionHandler.process(e);
    }
catch (    PersistenceException e) {
      MessageBoxExceptionHandler.process(e);
    }
  }
 else {
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  ISelection selection=getSelectedObject();
  if (selection == null) {
    return;
  }
  Object obj=((IStructuredSelection)selection).getFirstElement();
  if (obj == null) {
    return;
  }
  RepositoryNode node=(RepositoryNode)obj;
  Property property=node.getObject().getProperty();
  CamelProcessItem processItem=null;
  if (property != null) {
    ItemCacheManager.clearCache();
    Assert.isTrue(property.getItem() instanceof CamelProcessItem);
    processItem=(CamelProcessItem)property.getItem();
    IWorkbenchPage page=getActivePage();
    try {
      final CamelProcessEditorInput fileEditorInput=new CamelProcessEditorInput(processItem,true,true);
      checkUnLoadedNodeForProcess(fileEditorInput);
      IEditorPart editorPart=page.findEditor(fileEditorInput);
      if (editorPart == null) {
        fileEditorInput.setRepositoryNode(node);
        editorPart=page.openEditor(fileEditorInput,CamelMultiPageTalendEditor.ID,true);
      }
 else {
        ((CamelMultiPageTalendEditor)editorPart).setReadOnly(fileEditorInput.setForceReadOnly(false));
        page.activate(editorPart);
      }
    }
 catch (    PartInitException e) {
      MessageBoxExceptionHandler.process(e);
    }
catch (    PersistenceException e) {
      MessageBoxExceptionHandler.process(e);
    }
  }
 else {
  }
}
Program: 141738
Project: 141738
Buggy source:
private boolean compareMinMax(){
  if (maxVersion == null || maxVersion.trim().equals("String_Node_Str") || minVersion == null || minVersion.trim().equals("String_Node_Str")) {
    return true;
  }
  String[] maxSplit=maxVersion.split("String_Node_Str");
  String[] minSplit=minVersion.split("String_Node_Str");
  for (int i=0; i < 3; i++) {
    try {
      if (Integer.parseInt(maxSplit[i]) - Integer.parseInt(minSplit[i]) < 0) {
        return false;
      }
    }
 catch (    Exception e) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Compare min max.
 * @return true, if check validated.
 */
private boolean compareMinMax(){
  if (maxVersion == null || maxVersion.trim().equals("String_Node_Str") || minVersion == null || minVersion.trim().equals("String_Node_Str")) {
    return true;
  }
  try {
    Version minV=Version.parseVersion(minVersion);
    Version maxV=Version.parseVersion(maxVersion);
    if (minV == null && maxV == null) {
      return false;
    }
    if (minV.compareTo(maxV) > 0) {
      return false;
    }
 else {
      return true;
    }
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 141740
Project: 141740
Buggy source:
@Override public ImportPackage toTargetIgnorePredicates(){
  ImportPackage importPackage=new ImportPackage();
  importPackage.setBuiltIn(true);
  importPackage.setMaxVersion(maxVersion);
  importPackage.setMinVersion(minVersion);
  importPackage.setName(packageName);
  importPackage.setOptional(isOptional);
  return importPackage;
}

Fixed version (ground truth):
@Override public ImportPackage toTargetIgnorePredicates(){
  ImportPackage importPackage=new ImportPackage();
  importPackage.setBuiltIn(true);
  importPackage.setVersionRange(versionRange);
  importPackage.setName(packageName);
  importPackage.setOptional(isOptional);
  return importPackage;
}
Program: 141741
Project: 141741
Buggy source:
@Override public RequireBundle toTargetIgnorePredicates(){
  RequireBundle requireBundle=new RequireBundle();
  requireBundle.setBuiltIn(true);
  requireBundle.setMaxVersion(maxVersion);
  requireBundle.setMinVersion(minVersion);
  requireBundle.setName(bundleName);
  requireBundle.setOptional(isOptional);
  return requireBundle;
}

Fixed version (ground truth):
@Override public RequireBundle toTargetIgnorePredicates(){
  RequireBundle requireBundle=new RequireBundle();
  requireBundle.setBuiltIn(true);
  requireBundle.setVersionRange(versionRange);
  requireBundle.setName(bundleName);
  requireBundle.setOptional(isOptional);
  return requireBundle;
}
Program: 141742
Project: 141742
Buggy source:
private ExImportPackage createImportPackageFrom(IConfigurationElement p){
  String packageName=p.getAttribute(PACKAGE_NAME);
  String maxVersion=p.getAttribute(MAX_VERSION);
  String minVersion=p.getAttribute(MIN_VERSION);
  String optional=p.getAttribute(OPTIONAL);
  ExImportPackage importPackage=new ExImportPackage();
  importPackage.setPackageName(packageName);
  if (maxVersion != null && !"String_Node_Str".equals(maxVersion)) {
    importPackage.setMaxVersion(maxVersion);
  }
  if (minVersion != null && !"String_Node_Str".equals(minVersion)) {
    importPackage.setMinVersion(minVersion);
  }
  if (optional != null) {
    importPackage.setOptional(Boolean.getBoolean(optional));
  }
  IConfigurationElement[] predicates=p.getChildren(PREDICATE);
  if (predicates != null) {
    for (    IConfigurationElement pe : predicates) {
      String name=pe.getAttribute(ATTRIBUTE_NAME);
      String value=pe.getAttribute(ATTRIBUTE_VALUE);
      String isRegex=pe.getAttribute(REGEX);
      ExPredicate exPredicate=new ExPredicate();
      exPredicate.setAttributeName(name);
      exPredicate.setAttributeValue(value);
      if ("String_Node_Str".equals(isRegex)) {
        exPredicate.setRegex(true);
      }
      importPackage.addPredicate(exPredicate);
    }
  }
  return importPackage;
}

Fixed version (ground truth):
private ExImportPackage createImportPackageFrom(IConfigurationElement p){
  String packageName=p.getAttribute(PACKAGE_NAME);
  String maxVersion=p.getAttribute(MAX_VERSION);
  String minVersion=p.getAttribute(MIN_VERSION);
  String optional=p.getAttribute(OPTIONAL);
  ExImportPackage importPackage=new ExImportPackage();
  importPackage.setPackageName(packageName);
  if (maxVersion != null && !"String_Node_Str".equals(maxVersion)) {
  }
  if (minVersion != null && !"String_Node_Str".equals(minVersion)) {
  }
  if (optional != null) {
    importPackage.setOptional(Boolean.getBoolean(optional));
  }
  IConfigurationElement[] predicates=p.getChildren(PREDICATE);
  if (predicates != null) {
    for (    IConfigurationElement pe : predicates) {
      String name=pe.getAttribute(ATTRIBUTE_NAME);
      String value=pe.getAttribute(ATTRIBUTE_VALUE);
      String isRegex=pe.getAttribute(REGEX);
      ExPredicate exPredicate=new ExPredicate();
      exPredicate.setAttributeName(name);
      exPredicate.setAttributeValue(value);
      if ("String_Node_Str".equals(isRegex)) {
        exPredicate.setRegex(true);
      }
      importPackage.addPredicate(exPredicate);
    }
  }
  return importPackage;
}
Program: 141743
Project: 141743
Buggy source:
private ExRequireBundle createRequireBundleFrom(IConfigurationElement b){
  String bundleName=b.getAttribute(BUNDLE_NAME);
  String maxVersion=b.getAttribute(MAX_VERSION);
  String minVersion=b.getAttribute(MIN_VERSION);
  String optional=b.getAttribute(OPTIONAL);
  ExRequireBundle requireBundle=new ExRequireBundle();
  requireBundle.setBundleName(bundleName);
  if (maxVersion != null && !"String_Node_Str".equals(maxVersion)) {
    requireBundle.setMaxVersion(maxVersion);
  }
  if (minVersion != null && !"String_Node_Str".equals(minVersion)) {
    requireBundle.setMinVersion(minVersion);
  }
  if (optional != null) {
    requireBundle.setOptional(Boolean.getBoolean(optional));
  }
  IConfigurationElement[] predicates=b.getChildren(PREDICATE);
  if (predicates != null) {
    for (    IConfigurationElement pe : predicates) {
      String name=pe.getAttribute(ATTRIBUTE_NAME);
      String value=pe.getAttribute(ATTRIBUTE_VALUE);
      String isRegex=pe.getAttribute(REGEX);
      ExPredicate exPredicate=new ExPredicate();
      exPredicate.setAttributeName(name);
      exPredicate.setAttributeValue(value);
      if ("String_Node_Str".equals(isRegex)) {
        exPredicate.setRegex(true);
      }
      requireBundle.addPredicate(exPredicate);
    }
  }
  return requireBundle;
}

Fixed version (ground truth):
private ExRequireBundle createRequireBundleFrom(IConfigurationElement b){
  String bundleName=b.getAttribute(BUNDLE_NAME);
  String maxVersion=b.getAttribute(MAX_VERSION);
  String minVersion=b.getAttribute(MIN_VERSION);
  String optional=b.getAttribute(OPTIONAL);
  ExRequireBundle requireBundle=new ExRequireBundle();
  requireBundle.setBundleName(bundleName);
  requireBundle.setVersionRange(VersionValidateUtil.tryToGetValidVersionRange(minVersion,maxVersion));
  if (optional != null) {
    requireBundle.setOptional(Boolean.getBoolean(optional));
  }
  IConfigurationElement[] predicates=b.getChildren(PREDICATE);
  if (predicates != null) {
    for (    IConfigurationElement pe : predicates) {
      String name=pe.getAttribute(ATTRIBUTE_NAME);
      String value=pe.getAttribute(ATTRIBUTE_VALUE);
      String isRegex=pe.getAttribute(REGEX);
      ExPredicate exPredicate=new ExPredicate();
      exPredicate.setAttributeName(name);
      exPredicate.setAttributeValue(value);
      if ("String_Node_Str".equals(isRegex)) {
        exPredicate.setRegex(true);
      }
      requireBundle.addPredicate(exPredicate);
    }
  }
  return requireBundle;
}