nus-yam/ex-repair huggingface dataset:
Program: 127118
Project: 127118
Buggy source:
public RepoViewLinkHelper(){
  this.repoViewLinkerReader=new RepoViewLinkerRegistryReader();
}

Fixed version (ground truth):
public RepoViewLinkHelper(){
  this.repoViewLinkerReader=RepoViewLinkerRegistryReader.getInstance();
}
Program: 127119
Project: 127119
Buggy source:
public static IRepositoryViewObject getRoutineFromName(Project tempProject,String name,boolean includeSystem){
  if (name == null)   return null;
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> all=factory.getAll(tempProject,ERepositoryObjectType.ROUTINES);
    for (    IRepositoryViewObject obj : all) {
      if (obj != null && obj.getProperty() != null) {
        Item item=obj.getProperty().getItem();
        String label=obj.getProperty().getLabel();
        if (item != null && item instanceof RoutineItem) {
          RoutineItem routineItem=(RoutineItem)item;
          if (name.equals(label)) {
            if (!includeSystem && routineItem.isBuiltIn()) {
              continue;
            }
 else {
              return obj;
            }
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return null;
}

Fixed version (ground truth):
public static IRepositoryViewObject getRoutineFromName(Project tempProject,String name,boolean includeSystem){
  if (name == null) {
    return null;
  }
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> all=factory.getAll(tempProject,ERepositoryObjectType.ROUTINES);
    for (    IRepositoryViewObject obj : all) {
      if (obj != null && obj.getProperty() != null) {
        Item item=obj.getProperty().getItem();
        String label=obj.getProperty().getLabel();
        if (item != null && item instanceof RoutineItem) {
          RoutineItem routineItem=(RoutineItem)item;
          if (name.equals(label)) {
            if (!includeSystem && routineItem.isBuiltIn()) {
              continue;
            }
 else {
              return obj;
            }
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return null;
}
Program: 127120
Project: 127120
Buggy source:
private static RepositoryNode getRepositoryNode(IRepositoryNode rootNode,IRepositoryViewObject curNode,IRepositoryView view,boolean expanded){
  if (rootNode == null || curNode == null || view == null) {
    return null;
  }
  if (expanded) {
    expandNode((RepositoryNode)rootNode,curNode,view);
  }
  final List<IRepositoryNode> children=rootNode.getChildren();
  if (children != null) {
    List<IRepositoryNode> folderChild=new ArrayList<IRepositoryNode>();
    for (    IRepositoryNode childNode : children) {
      RepositoryNode node=(RepositoryNode)childNode;
      if (isRepositoryFolder(node) || node.getType() == ENodeType.REFERENCED_PROJECT) {
        folderChild.add(node);
      }
 else       if (node.getId().equals(curNode.getId()) && node.getObjectType() == curNode.getRepositoryObjectType()) {
        return node;
      }
    }
    for (    IRepositoryNode folderNode : folderChild) {
      final RepositoryNode repositoryNode=getRepositoryNode((RepositoryNode)folderNode,curNode,view,expanded);
      if (repositoryNode != null) {
        return repositoryNode;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private static RepositoryNode getRepositoryNode(IRepositoryNode rootNode,IRepositoryViewObject curNode,IRepositoryView view,boolean expanded){
  if (rootNode == null || curNode == null || view == null) {
    return null;
  }
  if (expanded) {
    expandNode((RepositoryNode)rootNode,curNode,view);
  }
  final List<IRepositoryNode> children=rootNode.getChildren();
  if (children != null) {
    List<IRepositoryNode> folderChild=new ArrayList<IRepositoryNode>();
    for (    IRepositoryNode childNode : children) {
      RepositoryNode node=(RepositoryNode)childNode;
      if (isRepositoryFolder(node) || node.getType() == ENodeType.REFERENCED_PROJECT) {
        folderChild.add(node);
      }
 else       if (node.getId().equals(curNode.getId()) && node.getObjectType() == curNode.getRepositoryObjectType()) {
        return node;
      }
    }
    for (    IRepositoryNode folderNode : folderChild) {
      final RepositoryNode repositoryNode=getRepositoryNode(folderNode,curNode,view,expanded);
      if (repositoryNode != null) {
        return repositoryNode;
      }
    }
  }
  return null;
}
Program: 127121
Project: 127121
Buggy source:
public static String getBundlePath(String bundleName){
  Bundle refBundle=Platform.getBundle(bundleName);
  if (refBundle != null) {
    String bundlePath=refBundle.getLocation();
    String prefix="String_Node_Str";
    int prefixPos=bundlePath.lastIndexOf(prefix);
    if (prefixPos >= 0) {
      bundlePath=bundlePath.substring(prefixPos + prefix.length(),bundlePath.length() - 1);
      return bundlePath;
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String getBundlePath(String bundleName){
  String bundlePath="String_Node_Str";
  Bundle refBundle=Platform.getBundle(bundleName);
  if (refBundle != null) {
    try {
      URL resource=refBundle.getEntry("String_Node_Str");
      bundlePath=FileLocator.toFileURL(resource).getPath();
      bundlePath=bundlePath.substring(0,bundlePath.length() - 1);
    }
 catch (    IOException e) {
      log.error(e);
    }
  }
  return bundlePath;
}
Program: 127123
Project: 127123
Buggy source:
public static String getBundlePath(String bundleName){
  Bundle refBundle=Platform.getBundle(bundleName);
  if (refBundle != null) {
    String bundlePath=refBundle.getLocation();
    String prefix="String_Node_Str";
    int prefixPos=bundlePath.lastIndexOf(prefix);
    if (prefixPos >= 0) {
      bundlePath=bundlePath.substring(prefixPos + prefix.length(),bundlePath.length() - 1);
      return bundlePath;
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String getBundlePath(String bundleName){
  String bundlePath="String_Node_Str";
  Bundle refBundle=Platform.getBundle(bundleName);
  if (refBundle != null) {
    try {
      URL resource=refBundle.getEntry("String_Node_Str");
      bundlePath=FileLocator.toFileURL(resource).getPath();
      bundlePath=bundlePath.substring(0,bundlePath.length() - 1);
    }
 catch (    IOException e) {
      log.error(e);
    }
  }
  return bundlePath;
}
Program: 127124
Project: 127124
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final RepositoryNode other=(RepositoryNode)obj;
  if (this.type != ENodeType.SIMPLE_FOLDER) {
    if (null != this.id && null != other.id && !this.id.equals(other.id)) {
      return false;
    }
  }
  if (this.properties == null) {
    if (other.properties != null) {
      return false;
    }
  }
 else   if (!this.properties.equals(other.properties)) {
    return false;
  }
  if (this.type == null) {
    if (other.type != null) {
      return false;
    }
  }
 else   if (!this.type.equals(other.type)) {
    return false;
  }
  if (this.parent == null) {
    if (other.parent != null) {
      return false;
    }
  }
 else   if (!this.parent.equals(other.parent)) {
    return false;
  }
  if (this.getLabel() == null) {
    if (other.getLabel() != null) {
      return false;
    }
  }
 else   if (!this.getLabel().equals(other.getLabel())) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final RepositoryNode other=(RepositoryNode)obj;
  if (this.type != ENodeType.SIMPLE_FOLDER) {
    if (null != this.id && null != other.id && !this.id.equals(other.id)) {
      return false;
    }
  }
  if (this.properties == null) {
    if (other.properties != null) {
      return false;
    }
  }
 else   if (!this.properties.equals(other.properties)) {
    return false;
  }
  if (this.type == null) {
    if (other.type != null) {
      return false;
    }
  }
 else   if (!this.type.equals(other.type)) {
    return false;
  }
  if (this.parent == null) {
    if (other.parent != null) {
      return false;
    }
  }
 else   if (!this.parent.equals(other.parent)) {
    return false;
  }
  if (this.object == null) {
    if (other.object != null) {
      return false;
    }
  }
 else {
    if (object.getVersion() == null) {
      if (other.object.getVersion() != null) {
        return false;
      }
    }
 else     if (!object.getVersion().equals(other.object.getVersion())) {
      return false;
    }
  }
  if (this.getLabel() == null) {
    if (other.getLabel() != null) {
      return false;
    }
  }
 else   if (!this.getLabel().equals(other.getLabel())) {
    return false;
  }
  return true;
}
Program: 127125
Project: 127125
Buggy source:
public void expandNode(TreeViewer viewer,IRepositoryNode repoNode,int expandLevel){
  if (repoNode != null) {
    RepositoryNode parent=repoNode.getParent();
    if (parent != null) {
      if (parent instanceof ProjectRepositoryNode && parent.getParent() == null) {
      }
 else {
        expandNode(viewer,parent,expandLevel);
      }
      viewer.expandToLevel(repoNode,expandLevel);
    }
  }
}

Fixed version (ground truth):
public void expandNode(TreeViewer viewer,IRepositoryNode repoNode,int expandLevel){
  if (repoNode != null && viewer != null) {
    RepositoryNode parent=repoNode.getParent();
    if (parent != null) {
      if (parent instanceof ProjectRepositoryNode && parent.getParent() == null) {
      }
 else {
        expandNode(viewer,parent,expandLevel);
      }
      viewer.expandToLevel(repoNode,expandLevel);
    }
  }
}
Program: 127128
Project: 127128
Buggy source:
@Override public void partVisible(IWorkbenchPartReference partRef){
  refreshRepViewDescription(partRef);
}

Fixed version (ground truth):
@Override public void partVisible(IWorkbenchPartReference partRef){
  refreshRepViewDescription(partRef);
  if (partRef != null && IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    IViewPart viewPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
    if (viewPart != null && viewPart instanceof ISelectionChangedListener) {
      ISelectionChangedListener listener=(ISelectionChangedListener)viewPart;
      IWorkbenchPart part=partRef.getPart(false);
      if (part instanceof CommonNavigator) {
        CommonViewer repViewer=((CommonNavigator)part).getCommonViewer();
        if (((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer() != null) {
          ((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer().addSelectionChangedListener(listener);
        }
      }
    }
  }
}
Program: 127129
Project: 127129
Buggy source:
@Override public void partClosed(IWorkbenchPartReference partRef){
  if (IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(this);
  }
}

Fixed version (ground truth):
@Override public void partClosed(IWorkbenchPartReference partRef){
  if (partRef != null && IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(this);
    if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
      IViewPart viewPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
      if (viewPart != null && viewPart instanceof ISelectionChangedListener) {
        ISelectionChangedListener listener=(ISelectionChangedListener)viewPart;
        IWorkbenchPart part=partRef.getPart(false);
        if (part instanceof CommonNavigator) {
          CommonViewer repViewer=((CommonNavigator)part).getCommonViewer();
          if (((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer() != null) {
            ((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer().removeSelectionChangedListener(listener);
          }
        }
      }
    }
  }
}
Program: 127131
Project: 127131
Buggy source:
@Override public void fillActionBars(IActionBars actionBars){
  super.fillActionBars(actionBars);
  CopyAction copyActionInstance=CopyAction.getInstance();
  PasteAction pasteActionInstance=PasteAction.getInstance();
  actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),copyActionInstance);
  actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),pasteActionInstance);
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),DeleteAction.getInstance());
  if (copyActionInstance != null && pasteActionInstance != null && getContext() != null && getContext().getSelection() instanceof IStructuredSelection) {
    IStructuredSelection sel=(IStructuredSelection)getContext().getSelection();
    if (sel != null) {
      copyActionInstance.init(null,sel);
    }
  }
  TextActionHandler textActionHandler=new TextActionHandler(actionBars);
  textActionHandler.setCopyAction(copyActionInstance);
  textActionHandler.setPasteAction(pasteActionInstance);
  textActionHandler.setDeleteAction(DeleteAction.getInstance());
}

Fixed version (ground truth):
@Override public void fillActionBars(IActionBars actionBars){
  super.fillActionBars(actionBars);
  ProxyRepositoryFactory proxy=ProxyRepositoryFactory.getInstance();
  if (!proxy.getRepositoryContext().isOffline()) {
    CopyAction copyActionInstance=CopyAction.getInstance();
    PasteAction pasteActionInstance=PasteAction.getInstance();
    actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),copyActionInstance);
    actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),pasteActionInstance);
    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),DeleteAction.getInstance());
    if (copyActionInstance != null && pasteActionInstance != null && getContext() != null && getContext().getSelection() instanceof IStructuredSelection) {
      IStructuredSelection sel=(IStructuredSelection)getContext().getSelection();
      if (sel != null) {
        copyActionInstance.init(null,sel);
      }
    }
    TextActionHandler textActionHandler=new TextActionHandler(actionBars);
    textActionHandler.setCopyAction(copyActionInstance);
    textActionHandler.setPasteAction(pasteActionInstance);
    textActionHandler.setDeleteAction(DeleteAction.getInstance());
  }
}
Program: 127133
Project: 127133
Buggy source:
/** 
 * DOC ocarbone Comment method "performCancel". Unlock the IRepositoryObject before the close of the wizard.
 * @param IRepositoryObject
 */
public boolean performCancel(){
  if (repositoryObject != null)   repositoryObject.getProperty().eResource().unload();
  closeLockStrategy();
  return true;
}

Fixed version (ground truth):
/** 
 * DOC ocarbone Comment method "performCancel". Unlock the IRepositoryObject before the close of the wizard.
 * @param IRepositoryObject
 */
@Override public boolean performCancel(){
  if (repositoryObject != null && repositoryObject.getProperty().eResource() != null) {
    repositoryObject.getProperty().eResource().unload();
  }
  closeLockStrategy();
  return true;
}
Program: 127134
Project: 127134
Buggy source:
public boolean isLastVersion(Item item){
  if (item.getProperty() != null) {
    try {
      List<IRepositoryViewObject> allVersion=ProxyRepositoryFactory.getInstance().getAllVersion(item.getProperty().getId());
      if (allVersion != null && !allVersion.isEmpty()) {
        String lastVersion=VersionUtils.DEFAULT_VERSION;
        for (        IRepositoryViewObject object : allVersion) {
          if (VersionUtils.compareTo(object.getVersion(),lastVersion) > 0) {
            lastVersion=object.getVersion();
          }
        }
        if (VersionUtils.compareTo(item.getProperty().getVersion(),lastVersion) == 0) {
          return true;
        }
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean isLastVersion(Item item){
  if (item.getProperty() != null) {
    if (item.getProperty().getId() == null) {
      return true;
    }
    try {
      List<IRepositoryViewObject> allVersion=ProxyRepositoryFactory.getInstance().getAllVersion(item.getProperty().getId());
      if (allVersion != null && !allVersion.isEmpty()) {
        String lastVersion=VersionUtils.DEFAULT_VERSION;
        for (        IRepositoryViewObject object : allVersion) {
          if (VersionUtils.compareTo(object.getVersion(),lastVersion) > 0) {
            lastVersion=object.getVersion();
          }
        }
        if (VersionUtils.compareTo(item.getProperty().getVersion(),lastVersion) == 0) {
          return true;
        }
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}
Program: 127135
Project: 127135
Buggy source:
public void expandNode(TreeViewer viewer,IRepositoryNode repoNode,int expandLevel){
  if (repoNode != null) {
    RepositoryNode parent=repoNode.getParent();
    if (parent != null) {
      if (parent instanceof ProjectRepositoryNode && parent.getParent() == null) {
      }
 else {
        expandNode(viewer,parent,expandLevel);
      }
      viewer.expandToLevel(repoNode,expandLevel);
    }
  }
}

Fixed version (ground truth):
public void expandNode(TreeViewer viewer,IRepositoryNode repoNode,int expandLevel){
  if (repoNode != null && viewer != null) {
    RepositoryNode parent=repoNode.getParent();
    if (parent != null) {
      if (parent instanceof ProjectRepositoryNode && parent.getParent() == null) {
      }
 else {
        expandNode(viewer,parent,expandLevel);
      }
      viewer.expandToLevel(repoNode,expandLevel);
    }
  }
}
Program: 127136
Project: 127136
Buggy source:
@Override public void fillActionBars(IActionBars actionBars){
  super.fillActionBars(actionBars);
  CopyAction copyActionInstance=CopyAction.getInstance();
  PasteAction pasteActionInstance=PasteAction.getInstance();
  actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),copyActionInstance);
  actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),pasteActionInstance);
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),DeleteAction.getInstance());
  if (copyActionInstance != null && pasteActionInstance != null && getContext() != null && getContext().getSelection() instanceof IStructuredSelection) {
    IStructuredSelection sel=(IStructuredSelection)getContext().getSelection();
    if (sel != null) {
      copyActionInstance.init(null,sel);
    }
  }
  TextActionHandler textActionHandler=new TextActionHandler(actionBars);
  textActionHandler.setCopyAction(copyActionInstance);
  textActionHandler.setPasteAction(pasteActionInstance);
  textActionHandler.setDeleteAction(DeleteAction.getInstance());
}

Fixed version (ground truth):
@Override public void fillActionBars(IActionBars actionBars){
  super.fillActionBars(actionBars);
  ProxyRepositoryFactory proxy=ProxyRepositoryFactory.getInstance();
  if (!proxy.getRepositoryContext().isOffline()) {
    CopyAction copyActionInstance=CopyAction.getInstance();
    PasteAction pasteActionInstance=PasteAction.getInstance();
    actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),copyActionInstance);
    actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),pasteActionInstance);
    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),DeleteAction.getInstance());
    if (copyActionInstance != null && pasteActionInstance != null && getContext() != null && getContext().getSelection() instanceof IStructuredSelection) {
      IStructuredSelection sel=(IStructuredSelection)getContext().getSelection();
      if (sel != null) {
        copyActionInstance.init(null,sel);
      }
    }
    TextActionHandler textActionHandler=new TextActionHandler(actionBars);
    textActionHandler.setCopyAction(copyActionInstance);
    textActionHandler.setPasteAction(pasteActionInstance);
    textActionHandler.setDeleteAction(DeleteAction.getInstance());
  }
}
Program: 127137
Project: 127137
Buggy source:
public RepoViewLinkHelper(){
  this.repoViewLinkerReader=new RepoViewLinkerRegistryReader();
}

Fixed version (ground truth):
public RepoViewLinkHelper(){
  this.repoViewLinkerReader=RepoViewLinkerRegistryReader.getInstance();
}
Program: 127138
Project: 127138
Buggy source:
public IRepoViewLinker[] getAllRepoViewLinkers(){
  if (this.allLinkerRecorder == null) {
    this.allLinkerRecorder=new ArrayList<LinkerRecorder>();
    readRegistry();
    Collections.sort(this.allLinkerRecorder,new Comparator<LinkerRecorder>(){
      @Override public int compare(      LinkerRecorder lr1,      LinkerRecorder lr2){
        return lr2.priority.compareTo(lr1.priority);
      }
    }
);
  }
  IRepoViewLinker[] linkers=new IRepoViewLinker[this.allLinkerRecorder.size()];
  int index=0;
  for (  LinkerRecorder recorder : this.allLinkerRecorder) {
    linkers[index++]=recorder.linker;
  }
  return linkers;
}

Fixed version (ground truth):
public synchronized IRepoViewLinker[] getAllRepoViewLinkers(){
  if (this.allLinkerRecorder == null) {
    this.allLinkerRecorder=new ArrayList<LinkerRecorder>();
    readRegistry();
    Collections.sort(this.allLinkerRecorder,new Comparator<LinkerRecorder>(){
      @Override public int compare(      LinkerRecorder lr1,      LinkerRecorder lr2){
        return lr2.priority.compareTo(lr1.priority);
      }
    }
);
  }
  IRepoViewLinker[] linkers=new IRepoViewLinker[this.allLinkerRecorder.size()];
  int index=0;
  for (  LinkerRecorder recorder : this.allLinkerRecorder) {
    linkers[index++]=recorder.linker;
  }
  return linkers;
}
Program: 127139
Project: 127139
Buggy source:
public RepoViewLinkerRegistryReader(){
  super(FrameworkUtil.getBundle(RepoViewLinkerRegistryReader.class).getSymbolicName(),VIEW_LINKER_EXTENSION_POINT);
}

Fixed version (ground truth):
private RepoViewLinkerRegistryReader(){
  super(FrameworkUtil.getBundle(RepoViewLinkerRegistryReader.class).getSymbolicName(),VIEW_LINKER_EXTENSION_POINT);
}
Program: 127144
Project: 127144
Buggy source:
@Override public int hashCode(){
  int result=1;
  result=PRIME * result + ((this.id == null) ? 0 : this.id.hashCode());
  result=PRIME * result + ((this.properties == null) ? 0 : this.properties.hashCode());
  result=PRIME * result + ((this.type == null) ? 0 : this.type.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=1;
  result=PRIME * result + ((this.id == null) ? 0 : this.id.hashCode());
  result=PRIME * result + ((this.properties == null) ? 0 : this.properties.hashCode());
  result=PRIME * result + ((this.type == null) ? 0 : this.type.hashCode());
  result=PRIME * result + ((this.parent == null) ? 0 : this.parent.hashCode());
  result=PRIME * result + ((this.object == null) ? 0 : this.object.hashCode());
  return result;
}
Program: 127145
Project: 127145
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final RepositoryNode other=(RepositoryNode)obj;
  if (this.type != ENodeType.SIMPLE_FOLDER) {
    if (null != this.id && null != other.id && !this.id.equals(other.id)) {
      return false;
    }
  }
  if (this.properties == null) {
    if (other.properties != null) {
      return false;
    }
  }
 else   if (!this.properties.equals(other.properties)) {
    return false;
  }
  if (this.type == null) {
    if (other.type != null) {
      return false;
    }
  }
 else   if (!this.type.equals(other.type)) {
    return false;
  }
  if (this.parent == null) {
    if (other.parent != null) {
      return false;
    }
  }
 else   if (!this.parent.equals(other.parent)) {
    return false;
  }
  if (this.getLabel() == null) {
    if (other.getLabel() != null) {
      return false;
    }
  }
 else   if (!this.getLabel().equals(other.getLabel())) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final RepositoryNode other=(RepositoryNode)obj;
  if (this.type != ENodeType.SIMPLE_FOLDER) {
    if (null != this.id && null != other.id && !this.id.equals(other.id)) {
      return false;
    }
  }
  if (this.properties == null) {
    if (other.properties != null) {
      return false;
    }
  }
 else   if (!this.properties.equals(other.properties)) {
    return false;
  }
  if (this.type == null) {
    if (other.type != null) {
      return false;
    }
  }
 else   if (!this.type.equals(other.type)) {
    return false;
  }
  if (this.parent == null) {
    if (other.parent != null) {
      return false;
    }
  }
 else   if (!this.parent.equals(other.parent)) {
    return false;
  }
  if (this.object == null) {
    if (other.object != null) {
      return false;
    }
  }
 else {
    if (object.getVersion() == null) {
      if (other.object.getVersion() != null) {
        return false;
      }
    }
 else     if (!object.getVersion().equals(other.object.getVersion())) {
      return false;
    }
  }
  if (this.getLabel() == null) {
    if (other.getLabel() != null) {
      return false;
    }
  }
 else   if (!this.getLabel().equals(other.getLabel())) {
    return false;
  }
  return true;
}
Program: 127146
Project: 127146
Buggy source:
protected void updateConnectionItem() throws CoreException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  final IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  IWorkspaceRunnable operation=new IWorkspaceRunnable(){
    public void run(    IProgressMonitor monitor) throws CoreException {
      try {
        factory.save(connectionItem);
        closeLockStrategy();
      }
 catch (      PersistenceException e) {
        throw new CoreException(new Status(IStatus.ERROR,"String_Node_Str","String_Node_Str",e));
      }
    }
  }
;
  ISchedulingRule schedulingRule=workspace.getRoot();
  workspace.run(operation,schedulingRule,IWorkspace.AVOID_UPDATE,new NullProgressMonitor());
}

Fixed version (ground truth):
protected void updateConnectionItem() throws CoreException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  final IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  IWorkspaceRunnable operation=new IWorkspaceRunnable(){
    @Override public void run(    IProgressMonitor monitor) throws CoreException {
      try {
        factory.save(connectionItem);
        closeLockStrategy();
      }
 catch (      PersistenceException e) {
        throw new CoreException(new Status(IStatus.ERROR,"String_Node_Str","String_Node_Str",e));
      }
    }
  }
;
  ISchedulingRule schedulingRule=workspace.getRoot();
  workspace.run(operation,schedulingRule,IWorkspace.AVOID_UPDATE,new NullProgressMonitor());
}
Program: 127147
Project: 127147
Buggy source:
public void run(IProgressMonitor monitor) throws CoreException {
  try {
    factory.save(connectionItem);
    closeLockStrategy();
  }
 catch (  PersistenceException e) {
    throw new CoreException(new Status(IStatus.ERROR,"String_Node_Str","String_Node_Str",e));
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws CoreException {
  try {
    factory.save(connectionItem);
    closeLockStrategy();
  }
 catch (  PersistenceException e) {
    throw new CoreException(new Status(IStatus.ERROR,"String_Node_Str","String_Node_Str",e));
  }
}
Program: 127148
Project: 127148
Buggy source:
public void setLastVersion(Boolean lastVersion){
}

Fixed version (ground truth):
@Override public void setLastVersion(Boolean lastVersion){
}
Program: 127149
Project: 127149
Buggy source:
public boolean isLastVersion(Item item){
  if (item.getProperty() != null) {
    try {
      List<IRepositoryViewObject> allVersion=ProxyRepositoryFactory.getInstance().getAllVersion(item.getProperty().getId());
      if (allVersion != null && !allVersion.isEmpty()) {
        String lastVersion=VersionUtils.DEFAULT_VERSION;
        for (        IRepositoryViewObject object : allVersion) {
          if (VersionUtils.compareTo(object.getVersion(),lastVersion) > 0) {
            lastVersion=object.getVersion();
          }
        }
        if (VersionUtils.compareTo(item.getProperty().getVersion(),lastVersion) == 0) {
          return true;
        }
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isLastVersion(Item item){
  if (item.getProperty() != null) {
    if (item.getProperty().getId() == null) {
      return true;
    }
    try {
      List<IRepositoryViewObject> allVersion=ProxyRepositoryFactory.getInstance().getAllVersion(item.getProperty().getId());
      if (allVersion != null && !allVersion.isEmpty()) {
        String lastVersion=VersionUtils.DEFAULT_VERSION;
        for (        IRepositoryViewObject object : allVersion) {
          if (VersionUtils.compareTo(object.getVersion(),lastVersion) > 0) {
            lastVersion=object.getVersion();
          }
        }
        if (VersionUtils.compareTo(item.getProperty().getVersion(),lastVersion) == 0) {
          return true;
        }
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}
Program: 127151
Project: 127151
Buggy source:
@Override public void partVisible(IWorkbenchPartReference partRef){
  refreshRepViewDescription(partRef);
}

Fixed version (ground truth):
@Override public void partVisible(IWorkbenchPartReference partRef){
  refreshRepViewDescription(partRef);
  if (partRef != null && IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    IViewPart viewPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
    if (viewPart != null && viewPart instanceof ISelectionChangedListener) {
      ISelectionChangedListener listener=(ISelectionChangedListener)viewPart;
      IWorkbenchPart part=partRef.getPart(false);
      if (part instanceof CommonNavigator) {
        CommonViewer repViewer=((CommonNavigator)part).getCommonViewer();
        if (((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer() != null) {
          ((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer().addSelectionChangedListener(listener);
        }
      }
    }
  }
}
Program: 127152
Project: 127152
Buggy source:
@Override public void partClosed(IWorkbenchPartReference partRef){
  if (IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(this);
  }
}

Fixed version (ground truth):
@Override public void partClosed(IWorkbenchPartReference partRef){
  if (partRef != null && IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(this);
    if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
      IViewPart viewPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
      if (viewPart != null && viewPart instanceof ISelectionChangedListener) {
        ISelectionChangedListener listener=(ISelectionChangedListener)viewPart;
        IWorkbenchPart part=partRef.getPart(false);
        if (part instanceof CommonNavigator) {
          CommonViewer repViewer=((CommonNavigator)part).getCommonViewer();
          if (((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer() != null) {
            ((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer().removeSelectionChangedListener(listener);
          }
        }
      }
    }
  }
}
Program: 127153
Project: 127153
Buggy source:
@Override public void fillActionBars(IActionBars actionBars){
  super.fillActionBars(actionBars);
  CopyAction copyActionInstance=CopyAction.getInstance();
  PasteAction pasteActionInstance=PasteAction.getInstance();
  actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),copyActionInstance);
  actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),pasteActionInstance);
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),DeleteAction.getInstance());
  if (copyActionInstance != null && pasteActionInstance != null && getContext() != null && getContext().getSelection() instanceof IStructuredSelection) {
    IStructuredSelection sel=(IStructuredSelection)getContext().getSelection();
    if (sel != null) {
      copyActionInstance.init(null,sel);
    }
  }
  TextActionHandler textActionHandler=new TextActionHandler(actionBars);
  textActionHandler.setCopyAction(copyActionInstance);
  textActionHandler.setPasteAction(pasteActionInstance);
  textActionHandler.setDeleteAction(DeleteAction.getInstance());
}

Fixed version (ground truth):
@Override public void fillActionBars(IActionBars actionBars){
  super.fillActionBars(actionBars);
  ProxyRepositoryFactory proxy=ProxyRepositoryFactory.getInstance();
  if (!proxy.getRepositoryContext().isOffline()) {
    CopyAction copyActionInstance=CopyAction.getInstance();
    PasteAction pasteActionInstance=PasteAction.getInstance();
    actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),copyActionInstance);
    actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),pasteActionInstance);
    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),DeleteAction.getInstance());
    if (copyActionInstance != null && pasteActionInstance != null && getContext() != null && getContext().getSelection() instanceof IStructuredSelection) {
      IStructuredSelection sel=(IStructuredSelection)getContext().getSelection();
      if (sel != null) {
        copyActionInstance.init(null,sel);
      }
    }
    TextActionHandler textActionHandler=new TextActionHandler(actionBars);
    textActionHandler.setCopyAction(copyActionInstance);
    textActionHandler.setPasteAction(pasteActionInstance);
    textActionHandler.setDeleteAction(DeleteAction.getInstance());
  }
}
Program: 127157
Project: 127157
Buggy source:
public void run(){
  setsDialog.open();
}

Fixed version (ground truth):
@Override public void run(){
  setsDialog.open();
}
Program: 127158
Project: 127158
Buggy source:
/** 
 * ggu Comment method "getContextTypeForContextMode". if connection is in context mode,choose the context. if return null, the connection is not in context mode. if canCancel is true, the selecting cotnext sets dialog will can be cancel.
 */
private static ContextType getContextTypeForContextMode(Shell shell,Connection connection,String selectedContext,boolean defaultContext,boolean canCancel){
  if (connection == null) {
    return null;
  }
  Shell sqlBuilderDialogShell=ContextUtils.getSqlBuilderDialogShell();
  if (sqlBuilderDialogShell != null && !sqlBuilderDialogShell.isDisposed() && shell == null) {
    shell=sqlBuilderDialogShell;
  }
  ContextItem contextItem=ContextUtils.getContextItemById2(connection.getContextId());
  if (contextItem != null && connection.isContextMode()) {
    if (defaultContext) {
      selectedContext=contextItem.getDefaultContext();
    }
 else     if (selectedContext == null) {
      if (contextItem.getContext().size() > 1) {
        final ContextSetsSelectionDialog setsDialog=new ContextSetsSelectionDialog(shell,contextItem,canCancel);
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            setsDialog.open();
          }
        }
);
        selectedContext=setsDialog.getSelectedContext();
        connection.setContextName(selectedContext);
      }
 else {
        selectedContext=contextItem.getDefaultContext();
      }
    }
    return ContextUtils.getContextTypeByName(contextItem,selectedContext,!canCancel);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "getContextTypeForContextMode". if connection is in context mode,choose the context. if return null, the connection is not in context mode. if canCancel is true, the selecting cotnext sets dialog will can be cancel.
 */
private static ContextType getContextTypeForContextMode(Shell shell,Connection connection,String selectedContext,boolean defaultContext,boolean canCancel){
  if (connection == null) {
    return null;
  }
  Shell sqlBuilderDialogShell=ContextUtils.getSqlBuilderDialogShell();
  if (sqlBuilderDialogShell != null && !sqlBuilderDialogShell.isDisposed() && shell == null) {
    shell=sqlBuilderDialogShell;
  }
  ContextItem contextItem=ContextUtils.getContextItemById2(connection.getContextId());
  if (contextItem != null && connection.isContextMode()) {
    if (defaultContext) {
      selectedContext=contextItem.getDefaultContext();
    }
 else     if (selectedContext == null) {
      if (contextItem.getContext().size() > 1) {
        final ContextSetsSelectionDialog setsDialog=new ContextSetsSelectionDialog(shell,contextItem,canCancel);
        Display.getDefault().syncExec(new Runnable(){
          @Override public void run(){
            setsDialog.open();
          }
        }
);
        selectedContext=setsDialog.getSelectedContext();
        connection.setContextName(selectedContext);
      }
 else {
        selectedContext=contextItem.getDefaultContext();
      }
    }
    return ContextUtils.getContextTypeByName(contextItem,selectedContext,!canCancel);
  }
  return null;
}
Program: 127162
Project: 127162
Buggy source:
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random(System.currentTimeMillis() + Thread.currentThread().getId() * 1000);
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random();
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}
Program: 127163
Project: 127163
Buggy source:
@Override public Property getProperty(){
  IProxyRepositoryFactory factory=null;
  factory=((IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class)).getProxyRepositoryFactory();
  Project project=ProjectManager.getInstance().getProjectFromProjectLabel(this.projectLabel);
  FolderItem folderItem=factory.getFolderItem(project,type,new Path(StringUtils.join(new String[]{path,getLabel()},"String_Node_Str")));
  if (folderItem == null) {
    return super.getProperty();
  }
  return folderItem.getProperty();
}

Fixed version (ground truth):
@Override public Property getProperty(){
  if (this.projectLabel == null) {
    return super.getProperty();
  }
  IProxyRepositoryFactory factory=null;
  factory=((IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class)).getProxyRepositoryFactory();
  Project project=ProjectManager.getInstance().getProjectFromProjectLabel(this.projectLabel);
  FolderItem folderItem=factory.getFolderItem(project,type,new Path(StringUtils.join(new String[]{path,getLabel()},"String_Node_Str")));
  if (folderItem == null) {
    return super.getProperty();
  }
  return folderItem.getProperty();
}
Program: 127166
Project: 127166
Buggy source:
@Override public void partVisible(IWorkbenchPartReference partRef){
  refreshRepViewDescription(partRef);
}

Fixed version (ground truth):
@Override public void partVisible(IWorkbenchPartReference partRef){
  refreshRepViewDescription(partRef);
  if (partRef != null && IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    IViewPart viewPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
    if (viewPart != null && viewPart instanceof ISelectionChangedListener) {
      ISelectionChangedListener listener=(ISelectionChangedListener)viewPart;
      IWorkbenchPart part=partRef.getPart(false);
      if (part instanceof CommonNavigator) {
        CommonViewer repViewer=((CommonNavigator)part).getCommonViewer();
        if (((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer() != null) {
          ((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer().addSelectionChangedListener(listener);
        }
      }
    }
  }
}
Program: 127167
Project: 127167
Buggy source:
@Override public void partClosed(IWorkbenchPartReference partRef){
  if (IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(this);
  }
}

Fixed version (ground truth):
@Override public void partClosed(IWorkbenchPartReference partRef){
  if (partRef != null && IRepositoryView.VIEW_ID.equals(partRef.getId())) {
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(this);
    if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
      IViewPart viewPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
      if (viewPart != null && viewPart instanceof ISelectionChangedListener) {
        ISelectionChangedListener listener=(ISelectionChangedListener)viewPart;
        IWorkbenchPart part=partRef.getPart(false);
        if (part instanceof CommonNavigator) {
          CommonViewer repViewer=((CommonNavigator)part).getCommonViewer();
          if (((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer() != null) {
            ((RepoViewCommonNavigator)repViewer.getCommonNavigator()).getViewer().removeSelectionChangedListener(listener);
          }
        }
      }
    }
  }
}
Program: 127168
Project: 127168
Buggy source:
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random(System.currentTimeMillis() + Thread.currentThread().getId() * 1000);
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random();
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}
Program: 127169
Project: 127169
Buggy source:
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random();
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random(System.currentTimeMillis() + Thread.currentThread().getId() * 1000);
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}
Program: 127171
Project: 127171
Buggy source:
public String getProblemResource(){
  return this.type.getTypeName() + "String_Node_Str" + this.getName()+ "String_Node_Str"+ this.getLineNumber()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getProblemResource(){
  return this.type.getTypeName() + "String_Node_Str" + this.getName()+ "String_Node_Str"+ this.getLineNumber()+ "String_Node_Str";
}
Program: 127172
Project: 127172
Buggy source:
public TalendProblem(ProblemStatus status,String javaUnitName,IMarker marker,String markerErrorMessage,Integer lineNumber,String uniName,Integer charStart,Integer charEnd,ProblemType type,String version){
  super();
  setDescription(markerErrorMessage);
  setStatus(status);
  List<IProcess2> openedProcessList=CorePlugin.getDefault().getDesignerCoreService().getOpenedProcess(getEditors());
  for (  IProcess2 process : openedProcessList) {
    if (javaUnitName != null && javaUnitName.equals(process.getName())) {
      BasicJobInfo jobInfo=new BasicJobInfo(process.getId(),null,process.getVersion());
      jobInfo.setJobName(process.getName());
      setJobInfo(jobInfo);
    }
  }
  this.javaUnitName=javaUnitName;
  this.marker=marker;
  this.lineNumber=lineNumber;
  this.unitName=uniName;
  this.charStart=charStart;
  this.charEnd=charEnd;
  this.version=version;
  setType(type);
  setNodeName(uniName);
}

Fixed version (ground truth):
public TalendProblem(ProblemStatus status,Item item,IMarker marker,String markerErrorMessage,Integer lineNumber,String uniName,Integer charStart,Integer charEnd,ProblemType type){
  super();
  setDescription(markerErrorMessage);
  setStatus(status);
  if (item.getProperty().getId() != null) {
    BasicJobInfo jobInfo=new BasicJobInfo(item.getProperty().getId(),null,item.getProperty().getVersion());
    jobInfo.setJobName(item.getProperty().getLabel());
    setJobInfo(jobInfo);
  }
  this.javaUnitName=item.getProperty().getLabel();
  this.marker=marker;
  this.lineNumber=lineNumber;
  this.unitName=uniName;
  this.charStart=charStart;
  this.charEnd=charEnd;
  this.version=item.getProperty().getVersion();
  setType(type);
  setNodeName(uniName);
}
Program: 127177
Project: 127177
Buggy source:
@Override public void updateMigrationSystem(org.talend.core.model.properties.Project project,boolean persistence){
  MigrationUtil.removeMigrationTaskById(project.getMigrationTask(),MigrationUtil.ADAPT_NEW_MIGRATION_TASK_SYSTEM_ID);
  IProjectMigrationTask task=GetTasksHelper.getInstance().getProjectTask(MigrationUtil.ADAPT_NEW_MIGRATION_TASK_SYSTEM_ID);
  task.execute(new org.talend.core.model.general.Project(project),persistence);
  project.getMigrationTask().add(MigrationUtil.convertMigrationTask(task));
}

Fixed version (ground truth):
@Override public void updateMigrationSystem(org.talend.core.model.properties.Project project,boolean persistence){
  if (!MigrationUtil.containsTask(project.getMigrationTask(),MigrationUtil.ADAPT_NEW_MIGRATION_TASK_SYSTEM_ID)) {
    IProjectMigrationTask task=GetTasksHelper.getInstance().getProjectTask(MigrationUtil.ADAPT_NEW_MIGRATION_TASK_SYSTEM_ID);
    task.execute(new org.talend.core.model.general.Project(project),persistence);
  }
}