nus-yam/ex-repair huggingface dataset:
Program: 129077
Project: 129077
Buggy source:
@Override public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(2,false);
  container.setLayout(layout);
  if (alreadyEditedByUser) {
    Label label=new Label(container,SWT.NONE);
    label.setForeground(ColorConstants.red);
    label.setText(Messages.getString("String_Node_Str"));
    GridData gridData=new GridData();
    gridData.horizontalSpan=2;
    label.setLayoutData(gridData);
  }
  super.createControl(container);
  setControl(container);
  updateContent();
  addListeners();
  setPageComplete(false);
}

Fixed version (ground truth):
@Override public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(2,false);
  container.setLayout(layout);
  if (alreadyEditedByUser && isLock) {
    Label label=new Label(container,SWT.NONE);
    label.setForeground(ColorConstants.red);
    label.setText(Messages.getString("String_Node_Str"));
    GridData gridData=new GridData();
    gridData.horizontalSpan=2;
    label.setLayoutData(gridData);
  }
  super.createControl(container);
  setControl(container);
  updateContent();
  addListeners();
  setPageComplete(false);
}
Program: 129078
Project: 129078
Buggy source:
@Override public boolean performFinish(){
  if (alreadyEditedByUser) {
    return false;
  }
  try {
    IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
    proxyRepositoryFactory.save(object.getProperty(),this.originaleObjectLabel,this.originalVersion);
    ExpressionPersistance.getInstance().jobNameChanged(originaleObjectLabel,object.getLabel());
    proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
      IESBService service=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
      service.editJobName(originaleObjectLabel,object.getLabel());
    }
    return true;
  }
 catch (  PersistenceException e) {
    MessageBoxExceptionHandler.process(e);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (alreadyEditedByUser || isLock) {
    return false;
  }
  try {
    IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
    proxyRepositoryFactory.save(object.getProperty(),this.originaleObjectLabel,this.originalVersion);
    ExpressionPersistance.getInstance().jobNameChanged(originaleObjectLabel,object.getLabel());
    proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
      IESBService service=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
      service.editJobName(originaleObjectLabel,object.getLabel());
    }
    return true;
  }
 catch (  PersistenceException e) {
    MessageBoxExceptionHandler.process(e);
    return false;
  }
}
Program: 129080
Project: 129080
Buggy source:
public static IRepositoryViewObject getRepositoryObjectById(final String id,boolean withDeleted){
  if (id == null || "String_Node_Str".equals(id) || RepositoryNode.NO_ID.equals(id)) {
    return null;
  }
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    IRepositoryViewObject lastVersion=factory.getLastVersion(id);
    if (lastVersion != null) {
      if (withDeleted) {
        return lastVersion;
      }
 else       if (factory.getStatus(lastVersion) != ERepositoryStatus.DELETED) {
        return lastVersion;
      }
    }
  }
 catch (  PersistenceException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "getRepositoryObjectById".
 * @param id
 * @return
 */
public static IRepositoryViewObject getRepositoryObjectById(final String id){
  if (id == null || "String_Node_Str".equals(id) || RepositoryNode.NO_ID.equals(id)) {
    return null;
  }
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    IRepositoryViewObject lastVersion=factory.getLastVersion(id);
    return lastVersion;
  }
 catch (  PersistenceException e) {
  }
  return null;
}
Program: 129081
Project: 129081
Buggy source:
@SuppressWarnings("String_Node_Str") public static Query getQueryByName(ConnectionItem item,String name){
  if (item == null || name == null) {
    return null;
  }
  final Connection connection=item.getConnection();
  if (connection != null) {
    final QueriesConnection queryConn=connection.getQueries();
    if (queryConn != null) {
      final EList queries=queryConn.getQuery();
      if (queries != null) {
        for (        Query query : (List<Query>)queries) {
          Object object=query.getProperties().get("String_Node_Str");
          if (object == null || (object != null && !object.equals(Boolean.TRUE.toString()))) {
            if (query.getLabel().equals(name)) {
              return query;
            }
          }
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static Query getQueryByName(ConnectionItem item,String name){
  if (item == null || name == null) {
    return null;
  }
  final Connection connection=item.getConnection();
  if (connection != null) {
    final QueriesConnection queryConn=connection.getQueries();
    if (queryConn != null) {
      final EList queries=queryConn.getQuery();
      if (queries != null) {
        for (        Query query : (List<Query>)queries) {
          if (query.getLabel().equals(name)) {
            return query;
          }
        }
      }
    }
  }
  return null;
}
Program: 129082
Project: 129082
Buggy source:
protected boolean isReadOnly(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    return !repositoryFactory.getStatus(object).isEditable() || alreadyEditedByUser;
  }
  return true;
}

Fixed version (ground truth):
protected boolean isReadOnly(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    return !repositoryFactory.getStatus(object).isEditable() || alreadyEditedByUser || isLock;
  }
  return true;
}
Program: 129084
Project: 129084
Buggy source:
@Override public void addPages(){
  mainPage=new PropertiesWizardPage("String_Node_Str",object.getProperty(),path,isReadOnly(),false,lastVersionFound){
    @Override public void createControl(    Composite parent){
      Composite container=new Composite(parent,SWT.NONE);
      GridLayout layout=new GridLayout(2,false);
      container.setLayout(layout);
      if (alreadyEditedByUser) {
        Label label=new Label(container,SWT.NONE);
        label.setForeground(ColorConstants.red);
        label.setText(Messages.getString("String_Node_Str"));
        GridData gridData=new GridData();
        gridData.horizontalSpan=2;
        label.setLayoutData(gridData);
      }
      super.createControl(container);
      setControl(container);
      updateContent();
      addListeners();
      setPageComplete(false);
    }
    @Override protected void evaluateTextField(){
      super.evaluateTextField();
      if (nameStatus.getSeverity() == IStatus.OK) {
        ERepositoryObjectType type=getRepositoryObjectType();
        if (type == ERepositoryObjectType.PROCESS) {
          evaluateNameInRoutine();
        }
 else         if (type == ERepositoryObjectType.ROUTINES || type == ERepositoryObjectType.METADATA_FILE_RULES) {
          evaluateNameInJob();
        }
      }
    }
    @Override public ERepositoryObjectType getRepositoryObjectType(){
      return object.getRepositoryObjectType();
    }
  }
;
  addPage(mainPage);
  setWindowTitle(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void addPages(){
  mainPage=new PropertiesWizardPage("String_Node_Str",object.getProperty(),path,isReadOnly(),false,lastVersionFound){
    @Override public void createControl(    Composite parent){
      Composite container=new Composite(parent,SWT.NONE);
      GridLayout layout=new GridLayout(2,false);
      container.setLayout(layout);
      if (alreadyEditedByUser && isLock) {
        Label label=new Label(container,SWT.NONE);
        label.setForeground(ColorConstants.red);
        label.setText(Messages.getString("String_Node_Str"));
        GridData gridData=new GridData();
        gridData.horizontalSpan=2;
        label.setLayoutData(gridData);
      }
      super.createControl(container);
      setControl(container);
      updateContent();
      addListeners();
      setPageComplete(false);
    }
    @Override protected void evaluateTextField(){
      super.evaluateTextField();
      if (nameStatus.getSeverity() == IStatus.OK) {
        ERepositoryObjectType type=getRepositoryObjectType();
        if (type == ERepositoryObjectType.PROCESS) {
          evaluateNameInRoutine();
        }
 else         if (type == ERepositoryObjectType.ROUTINES || type == ERepositoryObjectType.METADATA_FILE_RULES) {
          evaluateNameInJob();
        }
      }
    }
    @Override public ERepositoryObjectType getRepositoryObjectType(){
      return object.getRepositoryObjectType();
    }
  }
;
  addPage(mainPage);
  setWindowTitle(Messages.getString("String_Node_Str"));
}
Program: 129085
Project: 129085
Buggy source:
@Override public void dispose(){
  unlockObject();
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (!isLock) {
    unlockObject();
  }
  super.dispose();
}
Program: 129086
Project: 129086
Buggy source:
@Override public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(2,false);
  container.setLayout(layout);
  if (alreadyEditedByUser) {
    Label label=new Label(container,SWT.NONE);
    label.setForeground(ColorConstants.red);
    label.setText(Messages.getString("String_Node_Str"));
    GridData gridData=new GridData();
    gridData.horizontalSpan=2;
    label.setLayoutData(gridData);
  }
  super.createControl(container);
  setControl(container);
  updateContent();
  addListeners();
  setPageComplete(false);
}

Fixed version (ground truth):
@Override public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(2,false);
  container.setLayout(layout);
  if (alreadyEditedByUser && isLock) {
    Label label=new Label(container,SWT.NONE);
    label.setForeground(ColorConstants.red);
    label.setText(Messages.getString("String_Node_Str"));
    GridData gridData=new GridData();
    gridData.horizontalSpan=2;
    label.setLayoutData(gridData);
  }
  super.createControl(container);
  setControl(container);
  updateContent();
  addListeners();
  setPageComplete(false);
}
Program: 129087
Project: 129087
Buggy source:
@Override public boolean performFinish(){
  if (alreadyEditedByUser) {
    return false;
  }
  IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
    public void run(    final IProgressMonitor monitor) throws CoreException {
      try {
        IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
        object.getProperty().setLabel(object.getProperty().getDisplayName());
        proxyRepositoryFactory.save(object.getProperty(),originaleObjectLabel,originalVersion);
        ExpressionPersistance.getInstance().jobNameChanged(originaleObjectLabel,object.getLabel());
        proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
          IESBService service=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
          service.editJobName(originaleObjectLabel,object.getLabel());
        }
      }
 catch (      PersistenceException pe) {
        throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",pe));
      }
    }
  }
;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
    return true;
  }
 catch (  CoreException e) {
    MessageBoxExceptionHandler.process(e.getCause());
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (alreadyEditedByUser || isLock) {
    return false;
  }
  IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
    public void run(    final IProgressMonitor monitor) throws CoreException {
      try {
        IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
        object.getProperty().setLabel(object.getProperty().getDisplayName());
        proxyRepositoryFactory.save(object.getProperty(),originaleObjectLabel,originalVersion);
        ExpressionPersistance.getInstance().jobNameChanged(originaleObjectLabel,object.getLabel());
        proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
          IESBService service=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
          service.editJobName(originaleObjectLabel,object.getLabel());
        }
      }
 catch (      PersistenceException pe) {
        throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",pe));
      }
    }
  }
;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
    return true;
  }
 catch (  CoreException e) {
    MessageBoxExceptionHandler.process(e.getCause());
    return false;
  }
}
Program: 129088
Project: 129088
Buggy source:
/** 
 * This handles model notifications by calling   {@link #updateChildren} to update any cachedchildren and by creating a viewer notification, which it passes to  {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void notifyChanged(Notification notification){
  updateChildren(notification);
  super.notifyChanged(notification);
}

Fixed version (ground truth):
/** 
 * This handles model notifications by calling   {@link #updateChildren} to update any cached children and by creatinga viewer notification, which it passes to  {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void notifyChanged(Notification notification){
  updateChildren(notification);
  super.notifyChanged(notification);
}
Program: 129089
Project: 129089
Buggy source:
/** 
 * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public String getText(Object object){
  String label=((Service)object).getId();
  return label == null || label.length() == 0 ? getString("String_Node_Str") : getString("String_Node_Str") + "String_Node_Str" + label;
}

Fixed version (ground truth):
/** 
 * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public String getText(Object object){
  String label=((Service)object).getId();
  return label == null || label.length() == 0 ? getString("String_Node_Str") : getString("String_Node_Str") + "String_Node_Str" + label;
}
Program: 129090
Project: 129090
Buggy source:
/** 
 * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public List getPropertyDescriptors(Object object){
  if (itemPropertyDescriptors == null) {
    super.getPropertyDescriptors(object);
  }
  return itemPropertyDescriptors;
}

Fixed version (ground truth):
/** 
 * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public List getPropertyDescriptors(Object object){
  if (itemPropertyDescriptors == null) {
    super.getPropertyDescriptors(object);
  }
  return itemPropertyDescriptors;
}
Program: 129091
Project: 129091
Buggy source:
/** 
 * This returns Service.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public Object getImage(Object object){
  return overlayImage(object,getResourceLocator().getImage("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * This returns Service.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
 */
@Override public Object getImage(Object object){
  return ImageDescriptor.createFromFile(ECoreImage.class,ECoreImage.SERVICES_ICON.getPath()).createImage();
}
Program: 129092
Project: 129092
Buggy source:
/** 
 * This adds   {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under this object. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
protected void collectNewChildDescriptors(Collection newChildDescriptors,Object object){
  super.collectNewChildDescriptors(newChildDescriptors,object);
}

Fixed version (ground truth):
/** 
 * This adds   {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under this object. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override protected void collectNewChildDescriptors(Collection newChildDescriptors,Object object){
  super.collectNewChildDescriptors(newChildDescriptors,object);
}
Program: 129093
Project: 129093
Buggy source:
protected boolean isReadOnly(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    return !repositoryFactory.getStatus(object).isEditable() || alreadyEditedByUser;
  }
  return true;
}

Fixed version (ground truth):
protected boolean isReadOnly(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    return !repositoryFactory.getStatus(object).isEditable() || alreadyEditedByUser || isLock;
  }
  return true;
}
Program: 129095
Project: 129095
Buggy source:
@Override public void addPages(){
  mainPage=new PropertiesWizardPage("String_Node_Str",object.getProperty(),path,isReadOnly(),false,lastVersionFound){
    @Override public void createControl(    Composite parent){
      Composite container=new Composite(parent,SWT.NONE);
      GridLayout layout=new GridLayout(2,false);
      container.setLayout(layout);
      if (alreadyEditedByUser) {
        Label label=new Label(container,SWT.NONE);
        label.setForeground(ColorConstants.red);
        label.setText(Messages.getString("String_Node_Str"));
        GridData gridData=new GridData();
        gridData.horizontalSpan=2;
        label.setLayoutData(gridData);
      }
      super.createControl(container);
      setControl(container);
      updateContent();
      addListeners();
      setPageComplete(false);
    }
    @Override protected void evaluateTextField(){
      super.evaluateTextField();
      if (nameStatus.getSeverity() == IStatus.OK) {
        ERepositoryObjectType type=getRepositoryObjectType();
        if (type == ERepositoryObjectType.PROCESS) {
          evaluateNameInRoutine();
        }
 else         if (type == ERepositoryObjectType.ROUTINES || type == ERepositoryObjectType.METADATA_FILE_RULES) {
          evaluateNameInJob();
        }
      }
    }
    @Override public ERepositoryObjectType getRepositoryObjectType(){
      return object.getRepositoryObjectType();
    }
  }
;
  addPage(mainPage);
  setWindowTitle(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void addPages(){
  mainPage=new PropertiesWizardPage("String_Node_Str",object.getProperty(),path,isReadOnly(),false,lastVersionFound){
    @Override public void createControl(    Composite parent){
      Composite container=new Composite(parent,SWT.NONE);
      GridLayout layout=new GridLayout(2,false);
      container.setLayout(layout);
      if (alreadyEditedByUser && isLock) {
        Label label=new Label(container,SWT.NONE);
        label.setForeground(ColorConstants.red);
        label.setText(Messages.getString("String_Node_Str"));
        GridData gridData=new GridData();
        gridData.horizontalSpan=2;
        label.setLayoutData(gridData);
      }
      super.createControl(container);
      setControl(container);
      updateContent();
      addListeners();
      setPageComplete(false);
    }
    @Override protected void evaluateTextField(){
      super.evaluateTextField();
      if (nameStatus.getSeverity() == IStatus.OK) {
        ERepositoryObjectType type=getRepositoryObjectType();
        if (type == ERepositoryObjectType.PROCESS) {
          evaluateNameInRoutine();
        }
 else         if (type == ERepositoryObjectType.ROUTINES || type == ERepositoryObjectType.METADATA_FILE_RULES) {
          evaluateNameInJob();
        }
      }
    }
    @Override public ERepositoryObjectType getRepositoryObjectType(){
      return object.getRepositoryObjectType();
    }
  }
;
  addPage(mainPage);
  setWindowTitle(Messages.getString("String_Node_Str"));
}
Program: 129096
Project: 129096
Buggy source:
@Override public void dispose(){
  unlockObject();
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (!isLock) {
    unlockObject();
  }
  super.dispose();
}
Program: 129097
Project: 129097
Buggy source:
@Override public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(2,false);
  container.setLayout(layout);
  if (alreadyEditedByUser) {
    Label label=new Label(container,SWT.NONE);
    label.setForeground(ColorConstants.red);
    label.setText(Messages.getString("String_Node_Str"));
    GridData gridData=new GridData();
    gridData.horizontalSpan=2;
    label.setLayoutData(gridData);
  }
  super.createControl(container);
  setControl(container);
  updateContent();
  addListeners();
  setPageComplete(false);
}

Fixed version (ground truth):
@Override public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(2,false);
  container.setLayout(layout);
  if (alreadyEditedByUser && isLock) {
    Label label=new Label(container,SWT.NONE);
    label.setForeground(ColorConstants.red);
    label.setText(Messages.getString("String_Node_Str"));
    GridData gridData=new GridData();
    gridData.horizontalSpan=2;
    label.setLayoutData(gridData);
  }
  super.createControl(container);
  setControl(container);
  updateContent();
  addListeners();
  setPageComplete(false);
}
Program: 129098
Project: 129098
Buggy source:
@Override public boolean performFinish(){
  if (alreadyEditedByUser) {
    return false;
  }
  IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
    public void run(    final IProgressMonitor monitor) throws CoreException {
      try {
        IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
        object.getProperty().setLabel(object.getProperty().getDisplayName());
        proxyRepositoryFactory.save(object.getProperty(),originaleObjectLabel,originalVersion);
        ExpressionPersistance.getInstance().jobNameChanged(originaleObjectLabel,object.getLabel());
        proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
          IESBService service=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
          service.editJobName(originaleObjectLabel,object.getLabel());
        }
      }
 catch (      PersistenceException pe) {
        throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",pe));
      }
    }
  }
;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
    return true;
  }
 catch (  CoreException e) {
    MessageBoxExceptionHandler.process(e.getCause());
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (alreadyEditedByUser || isLock) {
    return false;
  }
  IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
    public void run(    final IProgressMonitor monitor) throws CoreException {
      try {
        IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
        object.getProperty().setLabel(object.getProperty().getDisplayName());
        proxyRepositoryFactory.save(object.getProperty(),originaleObjectLabel,originalVersion);
        ExpressionPersistance.getInstance().jobNameChanged(originaleObjectLabel,object.getLabel());
        proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
          IESBService service=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
          service.editJobName(originaleObjectLabel,object.getLabel());
        }
      }
 catch (      PersistenceException pe) {
        throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",pe));
      }
    }
  }
;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
    return true;
  }
 catch (  CoreException e) {
    MessageBoxExceptionHandler.process(e.getCause());
    return false;
  }
}
Program: 129100
Project: 129100
Buggy source:
/** 
 * Looks up the context parameter value under the specified context.
 * @param sourceId
 * @param contextParaName
 * @param index
 * @return
 */
private String lookupContextParameterValue(String sourceId,String contextParaName,int index){
  IContextParameter contextPara=lookupContextParameter(sourceId,contextParaName,index);
  if (contextPara != null)   return contextPara.getValue();
  return null;
}

Fixed version (ground truth):
/** 
 * Looks up the context parameter value under the specified context.
 * @param sourceId
 * @param contextParaName
 * @param index
 * @return
 */
private String lookupContextParameterValue(String sourceId,String contextParaName,int index){
  IContextParameter contextPara=lookupContextParameter(sourceId,contextParaName,index);
  if (contextPara != null)   return ContextParameterUtils.checkAndHideValue(contextPara);
  return null;
}
Program: 129101
Project: 129101
Buggy source:
private String getColumnTextForChild(ContextTableTabChildModel child,int columnIndex){
  String text="String_Node_Str";
  String sourceId=child.getContextParameter().getSource();
  String variableName=child.getContextParameter().getName();
  List<IContext> contextList=parentModel.getContexts();
  int size=contextList.size();
  if (columnIndex == 0)   return child.getContextParameter().getName();
 else   if (columnIndex - 1 < size) {
    IContext context=contextList.get(columnIndex - 1);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempName=contextPara.getName();
        String tempSourceId=contextPara.getSource();
        if (tempName.equals(variableName) && tempSourceId.equals(sourceId)) {
          return contextPara.getValue();
        }
      }
    }
  }
  return text;
}

Fixed version (ground truth):
private String getColumnTextForChild(ContextTableTabChildModel child,int columnIndex){
  String text="String_Node_Str";
  String sourceId=child.getContextParameter().getSource();
  String variableName=child.getContextParameter().getName();
  List<IContext> contextList=parentModel.getContexts();
  int size=contextList.size();
  if (columnIndex == 0)   return child.getContextParameter().getName();
 else   if (columnIndex - 1 < size) {
    IContext context=contextList.get(columnIndex - 1);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempName=contextPara.getName();
        String tempSourceId=contextPara.getSource();
        if (tempName.equals(variableName) && tempSourceId.equals(sourceId)) {
          return ContextParameterUtils.checkAndHideValue(contextPara);
        }
      }
    }
  }
  return text;
}
Program: 129103
Project: 129103
Buggy source:
private void lockObject(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    try {
      boolean isOpened=false;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
        ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
        isOpened=coreService.isOpenedItemInEditor(object);
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER) && isOpened) {
        alreadyEditedByUser=true;
      }
 else {
        repositoryFactory.lock(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    BusinessException e) {
    }
  }
}

Fixed version (ground truth):
private void lockObject(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    try {
      boolean isOpened=false;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
        ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
        isOpened=coreService.isOpenedItemInEditor(object);
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER)) {
        isLock=true;
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER) && isOpened) {
        alreadyEditedByUser=true;
      }
 else {
        repositoryFactory.lock(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    BusinessException e) {
    }
  }
}
Program: 129104
Project: 129104
Buggy source:
public int compare(IContext o1,IContext o2){
  String name1=o1.getName().toUpperCase();
  String name2=o2.getName().toUpperCase();
  return name1.compareTo(name2);
}

Fixed version (ground truth):
@Override public int compare(IContext o1,IContext o2){
  String name1=o1.getName().toUpperCase();
  String name2=o2.getName().toUpperCase();
  return name1.compareTo(name2);
}
Program: 129106
Project: 129106
Buggy source:
public IContextModelManager getContextModelManager(){
  return this.modelManager;
}

Fixed version (ground truth):
@Override public IContextModelManager getContextModelManager(){
  return this.modelManager;
}
Program: 129107
Project: 129107
Buggy source:
public void handleEvent(Event e){
  final TreeColumn column=(TreeColumn)e.widget;
  if (column == table.getSortColumn()) {
    direction=-direction;
  }
  if (direction == 1) {
    table.setSortDirection(SWT.UP);
  }
 else {
    table.setSortDirection(SWT.DOWN);
  }
  table.setSortColumn(column);
  viewer2.setSorter(new ViewerSorter(){
    int index=0;
    @Override public void sort(    Viewer viewer,    Object[] elements){
      boolean found=false;
      for (index=0; index < table.getColumns().length; index++) {
        if (table.getColumn(index) == table.getSortColumn()) {
          found=true;
          break;
        }
      }
      if (!found) {
        index=0;
      }
      super.sort(viewer,elements);
    }
    @Override public int compare(    Viewer viewer,    Object e1,    Object e2){
      ITableLabelProvider labelProvider=(ITableLabelProvider)viewer2.getLabelProvider();
      String columnText=labelProvider.getColumnText(e1,index) != null ? labelProvider.getColumnText(e1,index) : "String_Node_Str";
      String columnText2=labelProvider.getColumnText(e2,index) != null ? labelProvider.getColumnText(e2,index) : "String_Node_Str";
      return getComparator().compare(columnText,columnText2) * direction;
    }
  }
);
}

Fixed version (ground truth):
@Override public void handleEvent(Event e){
  final TreeColumn column=(TreeColumn)e.widget;
  if (column == table.getSortColumn()) {
    direction=-direction;
  }
  if (direction == 1) {
    table.setSortDirection(SWT.UP);
  }
 else {
    table.setSortDirection(SWT.DOWN);
  }
  table.setSortColumn(column);
  viewer2.setSorter(new ViewerSorter(){
    int index=0;
    @Override public void sort(    Viewer viewer,    Object[] elements){
      boolean found=false;
      for (index=0; index < table.getColumns().length; index++) {
        if (table.getColumn(index) == table.getSortColumn()) {
          found=true;
          break;
        }
      }
      if (!found) {
        index=0;
      }
      super.sort(viewer,elements);
    }
    @Override public int compare(    Viewer viewer,    Object e1,    Object e2){
      ITableLabelProvider labelProvider=(ITableLabelProvider)viewer2.getLabelProvider();
      String columnText=labelProvider.getColumnText(e1,index) != null ? labelProvider.getColumnText(e1,index) : "String_Node_Str";
      String columnText2=labelProvider.getColumnText(e2,index) != null ? labelProvider.getColumnText(e2,index) : "String_Node_Str";
      return getComparator().compare(columnText,columnText2) * direction;
    }
  }
);
}
Program: 129109
Project: 129109
Buggy source:
public void applyEditorValue(){
  editing=true;
}

Fixed version (ground truth):
@Override public void applyEditorValue(){
  editing=true;
}
Program: 129110
Project: 129110
Buggy source:
public void editorValueChanged(boolean oldValidState,boolean newValidState){
}

Fixed version (ground truth):
@Override public void editorValueChanged(boolean oldValidState,boolean newValidState){
}
Program: 129111
Project: 129111
Buggy source:
public void cancelEditor(){
  deactivateCellEditor(tableEditor,columnIndex);
}

Fixed version (ground truth):
@Override public void cancelEditor(){
  deactivateCellEditor(tableEditor,columnIndex);
}
Program: 129112
Project: 129112
Buggy source:
public TreeViewer getViewer(){
  return this.viewer;
}

Fixed version (ground truth):
@Override public TreeViewer getViewer(){
  return this.viewer;
}
Program: 129113
Project: 129113
Buggy source:
public boolean isGroupBySource(){
  boolean isRepositoryContext=false;
  if (modelManager != null) {
    isRepositoryContext=(modelManager instanceof ContextComposite) && ((ContextComposite)modelManager).isRepositoryContext();
  }
  boolean value=getPreferenceStore().getBoolean(ITalendCorePrefConstants.CONTEXT_GROUP_BY_SOURCE);
  return value && !isRepositoryContext;
}

Fixed version (ground truth):
@Override public boolean isGroupBySource(){
  boolean isRepositoryContext=false;
  if (modelManager != null) {
    isRepositoryContext=(modelManager instanceof ContextComposite) && ((ContextComposite)modelManager).isRepositoryContext();
  }
  boolean value=getPreferenceStore().getBoolean(ITalendCorePrefConstants.CONTEXT_GROUP_BY_SOURCE);
  return value && !isRepositoryContext;
}
Program: 129114
Project: 129114
Buggy source:
private ICellEditorListener createEditorListener(final TreeEditor tableEditor,final int columnIndex){
  editorListener=new ICellEditorListener(){
    public void cancelEditor(){
      deactivateCellEditor(tableEditor,columnIndex);
    }
    public void editorValueChanged(    boolean oldValidState,    boolean newValidState){
    }
    public void applyEditorValue(){
      editing=true;
    }
  }
;
  return editorListener;
}

Fixed version (ground truth):
private ICellEditorListener createEditorListener(final TreeEditor tableEditor,final int columnIndex){
  editorListener=new ICellEditorListener(){
    @Override public void cancelEditor(){
      deactivateCellEditor(tableEditor,columnIndex);
    }
    @Override public void editorValueChanged(    boolean oldValidState,    boolean newValidState){
    }
    @Override public void applyEditorValue(){
      editing=true;
    }
  }
;
  return editorListener;
}
Program: 129115
Project: 129115
Buggy source:
public Object getParent(Object element){
  if (element instanceof ContextTableTabChildModel) {
    ContextTableTabChildModel child=(ContextTableTabChildModel)element;
    return child.getParent();
  }
  return null;
}

Fixed version (ground truth):
@Override public Object getParent(Object element){
  if (element instanceof ContextTableTabChildModel) {
    ContextTableTabChildModel child=(ContextTableTabChildModel)element;
    return child.getParent();
  }
  return null;
}
Program: 129116
Project: 129116
Buggy source:
public boolean hasChildren(Object element){
  if (element instanceof ContextTableTabParentModel) {
    ContextTableTabParentModel parent=(ContextTableTabParentModel)element;
    return parent.hasChildren();
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean hasChildren(Object element){
  if (element instanceof ContextTableTabParentModel) {
    ContextTableTabParentModel parent=(ContextTableTabParentModel)element;
    return parent.hasChildren();
  }
  return false;
}
Program: 129117
Project: 129117
Buggy source:
/** 
 * Looks up the context parameter value under the specified context.
 * @param sourceId
 * @param contextParaName
 * @param index
 * @return
 */
private String lookupContextParameterValue(String sourceId,String contextParaName,int index){
  IContextParameter contextPara=lookupContextParameter(sourceId,contextParaName,index);
  if (contextPara != null)   return contextPara.getValue();
  return null;
}

Fixed version (ground truth):
/** 
 * Looks up the context parameter value under the specified context.
 * @param sourceId
 * @param contextParaName
 * @param index
 * @return
 */
private String lookupContextParameterValue(String sourceId,String contextParaName,int index){
  IContextParameter contextPara=lookupContextParameter(sourceId,contextParaName,index);
  if (contextPara != null) {
    return ContextParameterUtils.checkAndHideValue(contextPara);
  }
  return null;
}
Program: 129118
Project: 129118
Buggy source:
/** 
 * @param name
 * @return
 */
private boolean hasSameNameContextParameters(String name){
  boolean has=false;
  IContextManager contextManager=parentModel.getContextModelManager().getContextManager();
  IContext context=contextManager.getDefaultContext();
  if (context instanceof JobContext) {
    JobContext jobContext=(JobContext)context;
    int size=jobContext.getSameNameContextParameterSize(name);
    if (size > 1)     has=true;
  }
  return has;
}

Fixed version (ground truth):
/** 
 * @param name
 * @return
 */
private boolean hasSameNameContextParameters(String name){
  boolean has=false;
  IContextManager contextManager=parentModel.getContextModelManager().getContextManager();
  IContext context=contextManager.getDefaultContext();
  if (context instanceof JobContext) {
    JobContext jobContext=(JobContext)context;
    int size=jobContext.getSameNameContextParameterSize(name);
    if (size > 1) {
      has=true;
    }
  }
  return has;
}
Program: 129119
Project: 129119
Buggy source:
public Color getForeground(Object element,int columnIndex){
  return null;
}

Fixed version (ground truth):
@Override public Color getForeground(Object element,int columnIndex){
  return null;
}
Program: 129120
Project: 129120
Buggy source:
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof ContextTableTabParentModel) {
    ContextTableTabParentModel parent=(ContextTableTabParentModel)parentElement;
    return parent.getChildren().toArray();
  }
  return new Object[0];
}

Fixed version (ground truth):
@Override public Object[] getChildren(Object parentElement){
  if (parentElement instanceof ContextTableTabParentModel) {
    ContextTableTabParentModel parent=(ContextTableTabParentModel)parentElement;
    return parent.getChildren().toArray();
  }
  return new Object[0];
}
Program: 129121
Project: 129121
Buggy source:
private String getColumnTextForChild(ContextTableTabChildModel child,int columnIndex){
  String text="String_Node_Str";
  String sourceId=child.getContextParameter().getSource();
  String variableName=child.getContextParameter().getName();
  List<IContext> contextList=parentModel.getContexts();
  int size=contextList.size();
  if (columnIndex == 0)   return child.getContextParameter().getName();
 else   if (columnIndex - 1 < size) {
    IContext context=contextList.get(columnIndex - 1);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempName=contextPara.getName();
        String tempSourceId=contextPara.getSource();
        if (tempName.equals(variableName) && tempSourceId.equals(sourceId)) {
          return contextPara.getValue();
        }
      }
    }
  }
  return text;
}

Fixed version (ground truth):
private String getColumnTextForChild(ContextTableTabChildModel child,int columnIndex){
  String text="String_Node_Str";
  String sourceId=child.getContextParameter().getSource();
  String variableName=child.getContextParameter().getName();
  List<IContext> contextList=parentModel.getContexts();
  int size=contextList.size();
  if (columnIndex == 0) {
    return child.getContextParameter().getName();
  }
 else   if (columnIndex - 1 < size) {
    IContext context=contextList.get(columnIndex - 1);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempName=contextPara.getName();
        String tempSourceId=contextPara.getSource();
        if (tempName.equals(variableName) && tempSourceId.equals(sourceId)) {
          return ContextParameterUtils.checkAndHideValue(contextPara);
        }
      }
    }
  }
  return text;
}
Program: 129122
Project: 129122
Buggy source:
@SuppressWarnings("String_Node_Str") public Object[] getElements(Object inputElement){
  List<IContextParameter> contexts=(List<IContextParameter>)inputElement;
  List<ContextTableTabParentModel> output=new ArrayList<ContextTableTabParentModel>();
  if (!contexts.isEmpty()) {
    for (    IContextParameter para : contexts) {
      String sourceId=para.getSource();
      if (IContextParameter.BUILT_IN.equals(sourceId)) {
        handleBuiltInNode(para,output);
      }
 else {
        handleNonBuiltInNode(para,output);
      }
    }
  }
  return output.toArray();
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public Object[] getElements(Object inputElement){
  List<IContextParameter> contexts=(List<IContextParameter>)inputElement;
  List<ContextTableTabParentModel> output=new ArrayList<ContextTableTabParentModel>();
  if (!contexts.isEmpty()) {
    for (    IContextParameter para : contexts) {
      String sourceId=para.getSource();
      if (IContextParameter.BUILT_IN.equals(sourceId)) {
        handleBuiltInNode(para,output);
      }
 else {
        handleNonBuiltInNode(para,output);
      }
    }
  }
  return output.toArray();
}
Program: 129123
Project: 129123
Buggy source:
public String getColumnText(Object element,int columnIndex){
  if (element instanceof ContextTableTabParentModel) {
    ContextTableTabParentModel parent=(ContextTableTabParentModel)element;
    return getColumnTextForParent(parent,columnIndex);
  }
 else   if (element instanceof ContextTableTabChildModel) {
    ContextTableTabChildModel child=(ContextTableTabChildModel)element;
    return getColumnTextForChild(child,columnIndex);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getColumnText(Object element,int columnIndex){
  if (element instanceof ContextTableTabParentModel) {
    ContextTableTabParentModel parent=(ContextTableTabParentModel)element;
    return getColumnTextForParent(parent,columnIndex);
  }
 else   if (element instanceof ContextTableTabChildModel) {
    ContextTableTabChildModel child=(ContextTableTabChildModel)element;
    return getColumnTextForChild(child,columnIndex);
  }
  return "String_Node_Str";
}
Program: 129125
Project: 129125
Buggy source:
public Color getBackground(Object element,int columnIndex){
  if (element instanceof ContextTableTabChildModel) {
    ContextTableTabChildModel child=(ContextTableTabChildModel)element;
    IContextParameter contextPara=child.getContextParameter();
    String name=contextPara.getName();
    if (hasSameNameContextParameters(name))     return Display.getDefault().getSystemColor(SWT.COLOR_RED);
  }
 else   if (element instanceof ContextTableTabParentModel) {
    ContextTableTabParentModel parent=(ContextTableTabParentModel)element;
    IContextParameter contextPara=parent.getContextParameter();
    if (contextPara != null) {
      String name=parent.getContextParameter().getName();
      if (hasSameNameContextParameters(name))       return Display.getDefault().getSystemColor(SWT.COLOR_RED);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Color getBackground(Object element,int columnIndex){
  if (element instanceof ContextTableTabChildModel) {
    ContextTableTabChildModel child=(ContextTableTabChildModel)element;
    IContextParameter contextPara=child.getContextParameter();
    String name=contextPara.getName();
    if (hasSameNameContextParameters(name)) {
      return Display.getDefault().getSystemColor(SWT.COLOR_RED);
    }
  }
 else   if (element instanceof ContextTableTabParentModel) {
    ContextTableTabParentModel parent=(ContextTableTabParentModel)element;
    IContextParameter contextPara=parent.getContextParameter();
    if (contextPara != null) {
      String name=parent.getContextParameter().getName();
      if (hasSameNameContextParameters(name)) {
        return Display.getDefault().getSystemColor(SWT.COLOR_RED);
      }
    }
  }
  return null;
}