nus-yam/ex-repair huggingface dataset:
Program: 123159
Project: 123159
Buggy source:
@Override public ExecutionResult execute(Item item){
  ProcessType processType=getProcessType(item);
  if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) {
    return ExecutionResult.NOTHING_TO_DO;
  }
  try {
    for (    Object o : processType.getNode()) {
      NodeType node=(NodeType)o;
      if (ComponentUtilities.getNodeProperty(node,"String_Node_Str") != null) {
        if (ComponentUtilities.getNodeProperty(node,"String_Node_Str") == null) {
          ComponentUtilities.addNodeProperty(node,"String_Node_Str","String_Node_Str");
          ComponentUtilities.getNodeProperty(node,"String_Node_Str").setValue("String_Node_Str");
        }
      }
    }
    return ExecutionResult.SUCCESS_NO_ALERT;
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    return ExecutionResult.FAILURE;
  }
}

Fixed version (ground truth):
@Override public ExecutionResult execute(Item item){
  ProcessType processType=getProcessType(item);
  if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) {
    return ExecutionResult.NOTHING_TO_DO;
  }
  try {
    boolean modified=false;
    for (    Object o : processType.getNode()) {
      NodeType node=(NodeType)o;
      if (ComponentUtilities.getNodeProperty(node,"String_Node_Str") != null) {
        if (ComponentUtilities.getNodeProperty(node,"String_Node_Str") == null) {
          ComponentUtilities.addNodeProperty(node,"String_Node_Str","String_Node_Str");
          ComponentUtilities.getNodeProperty(node,"String_Node_Str").setValue("String_Node_Str");
          modified=true;
        }
      }
    }
    if (modified) {
      ProxyRepositoryFactory.getInstance().save(item,true);
      return ExecutionResult.SUCCESS_NO_ALERT;
    }
 else {
      return ExecutionResult.NOTHING_TO_DO;
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    return ExecutionResult.FAILURE;
  }
}
Program: 123162
Project: 123162
Buggy source:
public Function getFuntionFromArray(MetadataColumnExt bean,RowGeneratorComponent externalNode,int index){
  String value=externalNode.getColumnValue(bean,index);
  List<Function> functions=getFunctionByName(bean.getTalendType());
  Function currentFun=getAvailableFunFromValue(value,functions);
  if (currentFun == null) {
    currentFun=new Function();
    String[] arrayTalendFunctions2=new String[functions.size()];
    if (functions.isEmpty()) {
      currentFun.setDescription("String_Node_Str");
      currentFun.setPreview("String_Node_Str");
      currentFun.setParameters(new ArrayList<Parameter>());
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
 else {
      int flag=0;
      for (int i=0; i < functions.size(); i++) {
        String funName=functions.get(i).getName();
        arrayTalendFunctions2[i]=funName;
        if (DEFAULT_SELECTED_METHOD.equals(funName)) {
          flag=i;
        }
      }
      currentFun=(Function)functions.get(flag).clone();
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
  }
  return currentFun;
}

Fixed version (ground truth):
public Function getFuntionFromArray(MetadataColumnExt bean,RowGeneratorComponent externalNode,int index){
  String value=externalNode.getColumnValue(bean,index);
  List<Function> functions=getFunctionByName(bean.getTalendType());
  Function currentFun=getAvailableFunFromValue(bean,value,functions);
  if (currentFun == null) {
    currentFun=new Function();
    String[] arrayTalendFunctions2=new String[functions.size()];
    if (functions.isEmpty()) {
      currentFun.setDescription("String_Node_Str");
      currentFun.setPreview("String_Node_Str");
      currentFun.setParameters(new ArrayList<Parameter>());
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
 else {
      int flag=0;
      for (int i=0; i < functions.size(); i++) {
        String funName=functions.get(i).getName();
        arrayTalendFunctions2[i]=funName;
        if (DEFAULT_SELECTED_METHOD.equals(funName)) {
          flag=i;
        }
      }
      currentFun=(Function)functions.get(flag).clone();
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
  }
  return currentFun;
}
Program: 123163
Project: 123163
Buggy source:
public int compare(String n1,String n2){
  return n1.compareTo(n2);
}

Fixed version (ground truth):
@Override public int compare(String n1,String n2){
  return n1.compareTo(n2);
}
Program: 123165
Project: 123165
Buggy source:
public Function getDefaultFunction(MetadataColumnExt bean,String talendType){
  Function currentFun=new Function();
  List<Function> functions=getFunctionByName(talendType);
  String[] arrayTalendFunctions2=new String[functions.size()];
  List<String> list=new ArrayList<String>();
  if (functions.isEmpty()) {
    currentFun.setDescription("String_Node_Str");
    currentFun.setPreview("String_Node_Str");
    currentFun.setParameters(new ArrayList<Parameter>());
    bean.setArrayFunctions(arrayTalendFunctions2);
  }
 else {
    for (int i=0; i < functions.size(); i++) {
      String name=functions.get(i).getName();
      String className=functions.get(i).getClassName();
      if (className == null) {
        arrayTalendFunctions2[i]=name;
      }
 else {
        arrayTalendFunctions2[i]=className + "String_Node_Str" + name;
      }
    }
    Arrays.sort(arrayTalendFunctions2,new Comparator<String>(){
      public int compare(      String n1,      String n2){
        return n1.compareTo(n2);
      }
    }
);
    currentFun=(Function)functions.get(0).clone();
    bean.setArrayFunctions(arrayTalendFunctions2);
  }
  for (  Function fun : functions) {
    if (fun.getName().equals(DEFAULT_SELECTED_METHOD)) {
      currentFun=fun;
      break;
    }
  }
  return currentFun;
}

Fixed version (ground truth):
public Function getDefaultFunction(MetadataColumnExt bean,String talendType){
  Function currentFun=new Function();
  List<Function> functions=getFunctionByName(talendType);
  String[] arrayTalendFunctions2=new String[functions.size()];
  List<String> list=new ArrayList<String>();
  if (functions.isEmpty()) {
    currentFun.setDescription("String_Node_Str");
    currentFun.setPreview("String_Node_Str");
    currentFun.setParameters(new ArrayList<Parameter>());
    bean.setArrayFunctions(arrayTalendFunctions2);
  }
 else {
    for (int i=0; i < functions.size(); i++) {
      String name=functions.get(i).getName();
      String className=functions.get(i).getClassName();
      if (className == null) {
        arrayTalendFunctions2[i]=name;
      }
 else {
        arrayTalendFunctions2[i]=className + "String_Node_Str" + name;
      }
    }
    Arrays.sort(arrayTalendFunctions2,new Comparator<String>(){
      @Override public int compare(      String n1,      String n2){
        return n1.compareTo(n2);
      }
    }
);
    currentFun=(Function)functions.get(0).clone();
    bean.setArrayFunctions(arrayTalendFunctions2);
  }
  for (  Function fun : functions) {
    if (fun.getName().equals(DEFAULT_SELECTED_METHOD)) {
      currentFun=fun;
      break;
    }
  }
  return currentFun;
}
Program: 123166
Project: 123166
Buggy source:
public Function getFuntionFromArray(MetadataColumnExt bean,RowGeneratorComponent externalNode,int index){
  String value=externalNode.getColumnValue(bean,index);
  List<Function> functions=getFunctionByName(bean.getTalendType());
  Function currentFun=getAvailableFunFromValue(value,functions);
  if (currentFun == null) {
    currentFun=new Function();
    String[] arrayTalendFunctions2=new String[functions.size()];
    if (functions.isEmpty()) {
      currentFun.setDescription("String_Node_Str");
      currentFun.setPreview("String_Node_Str");
      currentFun.setParameters(new ArrayList<Parameter>());
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
 else {
      int flag=0;
      for (int i=0; i < functions.size(); i++) {
        String funName=functions.get(i).getName();
        arrayTalendFunctions2[i]=funName;
        if (DEFAULT_SELECTED_METHOD.equals(funName)) {
          flag=i;
        }
      }
      currentFun=(Function)functions.get(flag).clone();
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
  }
  return currentFun;
}

Fixed version (ground truth):
public Function getFuntionFromArray(MetadataColumnExt bean,RowGeneratorComponent externalNode,int index){
  String value=externalNode.getColumnValue(bean,index);
  List<Function> functions=getFunctionByName(bean.getTalendType());
  Function currentFun=getAvailableFunFromValue(bean,value,functions);
  if (currentFun == null) {
    currentFun=new Function();
    String[] arrayTalendFunctions2=new String[functions.size()];
    if (functions.isEmpty()) {
      currentFun.setDescription("String_Node_Str");
      currentFun.setPreview("String_Node_Str");
      currentFun.setParameters(new ArrayList<Parameter>());
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
 else {
      int flag=0;
      for (int i=0; i < functions.size(); i++) {
        String funName=functions.get(i).getName();
        arrayTalendFunctions2[i]=funName;
        if (DEFAULT_SELECTED_METHOD.equals(funName)) {
          flag=i;
        }
      }
      currentFun=(Function)functions.get(flag).clone();
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
  }
  return currentFun;
}
Program: 123168
Project: 123168
Buggy source:
@Override protected void createPageContent(Composite parent){
  Composite topComposite=new Composite(parent,SWT.NONE);
  topComposite.setLayout(new GridLayout(2,false));
  GridData data=new GridData(GridData.FILL_BOTH);
  topComposite.setLayoutData(data);
  availableXmlTree=new Tree(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  GridData treeGD=new GridData(GridData.FILL_BOTH);
  treeGD.widthHint=110;
  treeGD.grabExcessHorizontalSpace=true;
  treeGD.grabExcessVerticalSpace=true;
  availableXmlTree.setLayoutData(treeGD);
  rightComposite=new Composite(topComposite,SWT.NONE);
  GridData rightPanelGd=new GridData(GridData.FILL_BOTH);
  rightPanelGd.widthHint=180;
  rightComposite.setLayoutData(rightPanelGd);
  rightComposite.setLayout(new GridLayout());
  Label label=new Label(rightComposite,SWT.NONE);
  label.setText(Messages.getString("String_Node_Str"));
  GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(labelGd);
  this.setControl(topComposite);
}

Fixed version (ground truth):
@Override protected void createPageContent(Composite parent){
  Composite topComposite=new Composite(parent,SWT.NONE);
  topComposite.setLayout(new FillLayout());
  availableXmlTree=new Tree(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  GridData treeGD=new GridData(GridData.FILL_BOTH);
  treeGD.widthHint=110;
  treeGD.grabExcessHorizontalSpace=true;
  treeGD.grabExcessVerticalSpace=true;
  availableXmlTree.setLayoutData(treeGD);
  scrolledComposite=new ScrolledComposite(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  rightComposite=new Composite(scrolledComposite,SWT.NONE);
  GridData rightPanelGd=new GridData(GridData.FILL_BOTH);
  rightPanelGd.widthHint=180;
  rightComposite.setLayoutData(rightPanelGd);
  rightComposite.setLayout(new GridLayout());
  Label label=new Label(rightComposite,SWT.NONE);
  label.setText(Messages.getString("String_Node_Str"));
  GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(labelGd);
  scrolledComposite.setContent(rightComposite);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  this.setControl(topComposite);
}
Program: 123170
Project: 123170
Buggy source:
@Override protected void createPageContent(Composite parent){
  Composite topComposite=new Composite(parent,SWT.NONE);
  topComposite.setLayout(new GridLayout(2,false));
  GridData data=new GridData(GridData.FILL_BOTH);
  topComposite.setLayoutData(data);
  availableXmlTree=new Tree(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  GridData treeGD=new GridData(GridData.FILL_BOTH);
  treeGD.widthHint=110;
  treeGD.grabExcessHorizontalSpace=true;
  treeGD.grabExcessVerticalSpace=true;
  availableXmlTree.setLayoutData(treeGD);
  rightComposite=new Composite(topComposite,SWT.NONE);
  GridData rightPanelGd=new GridData(GridData.FILL_BOTH);
  rightPanelGd.widthHint=180;
  rightComposite.setLayoutData(rightPanelGd);
  rightComposite.setLayout(new GridLayout());
  Label label=new Label(rightComposite,SWT.NONE);
  label.setText(Messages.getString("String_Node_Str"));
  GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(labelGd);
  this.setControl(topComposite);
}

Fixed version (ground truth):
@Override protected void createPageContent(Composite parent){
  Composite topComposite=new Composite(parent,SWT.NONE);
  topComposite.setLayout(new FillLayout());
  availableXmlTree=new Tree(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  GridData treeGD=new GridData(GridData.FILL_BOTH);
  treeGD.widthHint=110;
  treeGD.grabExcessHorizontalSpace=true;
  treeGD.grabExcessVerticalSpace=true;
  availableXmlTree.setLayoutData(treeGD);
  scrolledComposite=new ScrolledComposite(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  rightComposite=new Composite(scrolledComposite,SWT.NONE);
  GridData rightPanelGd=new GridData(GridData.FILL_BOTH);
  rightPanelGd.widthHint=180;
  rightComposite.setLayoutData(rightPanelGd);
  rightComposite.setLayout(new GridLayout());
  Label label=new Label(rightComposite,SWT.NONE);
  label.setText(Messages.getString("String_Node_Str"));
  GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(labelGd);
  scrolledComposite.setContent(rightComposite);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  this.setControl(topComposite);
}
Program: 123172
Project: 123172
Buggy source:
public Function getFuntionFromArray(MetadataColumnExt bean,RowGeneratorComponent externalNode,int index){
  String value=externalNode.getColumnValue(bean,index);
  List<Function> functions=getFunctionByName(bean.getTalendType());
  Function currentFun=getAvailableFunFromValue(value,functions);
  if (currentFun == null) {
    currentFun=new Function();
    String[] arrayTalendFunctions2=new String[functions.size()];
    if (functions.isEmpty()) {
      currentFun.setDescription("String_Node_Str");
      currentFun.setPreview("String_Node_Str");
      currentFun.setParameters(new ArrayList<Parameter>());
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
 else {
      int flag=0;
      for (int i=0; i < functions.size(); i++) {
        String funName=functions.get(i).getName();
        arrayTalendFunctions2[i]=funName;
        if (DEFAULT_SELECTED_METHOD.equals(funName)) {
          flag=i;
        }
      }
      currentFun=(Function)functions.get(flag).clone();
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
  }
  return currentFun;
}

Fixed version (ground truth):
public Function getFuntionFromArray(MetadataColumnExt bean,RowGeneratorComponent externalNode,int index){
  String value=externalNode.getColumnValue(bean,index);
  List<Function> functions=getFunctionByName(bean.getTalendType());
  Function currentFun=getAvailableFunFromValue(bean,value,functions);
  if (currentFun == null) {
    currentFun=new Function();
    String[] arrayTalendFunctions2=new String[functions.size()];
    if (functions.isEmpty()) {
      currentFun.setDescription("String_Node_Str");
      currentFun.setPreview("String_Node_Str");
      currentFun.setParameters(new ArrayList<Parameter>());
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
 else {
      int flag=0;
      for (int i=0; i < functions.size(); i++) {
        String funName=functions.get(i).getName();
        arrayTalendFunctions2[i]=funName;
        if (DEFAULT_SELECTED_METHOD.equals(funName)) {
          flag=i;
        }
      }
      currentFun=(Function)functions.get(flag).clone();
      bean.setArrayFunctions(arrayTalendFunctions2);
    }
  }
  return currentFun;
}
Program: 123174
Project: 123174
Buggy source:
/** 
 * DOC nrousseau SubjobContainerFigure constructor comment.
 * @param model
 */
public SubjobContainerFigure(SubjobContainer subjobContainerTmp){
  setLayoutManager(new FreeformLayout());
  this.subjobContainer=subjobContainerTmp;
  outlineFigure=new RoundedRectangle();
  rectFig=new RoundedRectangle();
  titleFigure=new SimpleHtmlFigure();
  titleFigure.setOpaque(true);
  collapseFigure=new SubjobCollapseFigure();
  collapseFigure.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      IProcess2 process=subjobContainer.getProcess();
      if (!process.isReadOnly()) {
        PropertyChangeCommand ppc=new PropertyChangeCommand(subjobContainer,EParameterName.COLLAPSED.getName(),!subjobContainer.isCollapsed());
        process.getCommandStack().execute(ppc);
        reSelection();
      }
    }
  }
);
  initSubJobTitleColor();
  updateData();
  initializeSubjobContainer(subjobContainer.getSubjobContainerRectangle());
}

Fixed version (ground truth):
/** 
 * DOC nrousseau SubjobContainerFigure constructor comment.
 * @param model
 */
public SubjobContainerFigure(SubjobContainer subjobContainerTmp){
  setLayoutManager(new FreeformLayout());
  this.subjobContainer=subjobContainerTmp;
  outlineFigure=new RoundedRectangle();
  rectFig=new RoundedRectangle();
  titleFigure=new SimpleHtmlFigure();
  titleFigure.setOpaque(true);
  collapseFigure=new SubjobCollapseFigure();
  collapseFigure.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      IProcess2 process=subjobContainer.getProcess();
      if (!process.isReadOnly()) {
        PropertyChangeCommand ppc=new PropertyChangeCommand(subjobContainer,EParameterName.COLLAPSED.getName(),!subjobContainer.isCollapsed());
        process.getCommandStack().execute(ppc);
        reSelection();
      }
    }
  }
);
  initSubJobTitleColor();
  updateData();
  initializeSubjobContainer(subjobContainer.getSubjobContainerRectangle());
}
Program: 123175
Project: 123175
Buggy source:
public void actionPerformed(ActionEvent event){
  IProcess2 process=subjobContainer.getProcess();
  if (!process.isReadOnly()) {
    PropertyChangeCommand ppc=new PropertyChangeCommand(subjobContainer,EParameterName.COLLAPSED.getName(),!subjobContainer.isCollapsed());
    process.getCommandStack().execute(ppc);
    reSelection();
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent event){
  IProcess2 process=subjobContainer.getProcess();
  if (!process.isReadOnly()) {
    PropertyChangeCommand ppc=new PropertyChangeCommand(subjobContainer,EParameterName.COLLAPSED.getName(),!subjobContainer.isCollapsed());
    process.getCommandStack().execute(ppc);
    reSelection();
  }
}
Program: 123176
Project: 123176
Buggy source:
public void initializeSubjobContainer(Rectangle rectangle){
  disposeColors();
  Point location=this.getLocation();
  collapseFigure.setCollapsed(subjobContainer.isCollapsed());
  titleFigure.setText("String_Node_Str" + title + "String_Node_Str");
  Dimension preferedSize=titleFigure.getPreferredSize();
  preferedSize=preferedSize.getExpanded(0,2);
  rectangle.width+=32;
  titleFigure.setSize(rectangle.width - preferedSize.height,preferedSize.height);
  titleFigure.setLocation(location);
  titleFigure.setVisible(showTitle);
  outlineFigure.setLocation(location);
  outlineFigure.setVisible(showTitle);
  outlineFigure.setBackgroundColor(new Color(Display.getDefault(),subjobTitleColor));
  outlineFigure.setForegroundColor(new Color(Display.getDefault(),subjobTitleColor));
  outlineFigure.setSize(rectangle.width,preferedSize.height);
  collapseFigure.setLocation(new Point(rectangle.width - preferedSize.height + location.x,location.y));
  collapseFigure.setSize(preferedSize.height,preferedSize.height);
  rectFig.setLocation(new Point(location.x,location.y));
  rectFig.setSize(new Dimension(rectangle.width,rectangle.height));
  rectFig.setBackgroundColor(new Color(Display.getDefault(),mainColor));
  rectFig.setForegroundColor(new Color(Display.getDefault(),subjobTitleColor));
}

Fixed version (ground truth):
public void initializeSubjobContainer(Rectangle rectangle){
  disposeColors();
  Point location=this.getLocation();
  collapseFigure.setCollapsed(subjobContainer.isCollapsed());
  titleFigure.setText("String_Node_Str" + title + "String_Node_Str");
  Dimension preferedSize=titleFigure.getPreferredSize();
  preferedSize=preferedSize.getExpanded(0,2);
  titleFigure.setSize(rectangle.width - preferedSize.height,preferedSize.height);
  titleFigure.setLocation(location);
  titleFigure.setVisible(showTitle);
  outlineFigure.setLocation(location);
  outlineFigure.setVisible(showTitle);
  outlineFigure.setBackgroundColor(new Color(Display.getDefault(),subjobTitleColor));
  outlineFigure.setForegroundColor(new Color(Display.getDefault(),subjobTitleColor));
  outlineFigure.setSize(rectangle.width,preferedSize.height);
  collapseFigure.setLocation(new Point(rectangle.width - preferedSize.height + location.x,location.y));
  collapseFigure.setSize(preferedSize.height,preferedSize.height);
  rectFig.setLocation(new Point(location.x,location.y));
  rectFig.setSize(new Dimension(rectangle.width,rectangle.height));
  rectFig.setBackgroundColor(new Color(Display.getDefault(),mainColor));
  rectFig.setForegroundColor(new Color(Display.getDefault(),subjobTitleColor));
}
Program: 123177
Project: 123177
Buggy source:
protected void initSchemaTable(){
  IConnection inConn=null;
  for (  IConnection conn : externalNode.getIncomingConnections()) {
    if ((conn.getLineStyle().equals(EConnectionType.FLOW_MAIN)) || (conn.getLineStyle().equals(EConnectionType.FLOW_REF))) {
      inConn=conn;
      break;
    }
  }
  if (inConn != null) {
    List<IMetadataColumn> columnList=inConn.getMetadataTable().getListColumns();
    schemaViewer.setInput(columnList);
  }
 else {
    schemaViewer.setInput(new ArrayList<IMetadataColumn>());
  }
}

Fixed version (ground truth):
protected void initSchemaTable(){
  IConnection inConn=null;
  for (  IConnection conn : externalNode.getIncomingConnections()) {
    if ((conn.getLineStyle().equals(EConnectionType.FLOW_MAIN)) || (conn.getLineStyle().equals(EConnectionType.FLOW_REF)) || (conn.getLineStyle().equals(EConnectionType.FLOW_MERGE))) {
      inConn=conn;
      break;
    }
  }
  if (inConn != null) {
    List<IMetadataColumn> columnList=inConn.getMetadataTable().getListColumns();
    schemaViewer.setInput(columnList);
  }
 else {
    schemaViewer.setInput(new ArrayList<IMetadataColumn>());
  }
}
Program: 123178
Project: 123178
Buggy source:
public void widgetSelected(SelectionEvent e){
  TreeItem newItem=new TreeItem(treeItem[0],0);
  newItem.setText(itemName);
  TreeNodeData newNodeData=null;
  newNodeData=new TreeNodeData();
  Node parentNode=treeNodeData.getXMLNode();
  newNodeData.setXMLNode(parentNode.appendChild(parentNode.getOwnerDocument().createElement(itemName)));
  newNodeData.setTreePath(treeNodeData.getTreePath() + "String_Node_Str" + itemName);
  newNodeData.setTreeNode(ATreeNodeUtil.getTreeNodeByPath(newNodeData.getTreePath()));
  newItem.setData(newNodeData);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  TreeItem newItem=new TreeItem(treeItem[0],0);
  newItem.setText(itemName);
  TreeNodeData newNodeData=null;
  newNodeData=new TreeNodeData();
  Node parentNode=treeNodeData.getXMLNode();
  newNodeData.setXMLNode(parentNode.appendChild(parentNode.getOwnerDocument().createElement(itemName)));
  newNodeData.setTreePath(treeNodeData.getTreePath() + "String_Node_Str" + itemName);
  newNodeData.setTreeNode(ATreeNodeUtil.getTreeNodeByPath(newNodeData.getTreePath()));
  newItem.setData(newNodeData);
}
Program: 123179
Project: 123179
Buggy source:
protected boolean validatePage(){
  return false;
}

Fixed version (ground truth):
@Override protected boolean validatePage(){
  return false;
}
Program: 123181
Project: 123181
Buggy source:
@Override protected void createPageContent(Composite parent){
  Composite topComposite=new Composite(parent,SWT.NONE);
  topComposite.setLayout(new GridLayout(2,false));
  GridData data=new GridData(GridData.FILL_BOTH);
  topComposite.setLayoutData(data);
  availableXmlTree=new Tree(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  GridData treeGD=new GridData(GridData.FILL_BOTH);
  treeGD.widthHint=110;
  treeGD.grabExcessHorizontalSpace=true;
  treeGD.grabExcessVerticalSpace=true;
  availableXmlTree.setLayoutData(treeGD);
  rightComposite=new Composite(topComposite,SWT.NONE);
  GridData rightPanelGd=new GridData(GridData.FILL_BOTH);
  rightPanelGd.widthHint=180;
  rightComposite.setLayoutData(rightPanelGd);
  rightComposite.setLayout(new GridLayout());
  Label label=new Label(rightComposite,SWT.NONE);
  label.setText(Messages.getString("String_Node_Str"));
  GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(labelGd);
  this.setControl(topComposite);
}

Fixed version (ground truth):
@Override protected void createPageContent(Composite parent){
  Composite topComposite=new Composite(parent,SWT.NONE);
  topComposite.setLayout(new FillLayout());
  availableXmlTree=new Tree(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  GridData treeGD=new GridData(GridData.FILL_BOTH);
  treeGD.widthHint=110;
  treeGD.grabExcessHorizontalSpace=true;
  treeGD.grabExcessVerticalSpace=true;
  availableXmlTree.setLayoutData(treeGD);
  scrolledComposite=new ScrolledComposite(topComposite,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
  rightComposite=new Composite(scrolledComposite,SWT.NONE);
  GridData rightPanelGd=new GridData(GridData.FILL_BOTH);
  rightPanelGd.widthHint=180;
  rightComposite.setLayoutData(rightPanelGd);
  rightComposite.setLayout(new GridLayout());
  Label label=new Label(rightComposite,SWT.NONE);
  label.setText(Messages.getString("String_Node_Str"));
  GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(labelGd);
  scrolledComposite.setContent(rightComposite);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  this.setControl(topComposite);
}
Program: 123182
Project: 123182
Buggy source:
/** 
 * Get all route resource needed.
 * @param osgiResource
 * @param processItem
 */
private void addOSGIRouteResources(ExportFileResource osgiResource,ProcessItem processItem){
  ICamelDesignerCoreService camelService=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
  List<IPath> paths=camelService.synchronizeRouteResource(processItem);
  for (  IPath path : paths) {
    IPath relativePath=path.removeLastSegments(1);
    String pathStr=relativePath.toString();
    if (relativePath.lastSegment().equals(JavaUtils.JAVA_SRC_DIRECTORY)) {
      pathStr="String_Node_Str";
    }
 else {
      int index=pathStr.indexOf(JavaUtils.JAVA_SRC_DIRECTORY);
      if (index > -1) {
        pathStr=pathStr.substring(index + JavaUtils.JAVA_SRC_DIRECTORY.length() + 1);
      }
    }
    try {
      URL url=path.toFile().toURI().toURL();
      osgiResource.addResource(pathStr,url);
    }
 catch (    MalformedURLException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Get all route resource needed.
 * @param osgiResource
 * @param processItem
 */
private void addOSGIRouteResources(ExportFileResource osgiResource,ProcessItem processItem){
  ICamelDesignerCoreService camelService=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
  List<IPath> paths=camelService.synchronizeRouteResource(processItem);
  IProject project=ResourcesPlugin.getWorkspace().getRoot().getProject(JavaUtils.JAVA_PROJECT_NAME);
  IFolder srcFolder=project.getFolder(JavaUtils.JAVA_SRC_DIRECTORY);
  IPath srcPath=srcFolder.getLocation();
  for (  IPath path : paths) {
    IPath relativePath=path.removeLastSegments(1);
    relativePath=relativePath.removeFirstSegments(srcPath.segmentCount());
    String pathStr=relativePath.toString();
    try {
      URL url=path.toFile().toURI().toURL();
      osgiResource.addResource(pathStr,url);
    }
 catch (    MalformedURLException e) {
      e.printStackTrace();
    }
  }
}
Program: 123183
Project: 123183
Buggy source:
private void placeCursorToSelection(){
  String mainPart="String_Node_Str" + currentSelection + "String_Node_Str";
  String assignmentPart="String_Node_Str" + currentSelection + "String_Node_Str";
  if (getDocumentProvider() == null) {
    return;
  }
  IDocument doc=getDocumentProvider().getDocument(getEditorInput());
  FindReplaceDocumentAdapter frda=new FindReplaceDocumentAdapter(doc);
  try {
    Region region=(Region)frda.find(0,mainPart,true,false,false,false);
    if (region != null) {
      Region region2=(Region)frda.find(region.getOffset(),assignmentPart,true,false,false,false);
      if (region2 != null) {
        selectAndReveal(region2.getOffset(),assignmentPart.length());
      }
 else {
        selectAndReveal(region.getOffset(),mainPart.length());
      }
    }
 else {
      selectAndReveal(0,0);
    }
  }
 catch (  BadLocationException e) {
    selectAndReveal(0,0);
  }
}

Fixed version (ground truth):
private void placeCursorToSelection(){
  String mainPart="String_Node_Str" + currentSelection + "String_Node_Str";
  String assignmentPart="String_Node_Str" + currentSelection + "String_Node_Str";
  if (getDocumentProvider() == null) {
    return;
  }
  IDocument doc=getDocumentProvider().getDocument(getEditorInput());
  if (doc != null) {
    FindReplaceDocumentAdapter frda=new FindReplaceDocumentAdapter(doc);
    try {
      Region region=(Region)frda.find(0,mainPart,true,false,false,false);
      if (region != null) {
        Region region2=(Region)frda.find(region.getOffset(),assignmentPart,true,false,false,false);
        if (region2 != null) {
          selectAndReveal(region2.getOffset(),assignmentPart.length());
        }
 else {
          selectAndReveal(region.getOffset(),mainPart.length());
        }
      }
 else {
        selectAndReveal(0,0);
      }
    }
 catch (    BadLocationException e) {
      selectAndReveal(0,0);
    }
  }
}
Program: 123186
Project: 123186
Buggy source:
@Override public String getPartName(){
  if (item != null) {
    IRepositoryView viewPart=RepositoryManagerHelper.findRepositoryView();
    if (viewPart != null) {
      RepositoryNode repositoryNode=rEditorInput.getRepositoryNode();
      return getTitleText(repositoryNode.getObject());
    }
  }
  return super.getPartName();
}

Fixed version (ground truth):
@Override public String getPartName(){
  if (item != null) {
    IRepositoryView viewPart=RepositoryManagerHelper.findRepositoryView();
    if (viewPart != null) {
      RepositoryNode repositoryNode=rEditorInput.getRepositoryNode();
      if (repositoryNode != null) {
        return getTitleText(repositoryNode.getObject());
      }
    }
  }
  return super.getPartName();
}
Program: 123187
Project: 123187
Buggy source:
/** 
 * ggu Comment method "restoreProblem". when restore the item, check the problem.
 */
private void restoreProblem(RoutineItem item){
  ICodeGeneratorService service=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  ITalendSynchronizer routineSynchronizer=null;
switch (LanguageManager.getCurrentLanguage()) {
case JAVA:
    routineSynchronizer=service.createJavaRoutineSynchronizer();
  break;
case PERL:
routineSynchronizer=service.createPerlRoutineSynchronizer();
break;
default :
}
if (routineSynchronizer != null) {
try {
routineSynchronizer.syncRoutine(item,true);
IFile file=routineSynchronizer.getFile(item);
file.refreshLocal(IResource.DEPTH_ONE,null);
Problems.addRoutineFile(file,item.getProperty());
}
 catch (SystemException e) {
ExceptionHandler.process(e);
}
catch (CoreException e) {
ExceptionHandler.process(e);
}
Display.getDefault().asyncExec(new Runnable(){
public void run(){
Problems.refreshProblemTreeView();
}
}
);
}
}

Fixed version (ground truth):
/** 
 * ggu Comment method "restoreProblem". when restore the item, check the problem.
 */
private void restoreProblem(RoutineItem item){
  ICodeGeneratorService service=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  ITalendSynchronizer routineSynchronizer=null;
switch (LanguageManager.getCurrentLanguage()) {
case JAVA:
    routineSynchronizer=service.createJavaRoutineSynchronizer();
  break;
case PERL:
routineSynchronizer=service.createPerlRoutineSynchronizer();
break;
default :
}
if (routineSynchronizer != null) {
try {
routineSynchronizer.syncRoutine(item,true);
IFile file=routineSynchronizer.getFile(item);
file.refreshLocal(IResource.DEPTH_ONE,null);
Problems.addRoutineFile(file,item.getProperty());
}
 catch (SystemException e) {
ExceptionHandler.process(e);
}
catch (CoreException e) {
ExceptionHandler.process(e);
}
Display.getDefault().asyncExec(new Runnable(){
@Override public void run(){
Problems.refreshProblemTreeView();
}
}
);
}
}
Program: 123188
Project: 123188
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
}
Program: 123189
Project: 123189
Buggy source:
public static ProblemsView show(){
  IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  if (activePage != null) {
    IViewPart part=activePage.findView(ID);
    try {
      part=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ID);
    }
 catch (    Exception e) {
    }
    return (ProblemsView)part;
  }
  return null;
}

Fixed version (ground truth):
public static ProblemsView show(){
  IWorkbenchWindow ww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (ww != null) {
    IWorkbenchPage activePage=ww.getActivePage();
    if (activePage != null) {
      IViewPart part=activePage.findView(ID);
      try {
        part=activePage.showView(ID);
      }
 catch (      Exception e) {
      }
      return (ProblemsView)part;
    }
  }
  return null;
}
Program: 123190
Project: 123190
Buggy source:
public void run(){
  Problems.refreshProblemTreeView();
}

Fixed version (ground truth):
@Override public void run(){
  Problems.refreshProblemTreeView();
}
Program: 123191
Project: 123191
Buggy source:
protected void doRun(){
  if (problem != null) {
    try {
      RoutineItem routine=getRoutineItem();
      IEditorPart editor=openRoutineEditor(routine,false);
      focusMarkerForRoutineEditor(editor);
      IRepositoryView view=getViewPart();
      if (view != null) {
        view.refresh(ERepositoryObjectType.ROUTINES);
      }
    }
 catch (    SystemException e) {
      MessageBoxExceptionHandler.process(e);
    }
catch (    PartInitException e) {
      MessageBoxExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (problem != null) {
    try {
      RoutineItem routine=getRoutineItem();
      IEditorPart editor=openRoutineEditor(routine,false);
      focusMarkerForRoutineEditor(editor);
      IRepositoryView view=getViewPart();
      if (view != null) {
        view.refresh(ERepositoryObjectType.ROUTINES);
      }
    }
 catch (    SystemException e) {
      MessageBoxExceptionHandler.process(e);
    }
catch (    PartInitException e) {
      MessageBoxExceptionHandler.process(e);
    }
  }
}
Program: 123192
Project: 123192
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  Problem problem=(Problem)selection.getFirstElement();
  if (problem != null && problem.isConcrete()) {
    if (problem.getNodeName() != null) {
      selectInDesigner(problem.getJobInfo(),problem.getNodeName());
    }
 else     if (problem instanceof TalendProblem) {
      selectInRoutine((TalendProblem)problem);
    }
  }
}

Fixed version (ground truth):
@Override public void selectionChanged(SelectionChangedEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  Problem problem=(Problem)selection.getFirstElement();
  if (problem != null && problem.isConcrete()) {
    if (problem.getNodeName() != null) {
      selectInDesigner(problem.getJobInfo(),problem.getNodeName());
    }
 else     if (problem instanceof TalendProblem) {
      selectInRoutine((TalendProblem)problem);
    }
  }
}
Program: 123193
Project: 123193
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
  if (!(evt.getNewValue() instanceof IRepositoryObject)) {
    return;
  }
  IRepositoryObject object=(IRepositoryObject)evt.getNewValue();
  if (object.getRepositoryObjectType() != ERepositoryObjectType.ROUTINES) {
    return;
  }
  if (evt.getPropertyName().equals(ERepositoryActionName.JOB_DELETE_TO_RECYCLE_BIN.getName()) || evt.getPropertyName().equals(ERepositoryActionName.JOB_DELETE_FOREVER.getName())) {
    String routineLabel=object.getProperty().getLabel();
    Problems.removeProblemsByRoutine(routineLabel);
  }
  if (evt.getPropertyName().equals(ERepositoryActionName.JOB_RESTORE.getName())) {
    RoutineItem item=(RoutineItem)object.getProperty().getItem();
    restoreProblem(item);
  }
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent evt){
  if (!(evt.getNewValue() instanceof IRepositoryObject)) {
    return;
  }
  IRepositoryObject object=(IRepositoryObject)evt.getNewValue();
  if (object.getRepositoryObjectType() != ERepositoryObjectType.ROUTINES) {
    return;
  }
  if (evt.getPropertyName().equals(ERepositoryActionName.JOB_DELETE_TO_RECYCLE_BIN.getName()) || evt.getPropertyName().equals(ERepositoryActionName.JOB_DELETE_FOREVER.getName())) {
    String routineLabel=object.getProperty().getLabel();
    Problems.removeProblemsByRoutine(routineLabel);
  }
  if (evt.getPropertyName().equals(ERepositoryActionName.JOB_RESTORE.getName())) {
    RoutineItem item=(RoutineItem)object.getProperty().getItem();
    restoreProblem(item);
  }
}
Program: 123197
Project: 123197
Buggy source:
protected void createActions(){
  super.createActions();
  getAction(IJavaEditorActionDefinitionIds.SHOW_IN_BREADCRUMB).setEnabled(false);
}

Fixed version (ground truth):
@Override protected void createActions(){
  super.createActions();
  getAction(IJavaEditorActionDefinitionIds.SHOW_IN_BREADCRUMB).setEnabled(false);
}
Program: 123198
Project: 123198
Buggy source:
private void placeCursorToSelection(){
  String mainPart="String_Node_Str" + currentSelection + "String_Node_Str";
  String assignmentPart="String_Node_Str" + currentSelection + "String_Node_Str";
  if (getDocumentProvider() == null) {
    return;
  }
  IDocument doc=getDocumentProvider().getDocument(getEditorInput());
  FindReplaceDocumentAdapter frda=new FindReplaceDocumentAdapter(doc);
  try {
    Region region=(Region)frda.find(0,mainPart,true,false,false,false);
    if (region != null) {
      Region region2=(Region)frda.find(region.getOffset(),assignmentPart,true,false,false,false);
      if (region2 != null) {
        selectAndReveal(region2.getOffset(),assignmentPart.length());
      }
 else {
        selectAndReveal(region.getOffset(),mainPart.length());
      }
    }
 else {
      selectAndReveal(0,0);
    }
  }
 catch (  BadLocationException e) {
    selectAndReveal(0,0);
  }
}

Fixed version (ground truth):
private void placeCursorToSelection(){
  String mainPart="String_Node_Str" + currentSelection + "String_Node_Str";
  String assignmentPart="String_Node_Str" + currentSelection + "String_Node_Str";
  if (getDocumentProvider() == null) {
    return;
  }
  IDocument doc=getDocumentProvider().getDocument(getEditorInput());
  if (doc != null) {
    FindReplaceDocumentAdapter frda=new FindReplaceDocumentAdapter(doc);
    try {
      Region region=(Region)frda.find(0,mainPart,true,false,false,false);
      if (region != null) {
        Region region2=(Region)frda.find(region.getOffset(),assignmentPart,true,false,false,false);
        if (region2 != null) {
          selectAndReveal(region2.getOffset(),assignmentPart.length());
        }
 else {
          selectAndReveal(region.getOffset(),mainPart.length());
        }
      }
 else {
        selectAndReveal(0,0);
      }
    }
 catch (    BadLocationException e) {
      selectAndReveal(0,0);
    }
  }
}
Program: 123199
Project: 123199
Buggy source:
protected boolean isErrorStatus(IStatus status){
  if (!(process.getProperty().getItem() instanceof ProcessItem)) {
    return false;
  }
  return super.isErrorStatus(status);
}

Fixed version (ground truth):
@Override protected boolean isErrorStatus(IStatus status){
  if (!(process.getProperty().getItem() instanceof ProcessItem)) {
    return false;
  }
  return super.isErrorStatus(status);
}
Program: 123200
Project: 123200
Buggy source:
public void run(){
  placeCursorToSelection();
  Property property=process.getProperty();
  ITalendSynchronizer synchronizer=CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
  try {
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
      try {
        CorePlugin.getDefault().getRunProcessService().getJavaProject().getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        ExceptionHandler.process(e);
      }
    }
    Item item=property.getItem();
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
      ICamelDesignerCoreService service=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
      if (service.isInstanceofCamel(item)) {
        synchronizer=CorePlugin.getDefault().getCodeGeneratorService().createCamelBeanSynchronizer();
      }
    }
    List<Information> informations=Problems.addRoutineFile(synchronizer.getFile(item),property,true);
    property.getInformations().clear();
    for (    Information info : informations) {
      if (info.getLevel().equals(InformationLevel.ERROR_LITERAL)) {
        property.getInformations().add(info);
      }
    }
    Problems.computePropertyMaxInformationLevel(property);
  }
 catch (  SystemException e) {
    ExceptionHandler.process(e);
  }
  Problems.refreshRepositoryView();
  Problems.refreshProblemTreeView();
}

Fixed version (ground truth):
@Override public void run(){
  placeCursorToSelection();
  Property property=process.getProperty();
  ITalendSynchronizer synchronizer=CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
  try {
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
      try {
        CorePlugin.getDefault().getRunProcessService().getJavaProject().getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        ExceptionHandler.process(e);
      }
    }
    Item item=property.getItem();
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
      ICamelDesignerCoreService service=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
      if (service.isInstanceofCamel(item)) {
        synchronizer=CorePlugin.getDefault().getCodeGeneratorService().createCamelBeanSynchronizer();
      }
    }
    List<Information> informations=Problems.addRoutineFile(synchronizer.getFile(item),property,true);
    property.getInformations().clear();
    for (    Information info : informations) {
      if (info.getLevel().equals(InformationLevel.ERROR_LITERAL)) {
        property.getInformations().add(info);
      }
    }
    Problems.computePropertyMaxInformationLevel(property);
  }
 catch (  SystemException e) {
    ExceptionHandler.process(e);
  }
  Problems.refreshRepositoryView();
  Problems.refreshProblemTreeView();
}
Program: 123201
Project: 123201
Buggy source:
/** 
 * DOC yzhang Comment method "isDisposed".
 * @return Whether this editor had been disposed.
 */
public boolean isDisposed(){
  return this.disposed;
}

Fixed version (ground truth):
/** 
 * DOC yzhang Comment method "isDisposed".
 * @return Whether this editor had been disposed.
 */
@Override public boolean isDisposed(){
  return this.disposed;
}
Program: 123203
Project: 123203
Buggy source:
private void placeCursorToSelection(){
  String mainPart="String_Node_Str" + currentSelection + "String_Node_Str";
  String assignmentPart="String_Node_Str" + currentSelection + "String_Node_Str";
  if (getDocumentProvider() == null) {
    return;
  }
  IDocument doc=getDocumentProvider().getDocument(getEditorInput());
  FindReplaceDocumentAdapter frda=new FindReplaceDocumentAdapter(doc);
  try {
    Region region=(Region)frda.find(0,mainPart,true,false,false,false);
    if (region != null) {
      Region region2=(Region)frda.find(region.getOffset(),assignmentPart,true,false,false,false);
      if (region2 != null) {
        selectAndReveal(region2.getOffset(),assignmentPart.length());
      }
 else {
        selectAndReveal(region.getOffset(),mainPart.length());
      }
    }
 else {
      selectAndReveal(0,0);
    }
  }
 catch (  BadLocationException e) {
    selectAndReveal(0,0);
  }
}

Fixed version (ground truth):
private void placeCursorToSelection(){
  String mainPart="String_Node_Str" + currentSelection + "String_Node_Str";
  String assignmentPart="String_Node_Str" + currentSelection + "String_Node_Str";
  if (getDocumentProvider() == null) {
    return;
  }
  IDocument doc=getDocumentProvider().getDocument(getEditorInput());
  if (doc != null) {
    FindReplaceDocumentAdapter frda=new FindReplaceDocumentAdapter(doc);
    try {
      Region region=(Region)frda.find(0,mainPart,true,false,false,false);
      if (region != null) {
        Region region2=(Region)frda.find(region.getOffset(),assignmentPart,true,false,false,false);
        if (region2 != null) {
          selectAndReveal(region2.getOffset(),assignmentPart.length());
        }
 else {
          selectAndReveal(region.getOffset(),mainPart.length());
        }
      }
 else {
        selectAndReveal(0,0);
      }
    }
 catch (    BadLocationException e) {
      selectAndReveal(0,0);
    }
  }
}
Program: 123204
Project: 123204
Buggy source:
@Override public String getPartName(){
  if (item != null) {
    IRepositoryView viewPart=RepositoryManagerHelper.findRepositoryView();
    if (viewPart != null) {
      RepositoryNode repositoryNode=rEditorInput.getRepositoryNode();
      return getTitleText(repositoryNode.getObject());
    }
  }
  return super.getPartName();
}

Fixed version (ground truth):
@Override public String getPartName(){
  if (item != null) {
    IRepositoryView viewPart=RepositoryManagerHelper.findRepositoryView();
    if (viewPart != null) {
      RepositoryNode repositoryNode=rEditorInput.getRepositoryNode();
      if (repositoryNode != null) {
        return getTitleText(repositoryNode.getObject());
      }
    }
  }
  return super.getPartName();
}
Program: 123206
Project: 123206
Buggy source:
@Override public void propertyChanged(Object source,int propId){
  if (getEditor(2).isDirty()) {
    getProcess().setProcessModified(true);
    getProcess().setNeedRegenerateCode(true);
  }
}

Fixed version (ground truth):
@Override public void propertyChanged(Object source,int propId){
  if (source instanceof IEditorPart && ((IEditorPart)source).isDirty()) {
    getProcess().setProcessModified(true);
    getProcess().setNeedRegenerateCode(true);
  }
}