nus-yam/ex-repair huggingface dataset:
Program: 123596
Project: 123596
Buggy source:
private static void executeUpdate(UpdateResult result,IProgressMonitor monitor){
  if (result.isReadOnlyProcess()) {
    return;
  }
  Command command=null;
switch (result.getUpdateType()) {
case NODE_PROPERTY:
case NODE_SCHEMA:
case NODE_QUERY:
case NODE_SAP_IDOC:
case NODE_SAP_FUNCTION:
case NODE_VALIDATION_RULE:
    command=new UpdateNodeParameterCommand(result);
  break;
case JOB_PROPERTY_EXTRA:
case JOB_PROPERTY_STATS_LOGS:
case JOB_PROPERTY_HEADERFOOTER:
command=new UpdateMainParameterCommand(result);
break;
case CONTEXT:
command=executeContextUpdates(result);
break;
case CONTEXT_GROUP:
command=executeContextGroupUpdates(result);
break;
case JOBLET_RENAMED:
case JOBLET_SCHEMA:
case RELOAD:
command=executeJobletNodesUpdates(result);
break;
case JOBLET_CONTEXT:
command=new Command(){
}
;
break;
default :
break;
}
if (command != null) {
SubProgressMonitor subMonitor=new SubProgressMonitor(monitor,1 * UpdatesConstants.SCALE,SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
subMonitor.beginTask(UpdatesConstants.EMPTY,1);
subMonitor.subTask(getResultTaskInfor(result));
Object job=result.getJob();
boolean executed=false;
if (job != null) {
if (job instanceof IProcess2) {
IProcess2 process=(IProcess2)job;
process.getCommandStack().execute(command);
executed=true;
}
}
if (!executed) {
command.execute();
}
if (result.isFromItem()) {
saveModifiedItem(result);
}
subMonitor.worked(1);
}
}

Fixed version (ground truth):
private static void executeUpdate(UpdateResult result,IProgressMonitor monitor){
  if (result.isReadOnlyProcess()) {
    return;
  }
  Command command=null;
switch (result.getUpdateType()) {
case NODE_PROPERTY:
case NODE_SCHEMA:
case NODE_QUERY:
case NODE_SAP_IDOC:
case NODE_SAP_FUNCTION:
case NODE_VALIDATION_RULE:
    command=new UpdateNodeParameterCommand(result);
  break;
case JOB_PROPERTY_EXTRA:
case JOB_PROPERTY_STATS_LOGS:
case JOB_PROPERTY_HEADERFOOTER:
command=new UpdateMainParameterCommand(result);
break;
case CONTEXT:
command=executeContextUpdates(result);
break;
case CONTEXT_GROUP:
command=executeContextGroupUpdates(result);
break;
case JOBLET_RENAMED:
case JOBLET_SCHEMA:
case RELOAD:
command=executeJobletNodesUpdates(result);
break;
case JOBLET_CONTEXT:
command=new Command(){
}
;
break;
default :
break;
}
if (command != null) {
SubProgressMonitor subMonitor=new SubProgressMonitor(monitor,1 * UpdatesConstants.SCALE,SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
subMonitor.beginTask(UpdatesConstants.EMPTY,1);
subMonitor.subTask(getResultTaskInfor(result));
Object job=result.getJob();
boolean executed=false;
if (job != null) {
if (job instanceof IProcess2) {
IProcess2 process=(IProcess2)job;
process.getCommandStack().execute(command);
executed=true;
}
}
if (!executed) {
command.execute();
}
if (result.isFromItem() || result.getResultType() == EUpdateResult.JOBLET_UPDATE) {
saveModifiedItem(result);
}
subMonitor.worked(1);
}
}
Program: 123597
Project: 123597
Buggy source:
@Override public Saveable[] getSaveables(){
  Saveable[] saveables=null;
  IEditorPart currEditorPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (currEditorPart == null)   saveables=new Saveable[0];
 else {
    if (currEditorPart.isDirty()) {
      saveables=new Saveable[1];
      saveables[0]=new TalendSaveablePart(currEditorPart);
    }
  }
  return saveables;
}

Fixed version (ground truth):
@Override public Saveable[] getSaveables(){
  Saveable[] saveables=new Saveable[0];
  if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
    IEditorPart currEditorPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (currEditorPart == null)     saveables=new Saveable[0];
 else {
      if (currEditorPart.isDirty()) {
        saveables=new Saveable[1];
        saveables[0]=new TalendSaveablePart(currEditorPart);
      }
    }
  }
  return saveables;
}
Program: 123599
Project: 123599
Buggy source:
/** 
 * ftang Comment method "getCurrentJobVersion".
 * @return
 */
public static String getCurrentVersion(RepositoryNode repositoryNode){
  try {
    List<IRepositoryNode> nodeChildren=repositoryNode.getChildren();
    if ((repositoryNode.getId() == "String_Node_Str") && (nodeChildren != null) && (nodeChildren.size() == 1)) {
      return ProxyRepositoryFactory.getInstance().getLastVersion(nodeChildren.get(0).getId()).getVersion();
    }
 else {
      return ProxyRepositoryFactory.getInstance().getLastVersion(repositoryNode.getId()).getVersion();
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * ftang Comment method "getCurrentJobVersion".
 * @return
 */
public static String getCurrentVersion(RepositoryNode repositoryNode){
  try {
    List<IRepositoryNode> nodeChildren=repositoryNode.getChildren();
    if ("String_Node_Str".equals(repositoryNode.getObject().getRepositoryObjectType() + "String_Node_Str") || ("String_Node_Str".equals(repositoryNode.getId()) && nodeChildren != null) && (nodeChildren.size() == 1)) {
      return ProxyRepositoryFactory.getInstance().getLastVersion(nodeChildren.get(0).getId()).getVersion();
    }
 else {
      return ProxyRepositoryFactory.getInstance().getLastVersion(repositoryNode.getId()).getVersion();
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return "String_Node_Str";
}
Program: 123600
Project: 123600
Buggy source:
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    String extensionName=tm.getType().getName();
    String parentDisplayName=tm.getDisplayName();
    int extensionIndex=parentDisplayName.indexOf(extensionName);
    parentName=parentDisplayName.substring(0,extensionIndex - 1);
  }
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ TalendTextUtils.LBRACKET+ this.primitive.getName()+ TalendTextUtils.RBRACKET;
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    String extensionName=tm.getType().getName();
    String parentDisplayName=tm.getDisplayName();
    int extensionIndex=parentDisplayName.lastIndexOf(extensionName);
    parentName=parentDisplayName.substring(0,extensionIndex - 1);
  }
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ TalendTextUtils.LBRACKET+ this.primitive.getName()+ TalendTextUtils.RBRACKET;
}
Program: 123601
Project: 123601
Buggy source:
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    String extensionName=tm.getType().getName();
    String parentDisplayName=tm.getDisplayName();
    int extensionIndex=parentDisplayName.indexOf(extensionName);
    parentName=parentDisplayName.substring(0,extensionIndex - 1);
  }
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ TalendTextUtils.LBRACKET+ this.primitive.getName()+ TalendTextUtils.RBRACKET;
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    String extensionName=tm.getType().getName();
    String parentDisplayName=tm.getDisplayName();
    int extensionIndex=parentDisplayName.lastIndexOf(extensionName);
    parentName=parentDisplayName.substring(0,extensionIndex - 1);
  }
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ TalendTextUtils.LBRACKET+ this.primitive.getName()+ TalendTextUtils.RBRACKET;
}
Program: 123602
Project: 123602
Buggy source:
@Override public Object getBusinessAppearanceComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory widgetFactory,ISelection selection){
  return new BusinessAppearanceComposite(parent,SWT.NONE,widgetFactory,selection);
}

Fixed version (ground truth):
public Object getBusinessAppearanceComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory widgetFactory,ISelection selection){
  return new BusinessAppearanceComposite(parent,SWT.NONE,widgetFactory,selection);
}
Program: 123603
Project: 123603
Buggy source:
@Override public Object getBusinessRulersAndGridComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory widgetFactory,IRepositoryObject obj){
  return new BusinessRulersAndGridComposite(parent,SWT.NONE,widgetFactory,obj);
}

Fixed version (ground truth):
public Object getBusinessRulersAndGridComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory widgetFactory,IRepositoryObject obj){
  return new BusinessRulersAndGridComposite(parent,SWT.NONE,widgetFactory,obj);
}
Program: 123604
Project: 123604
Buggy source:
@Override public boolean isInstanceOfCompartmentEditPart(Object o){
  return o instanceof CompartmentEditPart;
}

Fixed version (ground truth):
public boolean isInstanceOfCompartmentEditPart(Object o){
  return o instanceof CompartmentEditPart;
}
Program: 123605
Project: 123605
Buggy source:
@Override public boolean isInstanceOfBusinessAssignmentComposite(Object o){
  return o instanceof BusinessAssignmentComposite;
}

Fixed version (ground truth):
public boolean isInstanceOfBusinessAssignmentComposite(Object o){
  return o instanceof BusinessAssignmentComposite;
}
Program: 123606
Project: 123606
Buggy source:
@Override public Object getBusinessAssignmentComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory widgetFactory,ISelection selection){
  return new BusinessAssignmentComposite(parent,SWT.NONE,widgetFactory,selection);
}

Fixed version (ground truth):
public Object getBusinessAssignmentComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory widgetFactory,ISelection selection){
  return new BusinessAssignmentComposite(parent,SWT.NONE,widgetFactory,selection);
}
Program: 123607
Project: 123607
Buggy source:
protected void doRun(){
  SimpleBusinessCreationWizard wizard=new SimpleBusinessCreationWizard(getActivePage().getWorkbenchWindow().getWorkbench(),getPath());
  WizardDialog wizardDialog=new WizardDialog(new Shell(),wizard);
  wizardDialog.create();
  wizardDialog.open();
  RepositoryManager.refreshCreatedNode(ERepositoryObjectType.BUSINESS_PROCESS);
}

Fixed version (ground truth):
@Override protected void doRun(){
  SimpleBusinessCreationWizard wizard=new SimpleBusinessCreationWizard(getActivePage().getWorkbenchWindow().getWorkbench(),getPath());
  WizardDialog wizardDialog=new WizardDialog(new Shell(),wizard);
  wizardDialog.create();
  wizardDialog.open();
}
Program: 123609
Project: 123609
Buggy source:
@Override public void run(){
  SaveAsProcessWizard processWizard=new SaveAsProcessWizard(editorPart);
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),processWizard);
  if (dlg.open() == Window.OK) {
    try {
      RepositoryManager.refreshCreatedNode(ERepositoryObjectType.PROCESS);
      JobEditorInput newJobEditorInput=new ProcessEditorInput(processWizard.getProcess(),true,true,false);
      IWorkbenchPage page=getActivePage();
      IRepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(newJobEditorInput.getItem().getProperty().getId(),false);
      newJobEditorInput.setRepositoryNode(repositoryNode);
      page.closeEditor(((AbstractTalendEditor)this.editorPart).getParent(),false);
      page.openEditor(newJobEditorInput,MultiPageTalendEditor.ID,true);
    }
 catch (    Exception e) {
      MessageDialog.openError(Display.getCurrent().getActiveShell(),"String_Node_Str","String_Node_Str" + "String_Node_Str" + e.getMessage());
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  SaveAsProcessWizard processWizard=new SaveAsProcessWizard(editorPart);
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),processWizard);
  if (dlg.open() == Window.OK) {
    try {
      JobEditorInput newJobEditorInput=new ProcessEditorInput(processWizard.getProcess(),true,true,false);
      IWorkbenchPage page=getActivePage();
      IRepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(newJobEditorInput.getItem().getProperty().getId(),false);
      newJobEditorInput.setRepositoryNode(repositoryNode);
      page.closeEditor(((AbstractTalendEditor)this.editorPart).getParent(),false);
      page.openEditor(newJobEditorInput,MultiPageTalendEditor.ID,true);
    }
 catch (    Exception e) {
      MessageDialog.openError(Display.getCurrent().getActiveShell(),"String_Node_Str","String_Node_Str" + "String_Node_Str" + e.getMessage());
      ExceptionHandler.process(e);
    }
  }
}
Program: 123613
Project: 123613
Buggy source:
@Override protected void doRun(){
  DocumentationCreateWizard docWizard=new DocumentationCreateWizard(PlatformUI.getWorkbench(),getPath());
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),docWizard);
  dlg.open();
  RepositoryNode node=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  RepositoryManager.refreshCreatedNode(ERepositoryObjectType.DOCUMENTATION);
}

Fixed version (ground truth):
@Override protected void doRun(){
  DocumentationCreateWizard docWizard=new DocumentationCreateWizard(PlatformUI.getWorkbench(),getPath());
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),docWizard);
  dlg.open();
  RepositoryNode node=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
}
Program: 123614
Project: 123614
Buggy source:
@Override public IContextParameter getContextParameter(String sourceId,String paraName){
  return null;
}

Fixed version (ground truth):
public IContextParameter getContextParameter(String sourceId,String paraName){
  return null;
}
Program: 123615
Project: 123615
Buggy source:
@Override public IContextParameter getContextParameter(String sourceId,String paraName){
  return null;
}

Fixed version (ground truth):
public IContextParameter getContextParameter(String sourceId,String paraName){
  return null;
}
Program: 123618
Project: 123618
Buggy source:
/** 
 * ftang Comment method "getCurrentJobVersion".
 * @return
 */
public static String getCurrentVersion(RepositoryNode repositoryNode){
  try {
    List<IRepositoryNode> nodeChildren=repositoryNode.getChildren();
    if ((repositoryNode.getId() == "String_Node_Str") && (nodeChildren != null) && (nodeChildren.size() == 1)) {
      return ProxyRepositoryFactory.getInstance().getLastVersion(nodeChildren.get(0).getId()).getVersion();
    }
 else {
      return ProxyRepositoryFactory.getInstance().getLastVersion(repositoryNode.getId()).getVersion();
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * ftang Comment method "getCurrentJobVersion".
 * @return
 */
public static String getCurrentVersion(RepositoryNode repositoryNode){
  try {
    List<IRepositoryNode> nodeChildren=repositoryNode.getChildren();
    if ("String_Node_Str".equals(repositoryNode.getObject().getRepositoryObjectType() + "String_Node_Str") || ("String_Node_Str".equals(repositoryNode.getId()) && nodeChildren != null) && (nodeChildren.size() == 1)) {
      return ProxyRepositoryFactory.getInstance().getLastVersion(nodeChildren.get(0).getId()).getVersion();
    }
 else {
      return ProxyRepositoryFactory.getInstance().getLastVersion(repositoryNode.getId()).getVersion();
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return "String_Node_Str";
}
Program: 123619
Project: 123619
Buggy source:
public void refreshName(){
  try {
    JobResourceManager jobResourceManager=JobResourceManager.getInstance();
    jobResourceManager.removeProtection(designerEditor);
    for (    String id : designerEditor.getProtectedIds()) {
      if (designerEditor.getJobResource(id).getJobInfo().getJobName().equalsIgnoreCase(oldJobName)) {
        jobResourceManager.deleteResource(designerEditor.getJobResource(id));
      }
    }
    designerEditor.resetJobResources();
    setName();
    JobInfo jobInfo=designerEditor.getCurrentJobResource().getJobInfo();
    if (jobInfo != null) {
      jobInfo.setJobName(getEditorInput().getName());
    }
    jobResourceManager.addProtection(designerEditor);
    processor.initPath();
    processor.setProcessorStates(IProcessor.STATES_EDIT);
    if (useCodeView) {
      FileEditorInput input=createFileEditorInput();
      codeEditor.setInput(input);
    }
    IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (activeWorkbenchWindow != null) {
      if (activeWorkbenchWindow.getActivePage().isPartVisible(this)) {
        new ActiveProcessTracker().partBroughtToTop(this);
        DesignerPlugin.getDefault().getRunProcessService().refreshView();
      }
    }
  }
 catch (  Exception e) {
    MessageBoxExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public void refreshName(){
  try {
    JobResourceManager jobResourceManager=JobResourceManager.getInstance();
    jobResourceManager.removeProtection(designerEditor);
    for (    String id : designerEditor.getProtectedIds()) {
      if (designerEditor.getJobResource(id).getJobInfo().getJobName().equalsIgnoreCase(oldJobName)) {
        jobResourceManager.deleteResource(designerEditor.getJobResource(id));
      }
    }
    designerEditor.resetJobResources();
    setName();
    JobInfo jobInfo=designerEditor.getCurrentJobResource().getJobInfo();
    if (jobInfo != null) {
      jobInfo.setJobName(getEditorInput().getName());
    }
    jobResourceManager.addProtection(designerEditor);
    processor.initPath();
    processor.setProcessorStates(IProcessor.STATES_EDIT);
    if (useCodeView && !(processor.getProperty().getItem() instanceof JobletProcessItem)) {
      FileEditorInput input=createFileEditorInput();
      codeEditor.setInput(input);
    }
    IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (activeWorkbenchWindow != null) {
      if (activeWorkbenchWindow.getActivePage().isPartVisible(this)) {
        new ActiveProcessTracker().partBroughtToTop(this);
        DesignerPlugin.getDefault().getRunProcessService().refreshView();
      }
    }
  }
 catch (  Exception e) {
    MessageBoxExceptionHandler.process(e);
  }
}
Program: 123620
Project: 123620
Buggy source:
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
  Object s=getSelectedObjects().get(0);
  if (s instanceof List && !((List)s).isEmpty()) {
    List selectedarts=(List)s;
    Object obj=selectedarts.get(selectedarts.size() - 1);
    if (obj instanceof OutputTreeNodeEditPart) {
      nodePart=(OutputTreeNodeEditPart)obj;
      OutputTreeNode model=(OutputTreeNode)nodePart.getModel();
      if (NodeType.NAME_SPACE.equals(model.getNodeType()) || !(model.eContainer() instanceof OutputTreeNode) || model.isChoice()|| model.isSubstitution()) {
        return false;
      }
      if (!XmlMapUtil.isExpressionEditable(model)) {
        return false;
      }
      AbstractInOutTree abstractTree=XmlMapUtil.getAbstractInOutTree(model);
      if (abstractTree instanceof OutputXmlTree) {
        if (((OutputXmlTree)abstractTree).isAllInOne()) {
          return false;
        }
      }
      if (!model.isAggregate()) {
        setText("String_Node_Str");
      }
 else {
        setText("String_Node_Str");
      }
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
  Object s=getSelectedObjects().get(0);
  if (s instanceof List && !((List)s).isEmpty()) {
    List selectedarts=(List)s;
    Object obj=selectedarts.get(selectedarts.size() - 1);
    if (obj instanceof OutputTreeNodeEditPart) {
      nodePart=(OutputTreeNodeEditPart)obj;
      OutputTreeNode model=(OutputTreeNode)nodePart.getModel();
      if (NodeType.NAME_SPACE.equals(model.getNodeType()) || !(model.eContainer() instanceof OutputTreeNode) || model.isChoice()|| model.isSubstitution()) {
        return false;
      }
      if (!XmlMapUtil.isExpressionEditable(model)) {
        return false;
      }
      AbstractInOutTree abstractTree=XmlMapUtil.getAbstractInOutTree(model);
      if (abstractTree instanceof OutputXmlTree) {
        OutputXmlTree outputTree=((OutputXmlTree)abstractTree);
        if (outputTree.isAllInOne()) {
          return false;
        }
        if (outputTree.isMultiLoops()) {
          return false;
        }
      }
      if (!model.isAggregate()) {
        setText("String_Node_Str");
      }
 else {
        setText("String_Node_Str");
      }
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 123621
Project: 123621
Buggy source:
@Override protected boolean calculateEnabled(){
  subGroupTraceNames.clear();
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
  Object s=getSelectedObjects().get(0);
  if (s instanceof List && !((List)s).isEmpty()) {
    List selectedarts=(List)s;
    Object obj=selectedarts.get(selectedarts.size() - 1);
    if (obj instanceof OutputTreeNodeEditPart) {
      nodePart=(OutputTreeNodeEditPart)obj;
      OutputTreeNode model=(OutputTreeNode)nodePart.getModel();
      if (model.eContainer() instanceof TreeNode && XmlMapUtil.DOCUMENT.equals(((TreeNode)model.eContainer()).getType())) {
        return false;
      }
      if (NodeType.ATTRIBUT.equals(model.getNodeType()) || NodeType.NAME_SPACE.equals(model.getNodeType()) || !(model.eContainer() instanceof TreeNode)|| model.isChoice()|| model.isSubstitution()) {
        return false;
      }
      OutputTreeNode findDownLoopNode=findDownLoopNode(model);
      if (findDownLoopNode == null) {
        return false;
      }
      if (!model.isGroup()) {
        setText("String_Node_Str");
        isRemove=false;
      }
 else {
        setText("String_Node_Str");
        isRemove=true;
      }
      if (isRemove) {
        if (model.isGroup()) {
          return true;
        }
 else {
          return false;
        }
      }
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  subGroupTraceNames.clear();
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
  Object s=getSelectedObjects().get(0);
  if (s instanceof List && !((List)s).isEmpty()) {
    List selectedarts=(List)s;
    Object obj=selectedarts.get(selectedarts.size() - 1);
    if (obj instanceof OutputTreeNodeEditPart) {
      nodePart=(OutputTreeNodeEditPart)obj;
      OutputTreeNode model=(OutputTreeNode)nodePart.getModel();
      if (model.eContainer() instanceof TreeNode && XmlMapUtil.DOCUMENT.equals(((TreeNode)model.eContainer()).getType())) {
        return false;
      }
      if (NodeType.ATTRIBUT.equals(model.getNodeType()) || NodeType.NAME_SPACE.equals(model.getNodeType()) || !(model.eContainer() instanceof TreeNode)|| model.isChoice()|| model.isSubstitution()) {
        return false;
      }
      AbstractInOutTree abstractTree=XmlMapUtil.getAbstractInOutTree(model);
      if (abstractTree instanceof OutputXmlTree) {
        OutputXmlTree outputTree=((OutputXmlTree)abstractTree);
        if (outputTree.isMultiLoops()) {
          return false;
        }
      }
      OutputTreeNode findDownLoopNode=findDownLoopNode(model);
      if (findDownLoopNode == null) {
        return false;
      }
      if (!model.isGroup()) {
        setText("String_Node_Str");
        isRemove=false;
      }
 else {
        setText("String_Node_Str");
        isRemove=true;
      }
      if (isRemove) {
        if (model.isGroup()) {
          return true;
        }
 else {
          return false;
        }
      }
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 123622
Project: 123622
Buggy source:
@Override public void notifyChanged(Notification notification){
  int type=notification.getEventType();
  int featureId=notification.getFeatureID(XmlmapPackage.class);
switch (type) {
case Notification.ADD:
case Notification.REMOVE:
case Notification.REMOVE_MANY:
switch (featureId) {
case XmlmapPackage.OUTPUT_XML_TREE__NODES:
      refreshChildren();
    break;
case XmlmapPackage.ABSTRACT_IN_OUT_TREE__FILTER_INCOMING_CONNECTIONS:
  refreshTargetConnections();
break;
}
break;
case Notification.SET:
switch (featureId) {
case XmlmapPackage.OUTPUT_XML_TREE__NODES:
refreshChildren();
case XmlmapPackage.OUTPUT_XML_TREE__REJECT:
case XmlmapPackage.OUTPUT_XML_TREE__REJECT_INNER_JOIN:
case XmlmapPackage.OUTPUT_XML_TREE__EXPRESSION_FILTER:
case XmlmapPackage.OUTPUT_XML_TREE__MINIMIZED:
case XmlmapPackage.OUTPUT_XML_TREE__ALL_IN_ONE:
case XmlmapPackage.OUTPUT_XML_TREE__ENABLE_EMPTY_ELEMENT:
((OutputXmlTreeFigure)getFigure()).update(featureId);
break;
case XmlmapPackage.TREE_NODE__EXPRESSION:
((OutputXmlTreeFigure)getFigure()).update(XmlmapPackage.TREE_NODE__TYPE);
}
}
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  int type=notification.getEventType();
  int featureId=notification.getFeatureID(XmlmapPackage.class);
switch (type) {
case Notification.ADD:
case Notification.REMOVE:
case Notification.REMOVE_MANY:
switch (featureId) {
case XmlmapPackage.OUTPUT_XML_TREE__NODES:
      refreshChildren();
    break;
case XmlmapPackage.ABSTRACT_IN_OUT_TREE__FILTER_INCOMING_CONNECTIONS:
  refreshTargetConnections();
break;
}
break;
case Notification.SET:
switch (featureId) {
case XmlmapPackage.OUTPUT_XML_TREE__NODES:
refreshChildren();
case XmlmapPackage.OUTPUT_XML_TREE__REJECT:
case XmlmapPackage.OUTPUT_XML_TREE__REJECT_INNER_JOIN:
case XmlmapPackage.OUTPUT_XML_TREE__EXPRESSION_FILTER:
case XmlmapPackage.OUTPUT_XML_TREE__MINIMIZED:
case XmlmapPackage.OUTPUT_XML_TREE__ALL_IN_ONE:
case XmlmapPackage.OUTPUT_XML_TREE__ENABLE_EMPTY_ELEMENT:
((OutputXmlTreeFigure)getFigure()).update(featureId);
break;
case XmlmapPackage.TREE_NODE__EXPRESSION:
((OutputXmlTreeFigure)getFigure()).update(XmlmapPackage.TREE_NODE__TYPE);
break;
case XmlmapPackage.ABSTRACT_IN_OUT_TREE__MULTI_LOOPS:
OutputXmlTree model=(OutputXmlTree)getModel();
if (model.isMultiLoops()) {
boolean changed=cleanAggregateAndGroup(model.getNodes());
if (changed) {
refreshChildren();
}
}
}
}
}
Program: 123627
Project: 123627
Buggy source:
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object object=getSelectedObjects().get(0);
    if (object instanceof TreeNodeEditPart) {
      TreeNodeEditPart nodePart=(TreeNodeEditPart)object;
      this.parent=(TreeNode)nodePart.getModel();
      if (parent.isChoice() || parent.isSubstitution()) {
        return false;
      }
      EList<TreeNode> children=parent.getChildren();
      for (int i=0; i < children.size(); i++) {
        if (children.get(i).isChoice()) {
          return false;
        }
      }
      boolean isElement=NodeType.ELEMENT.equals(parent.getNodeType());
      if (isElement && XmlMapUtil.getXPathLength(parent.getXpath()) > 2) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=(List)s;
      Object object=selectedarts.get(selectedarts.size() - 1);
      if (object instanceof TreeNodeEditPart) {
        TreeNodeEditPart nodePart=(TreeNodeEditPart)object;
        this.parent=(TreeNode)nodePart.getModel();
        if (parent.isChoice() || parent.isSubstitution()) {
          return false;
        }
        EList<TreeNode> children=parent.getChildren();
        for (int i=0; i < children.size(); i++) {
          if (children.get(i).isChoice()) {
            return false;
          }
        }
        boolean isElement=NodeType.ELEMENT.equals(parent.getNodeType());
        if (isElement && XmlMapUtil.getXPathLength(parent.getXpath()) > 2) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 123628
Project: 123628
Buggy source:
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object object=getSelectedObjects().get(0);
    if (object instanceof TreeNodeEditPart) {
      TreeNodeEditPart nodePart=(TreeNodeEditPart)object;
      this.parent=(TreeNode)nodePart.getModel();
      if (parent.isChoice() || parent.isSubstitution()) {
        return false;
      }
      boolean isElement=NodeType.ELEMENT.equals(parent.getNodeType());
      if (isElement && XmlMapUtil.getXPathLength(parent.getXpath()) > 2) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=(List)s;
      Object object=selectedarts.get(selectedarts.size() - 1);
      if (object instanceof TreeNodeEditPart) {
        TreeNodeEditPart nodePart=(TreeNodeEditPart)object;
        this.parent=(TreeNode)nodePart.getModel();
        if (parent.isChoice() || parent.isSubstitution()) {
          return false;
        }
        boolean isElement=NodeType.ELEMENT.equals(parent.getNodeType());
        if (isElement && XmlMapUtil.getXPathLength(parent.getXpath()) > 2) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 123629
Project: 123629
Buggy source:
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object object=getSelectedObjects().get(0);
    if (object instanceof TreeNodeEditPart) {
      TreeNodeEditPart nodePart=(TreeNodeEditPart)object;
      this.parent=(TreeNode)nodePart.getModel();
      boolean isElement=NodeType.ELEMENT.equals(parent.getNodeType());
      if (isElement && XmlMapUtil.getXPathLength(parent.getXpath()) > 2) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=(List)s;
      Object object=selectedarts.get(selectedarts.size() - 1);
      if (object instanceof TreeNodeEditPart) {
        TreeNodeEditPart nodePart=(TreeNodeEditPart)object;
        this.parent=(TreeNode)nodePart.getModel();
        boolean isElement=NodeType.ELEMENT.equals(parent.getNodeType());
        if (isElement && XmlMapUtil.getXPathLength(parent.getXpath()) > 2) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 123630
Project: 123630
Buggy source:
public Set<String> getNeededLibrariesForProcess(IProcess process,boolean withChildrens,boolean... exportAsOSGI){
  return JavaProcessUtil.getNeededLibraries(process,withChildrens,exportAsOSGI);
}

Fixed version (ground truth):
public Set<ModuleNeeded> getNeededLibrariesForProcess(IProcess process,boolean withChildrens){
  return JavaProcessUtil.getNeededModules(process,withChildrens);
}
Program: 123632
Project: 123632
Buggy source:
/** 
 * @see org.eclipse.jface.wizard.Wizard#addPages()
 */
@Override public void addPages(){
  mainPage=new NewProcessWizardPage(property,path);
  addPage(mainPage);
  setWindowTitle(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.jface.wizard.Wizard#addPages()
 */
@Override public void addPages(){
  mainPage=new NewProcessWizardPage(property,path);
  if (property.getLabel() != null && !"String_Node_Str".equals(property.getLabel())) {
    mainPage.setNameModifiedByUser(true);
  }
  addPage(mainPage);
  setWindowTitle(Messages.getString("String_Node_Str"));
}
Program: 123633
Project: 123633
Buggy source:
/** 
 * Deal with the bug 4402: the content <quotes_encoded>&quot;hello world&quot;</quotes_encoded>. In this case, "characters" will be called three time. first: " second: hello world third: "
 */
public void characters(char ch[],int start,int length) throws SAXException {
  if (isLooping) {
    String text=new String(ch,start,length);
    if (text.length() > 0) {
      for (int i=0; i < selectColumns.size(); i++) {
        if (outputTexts[i] && !currentRowHaveValue[i]) {
          if (this.asXMLs.get(i) && !inCDATA) {
            text=escapeEntityHelper.escapeElementEntities(text);
          }
          if (currentRow[i] == null) {
            currentRow[i]=text;
          }
 else {
            currentRow[i]+=text;
          }
        }
      }
      if (this.entry.hasFunctions()) {
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("String_Node_Str",loopPath);
        map.put("String_Node_Str",currentPath);
        map.put("String_Node_Str",text);
        listArgs.add(map);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Deal with the bug 4402: the content <quotes_encoded>&quot;hello world&quot;</quotes_encoded>. In this case, "characters" will be called three time. first: " second: hello world third: "
 */
public void characters(char ch[],int start,int length) throws SAXException {
  if (isLooping) {
    String text=new String(ch,start,length);
    if (text.length() > 0) {
      for (int i=0; i < selectColumns.size(); i++) {
        if (outputTexts[i] && !currentRowHaveValue[i]) {
          if (this.asXMLs.get(i) && !inCDATA) {
            text=escapeEntityHelper.escapeElementEntities(text);
          }
          currentRow.addTextValue(i,text);
        }
      }
      if (this.entry.hasFunctions()) {
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("String_Node_Str",loopPath);
        map.put("String_Node_Str",currentPath);
        map.put("String_Node_Str",text);
        listArgs.add(map);
      }
    }
  }
}
Program: 123634
Project: 123634
Buggy source:
public void startCDATA() throws SAXException {
  inCDATA=true;
  if (isLooping) {
    for (int i=0; i < selectColumns.size(); i++) {
      if (this.asXMLs.get(i)) {
        if (outputTexts[i] && !currentRowHaveValue[i]) {
          if (currentRow[i] == null) {
            currentRow[i]="String_Node_Str";
          }
 else {
            currentRow[i]+="String_Node_Str";
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void startCDATA() throws SAXException {
  inCDATA=true;
  if (isLooping) {
    for (int i=0; i < selectColumns.size(); i++) {
      if (this.asXMLs.get(i)) {
        if (outputTexts[i] && !currentRowHaveValue[i]) {
          currentRow.addTextValue(i,"String_Node_Str");
        }
      }
    }
  }
}
Program: 123637
Project: 123637
Buggy source:
public void endCDATA() throws SAXException {
  inCDATA=false;
  if (isLooping) {
    for (int i=0; i < selectColumns.size(); i++) {
      if (this.asXMLs.get(i)) {
        if (outputTexts[i] && !currentRowHaveValue[i]) {
          currentRow[i]+="String_Node_Str";
        }
      }
    }
  }
}

Fixed version (ground truth):
public void endCDATA() throws SAXException {
  inCDATA=false;
  if (isLooping) {
    for (int i=0; i < selectColumns.size(); i++) {
      if (this.asXMLs.get(i)) {
        if (outputTexts[i] && !currentRowHaveValue[i]) {
          currentRow.addTextValue(i,"String_Node_Str");
        }
      }
    }
  }
}
Program: 123638
Project: 123638
Buggy source:
public void endElement(String uri,String localName,String qName) throws SAXException {
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText) {
        if (node.hasValue == false) {
          node.addTextValue("String_Node_Str");
        }
        node.hasValue=true;
      }
      if ((node.isAsXML || node.isDot) && (this.currentPath.equals(node.nodePath) || this.currentPath.startsWith(node.nodePath + "String_Node_Str"))) {
        if (node.isAsXML) {
          node.addTextValue("String_Node_Str" + qName + "String_Node_Str");
        }
        if (this.currentPath.equals(node.nodePath)) {
          node.hasValue=true;
        }
      }
    }
    node.outputText=false;
  }
  if (this.currentPath.equals(nodes.getLoopPath())) {
    if (isNotNull(nodes.getNodesCollection(),nodes.size())) {
      Map<String,String> map=new HashMap<String,String>();
      for (      XMLNode node : nodes.getNodesCollection()) {
        map.put(node.originPath,node.getTextValue());
      }
      bufferCache.writeData(map);
    }
    nodes.resetAll();
  }
  this.currentPath=this.currentPath.substring(0,this.currentPath.lastIndexOf("String_Node_Str"));
}

Fixed version (ground truth):
public void endElement(String uri,String localName,String qName) throws SAXException {
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText) {
        if (node.hasValue == false) {
          node.addTextValue("String_Node_Str");
        }
        node.hasValue=true;
      }
      if ((node.isAsXML || node.isDot) && (this.currentPath.equals(node.nodePath) || this.currentPath.startsWith(node.nodePath + "String_Node_Str"))) {
        if (node.isAsXML) {
          node.addTextValue("String_Node_Str");
          node.addTextValue(qName);
          node.addTextValue("String_Node_Str");
        }
        if (this.currentPath.equals(node.nodePath)) {
          node.hasValue=true;
        }
      }
    }
    node.outputText=false;
  }
  if (this.currentPath.equals(nodes.getLoopPath())) {
    if (isNotNull(nodes.getNodesCollection(),nodes.size())) {
      Map<String,String> map=new HashMap<String,String>();
      for (      XMLNode node : nodes.getNodesCollection()) {
        map.put(node.originPath,node.getTextValue());
      }
      bufferCache.writeData(map);
    }
    nodes.resetAll();
  }
  this.currentPath=this.currentPath.substring(0,this.currentPath.lastIndexOf("String_Node_Str"));
}
Program: 123640
Project: 123640
Buggy source:
public String getTextValue(){
  return value;
}

Fixed version (ground truth):
public String getTextValue(){
  if (isNullValue)   return null;
  return value.toString();
}
Program: 123641
Project: 123641
Buggy source:
public void addTextValue(String appendValue){
  if (value == null) {
    value="String_Node_Str";
  }
  if (appendValue != null) {
    value=value + appendValue;
  }
}

Fixed version (ground truth):
public void addTextValue(String appendValue){
  isNullValue=false;
  if (appendValue != null) {
    value.append(appendValue);
  }
}
Program: 123642
Project: 123642
Buggy source:
public void resetValue(){
  this.value=null;
}

Fixed version (ground truth):
public void resetValue(){
  isNullValue=true;
  value.setLength(0);
}
Program: 123643
Project: 123643
Buggy source:
protected ProcessItem getProcessItem(){
  if ((processItem == null) && (nodes != null) && (nodes.length >= 1)) {
    IRepositoryViewObject repositoryObject=nodes[0].getObject();
    if (repositoryObject.getProperty().getItem() instanceof ProcessItem) {
      processItem=(ProcessItem)repositoryObject.getProperty().getItem();
    }
  }
  return processItem;
}

Fixed version (ground truth):
protected ProcessItem getProcessItem(){
  if ((processItem == null) && (nodes != null) && (nodes.length >= 1)) {
    IRepositoryViewObject repositoryObject=nodes[0].getObject();
    List<IRepositoryNode> nodesChildren=(List<IRepositoryNode>)nodes[0].getChildren();
    IRepositoryViewObject childObject=null;
    if ((nodesChildren != null) && (nodesChildren.size() >= 1)) {
      childObject=nodesChildren.get(0).getObject();
    }
    if (repositoryObject == null && childObject != null && childObject.getProperty().getItem() instanceof ProcessItem) {
      processItem=(ProcessItem)childObject.getProperty().getItem();
    }
    if (repositoryObject != null && repositoryObject.getProperty().getItem() instanceof ProcessItem) {
      processItem=(ProcessItem)repositoryObject.getProperty().getItem();
    }
  }
  return processItem;
}
Program: 123644
Project: 123644
Buggy source:
/** 
 * ftang Comment method "getCurrentJobVersion".
 * @return
 */
public static String getCurrentVersion(RepositoryNode repositoryNode){
  try {
    return ProxyRepositoryFactory.getInstance().getLastVersion(repositoryNode.getId()).getVersion();
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * ftang Comment method "getCurrentJobVersion".
 * @return
 */
public static String getCurrentVersion(RepositoryNode repositoryNode){
  try {
    List<IRepositoryNode> nodeChildren=repositoryNode.getChildren();
    if ((repositoryNode.getId() == "String_Node_Str") && (nodeChildren != null) && (nodeChildren.size() == 1)) {
      return ProxyRepositoryFactory.getInstance().getLastVersion(nodeChildren.get(0).getId()).getVersion();
    }
 else {
      return ProxyRepositoryFactory.getInstance().getLastVersion(repositoryNode.getId()).getVersion();
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return "String_Node_Str";
}
Program: 123645
Project: 123645
Buggy source:
@Override protected Control createContents(Composite parent){
  Composite composite=new Composite(parent,0);
  ThreeCompositesSashForm compositesSachForm=new ThreeCompositesSashForm(composite,SWT.NONE);
  GridLayout gridLayout=new GridLayout(1,false);
  gridLayout.marginHeight=0;
  gridLayout.marginWidth=0;
  gridLayout.horizontalSpacing=0;
  composite.setLayout(gridLayout);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.heightHint=400;
  gridData.widthHint=570;
  composite.setLayoutData(gridData);
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    compositesSachForm.setEnabled(false);
  }
  addRepositoryTreeViewer(compositesSachForm.getLeftComposite());
  addButtons(compositesSachForm.getMidComposite());
  addItemTableViewer(compositesSachForm.getRightComposite());
  statusHelper=new org.talend.repository.ui.properties.StatusHelper(service.getProxyRepositoryFactory());
  return composite;
}

Fixed version (ground truth):
@Override protected Control createContents(Composite parent){
  Composite composite=new Composite(parent,0);
  ThreeCompositesSashForm compositesSachForm=new ThreeCompositesSashForm(composite,SWT.NONE);
  GridLayout gridLayout=new GridLayout(1,false);
  gridLayout.marginHeight=0;
  gridLayout.marginWidth=0;
  gridLayout.horizontalSpacing=0;
  composite.setLayout(gridLayout);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.widthHint=570;
  composite.setLayoutData(gridData);
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    compositesSachForm.setEnabled(false);
  }
  addRepositoryTreeViewer(compositesSachForm.getLeftComposite());
  addButtons(compositesSachForm.getMidComposite());
  addItemTableViewer(compositesSachForm.getRightComposite());
  statusHelper=new org.talend.repository.ui.properties.StatusHelper(service.getProxyRepositoryFactory());
  return composite;
}
Program: 123646
Project: 123646
Buggy source:
/** 
 * repository tree viewer.
 */
private void addRepositoryTreeViewer(Composite leftComposite){
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.widthHint=210;
  leftComposite.setLayoutData(gridData);
  RepositoryViewerProvider provider=RepositoryViewerProvider.ALL_CHECKBOX;
  treeViewer=(CheckboxRepositoryTreeViewer)provider.createViewer(leftComposite);
  treeViewer.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      RepositoryNode node=(RepositoryNode)element;
      return filterRepositoryNode(node);
    }
  }
);
  treeViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      RepositoryNode node=(RepositoryNode)event.getElement();
      List<RepositoryObject> objects=new ArrayList<RepositoryObject>();
      processItems(objects,node);
      if (!objects.isEmpty()) {
        if (event.getChecked()) {
          checkedObjects.addAll(objects);
        }
 else {
          checkedObjects.removeAll(objects);
          removeItemElements(objects);
        }
        refreshTableItems();
      }
    }
  }
);
  treeViewer.addTreeListener(new ITreeViewerListener(){
    public void treeCollapsed(    TreeExpansionEvent event){
    }
    public void treeExpanded(    TreeExpansionEvent event){
    }
  }
);
  expandSomeNodes(provider.getProjectRepositoryNode());
}

Fixed version (ground truth):
/** 
 * repository tree viewer.
 */
private void addRepositoryTreeViewer(Composite leftComposite){
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.widthHint=210;
  gridData.heightHint=400;
  leftComposite.setLayoutData(gridData);
  RepositoryViewerProvider provider=RepoCommonViewerProvider.CHECKBOX;
  treeViewer=(CheckboxRepositoryTreeViewer)provider.createViewer(leftComposite);
  treeViewer.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      RepositoryNode node=(RepositoryNode)element;
      return filterRepositoryNode(node);
    }
  }
);
  treeViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      RepositoryNode node=(RepositoryNode)event.getElement();
      List<RepositoryObject> objects=new ArrayList<RepositoryObject>();
      processItems(objects,node);
      if (!objects.isEmpty()) {
        if (event.getChecked()) {
          checkedObjects.addAll(objects);
        }
 else {
          checkedObjects.removeAll(objects);
          removeItemElements(objects);
        }
        refreshTableItems();
      }
    }
  }
);
  treeViewer.addTreeListener(new ITreeViewerListener(){
    public void treeCollapsed(    TreeExpansionEvent event){
    }
    public void treeExpanded(    TreeExpansionEvent event){
    }
  }
);
  expandSomeNodes(provider.getProjectRepositoryNode());
}
Program: 123647
Project: 123647
Buggy source:
@Override protected Control createContents(Composite parent){
  Composite composite=new Composite(parent,0);
  ThreeCompositesSashForm compositesSachForm=new ThreeCompositesSashForm(composite,SWT.NONE);
  GridLayout gridLayout=new GridLayout(1,false);
  gridLayout.marginHeight=0;
  gridLayout.marginWidth=0;
  gridLayout.horizontalSpacing=0;
  composite.setLayout(gridLayout);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.heightHint=400;
  gridData.widthHint=570;
  composite.setLayoutData(gridData);
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    compositesSachForm.setEnabled(false);
  }
  addRepositoryTreeViewer(compositesSachForm.getLeftComposite());
  addButtons(compositesSachForm.getMidComposite());
  addItemTableViewer(compositesSachForm.getRightComposite());
  return composite;
}

Fixed version (ground truth):
@Override protected Control createContents(Composite parent){
  Composite composite=new Composite(parent,0);
  ThreeCompositesSashForm compositesSachForm=new ThreeCompositesSashForm(composite,SWT.NONE);
  GridLayout gridLayout=new GridLayout(1,false);
  gridLayout.marginHeight=0;
  gridLayout.marginWidth=0;
  gridLayout.horizontalSpacing=0;
  composite.setLayout(gridLayout);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.widthHint=570;
  composite.setLayoutData(gridData);
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    compositesSachForm.setEnabled(false);
  }
  addRepositoryTreeViewer(compositesSachForm.getLeftComposite());
  addButtons(compositesSachForm.getMidComposite());
  addItemTableViewer(compositesSachForm.getRightComposite());
  return composite;
}