nus-yam/ex-repair huggingface dataset:
Program: 122766
Project: 122766
Buggy source:
protected void saveOneColumn(Document document,IMetadataColumn metadataColumn,Element column){
  super.saveOneColumn(document,metadataColumn,column);
  if (metadataColumn instanceof MetadataColumnExt) {
    MetadataColumnExt columnExt=(MetadataColumnExt)metadataColumn;
    Attr function=document.createAttribute("String_Node_Str");
    function.setNodeValue(columnExt.getFunction().getName());
    column.setAttributeNode(function);
    Attr parameter=document.createAttribute("String_Node_Str");
    parameter.setNodeValue(columnExt.getParameter());
    column.setAttributeNode(parameter);
    Attr preview=document.createAttribute("String_Node_Str");
    preview.setNodeValue(columnExt.getPreview());
    column.setAttributeNode(preview);
  }
}

Fixed version (ground truth):
@Override protected void saveOneColumn(Document document,IMetadataColumn metadataColumn,Element column){
  super.saveOneColumn(document,metadataColumn,column);
  if (metadataColumn instanceof MetadataColumnExt) {
    MetadataColumnExt columnExt=(MetadataColumnExt)metadataColumn;
    Attr function=document.createAttribute("String_Node_Str");
    function.setNodeValue(funManager.getFunctionLable(columnExt.getFunction()));
    column.setAttributeNode(function);
    Attr parameter=document.createAttribute("String_Node_Str");
    parameter.setNodeValue(columnExt.getParameter());
    column.setAttributeNode(parameter);
    Attr preview=document.createAttribute("String_Node_Str");
    preview.setNodeValue(columnExt.getPreview());
    column.setAttributeNode(preview);
  }
}
Program: 122767
Project: 122767
Buggy source:
@SuppressWarnings("String_Node_Str") protected IMetadataColumn initializeOneColumn(final IMetadataColumn metadataColumn,final NamedNodeMap nodeMap){
  IMetadataColumn column=super.initializeOneColumn(metadataColumn,nodeMap);
  MetadataColumnExt columnExt=new MetadataColumnExt((MetadataColumn)column);
  Node function=nodeMap.getNamedItem("String_Node_Str");
  if (function != null) {
    Node parameter=nodeMap.getNamedItem("String_Node_Str");
    Node preview=nodeMap.getNamedItem("String_Node_Str");
    Function function2=new FunctionManagerExt().getCurrentFunction(function.getNodeValue(),columnExt);
    List<Parameter> parms=function2.getParameters();
    String[] paraStr=parameter.getNodeValue().split("String_Node_Str");
    for (    String string : paraStr) {
      String[] nv=string.split("String_Node_Str");
      for (      Parameter para : parms) {
        if (para.getName().equals(nv[0].trim())) {
          para.setValue(nv[1]);
          break;
        }
      }
    }
    columnExt.setFunction(function2);
    columnExt.setPreview(preview.getNodeValue());
  }
 else {
    Function function2=new FunctionManagerExt().getDefaultFunction(columnExt,columnExt.getTalendType());
    columnExt.setFunction(function2);
    columnExt.setPreview("String_Node_Str");
  }
  return columnExt;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") protected IMetadataColumn initializeOneColumn(final IMetadataColumn metadataColumn,final NamedNodeMap nodeMap){
  IMetadataColumn column=super.initializeOneColumn(metadataColumn,nodeMap);
  MetadataColumnExt columnExt=new MetadataColumnExt((MetadataColumn)column);
  Node function=nodeMap.getNamedItem("String_Node_Str");
  if (function != null) {
    Node parameter=nodeMap.getNamedItem("String_Node_Str");
    Node preview=nodeMap.getNamedItem("String_Node_Str");
    Function function2=new FunctionManagerExt().getCurrentFunction(function.getNodeValue(),columnExt);
    List<Parameter> parms=function2.getParameters();
    String[] paraStr=parameter.getNodeValue().split("String_Node_Str");
    for (    String string : paraStr) {
      String[] nv=string.split("String_Node_Str");
      for (      Parameter para : parms) {
        if (para.getName().equals(nv[0].trim())) {
          para.setValue(nv[1]);
          break;
        }
      }
    }
    columnExt.setFunction(function2);
    columnExt.setPreview(preview.getNodeValue());
  }
 else {
    Function function2=new FunctionManagerExt().getDefaultFunction(columnExt,columnExt.getTalendType());
    columnExt.setFunction(function2);
    columnExt.setPreview("String_Node_Str");
  }
  return columnExt;
}
Program: 122769
Project: 122769
Buggy source:
public void run(){
  MessageDialog.openWarning(composite.getShell(),Messages.getString("String_Node_Str"),strExcepton);
}

Fixed version (ground truth):
@Override public void run(){
  MessageDialog.openWarning(composite.getShell(),Messages.getString("String_Node_Str"),strExcepton);
}
Program: 122771
Project: 122771
Buggy source:
public static boolean isNumeric(String s){
  if ((s != null) && (s != "String_Node_Str"))   return s.matches("String_Node_Str");
 else   return false;
}

Fixed version (ground truth):
public static boolean isNumeric(String s){
  if ((s != null) && (s != "String_Node_Str")) {
    return s.matches("String_Node_Str");
  }
 else {
    return false;
  }
}
Program: 122772
Project: 122772
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent evt){
}
Program: 122774
Project: 122774
Buggy source:
public void widgetDefaultSelected(SelectionEvent e){
}

Fixed version (ground truth):
@Override public void widgetDefaultSelected(SelectionEvent e){
}
Program: 122775
Project: 122775
Buggy source:
public Command createCommand(Button button){
  IElementParameter elementParameter=this.curParameter.getElement().getElementParameter("String_Node_Str");
  Command command=null;
  if (elementParameter != null) {
    String filePath=new Path(PathExtractor.extractPath(elementParameter.getValue().toString())).toOSString();
    if (filePath != null && new File(filePath).exists()) {
      TnsEditorDialog tnsDialog=new TnsEditorDialog(composite.getShell(),new File(filePath));
      if (tnsDialog.open() == Window.OK) {
        TnsInfo tnsInfo=tnsDialog.getTnsInfo();
        command=new TnsPropertyCommand(tnsInfo,this.elem);
      }
    }
 else {
      MessageBox mBox=new MessageBox(composite.getShell(),SWT.ICON_ERROR);
      mBox.setText("String_Node_Str");
      mBox.setMessage("String_Node_Str");
      mBox.open();
    }
  }
  return command;
}

Fixed version (ground truth):
public Command createCommand(Button button){
  IElementParameter elementParameter=this.curParameter.getElement().getElementParameter("String_Node_Str");
  Command command=null;
  if (elementParameter != null) {
    String filePath=new Path(PathExtractor.extractPath(elementParameter.getValue().toString())).toOSString();
    if (filePath != null && new File(filePath).exists()) {
      boolean flag=false;
      try {
        TnsParser tnsparser=new TnsParser(new File(filePath));
        if (tnsparser.getTree().getChildren().size() == 0) {
          flag=true;
        }
      }
 catch (      Exception e) {
        flag=true;
      }
      if (flag) {
        Display.getDefault().syncExec(new Runnable(){
          @Override public void run(){
            MessageDialog.openInformation(composite.getShell(),"String_Node_Str","String_Node_Str");
          }
        }
);
      }
 else {
        TnsEditorDialog tnsDialog=new TnsEditorDialog(composite.getShell(),new File(filePath));
        if (tnsDialog.open() == Window.OK) {
          TnsInfo tnsInfo=tnsDialog.getTnsInfo();
          command=new TnsPropertyCommand(tnsInfo,this.elem);
        }
      }
    }
 else {
      MessageBox mBox=new MessageBox(composite.getShell(),SWT.ICON_ERROR);
      mBox.setText("String_Node_Str");
      mBox.setMessage("String_Node_Str");
      mBox.open();
    }
  }
  return command;
}
Program: 122776
Project: 122776
Buggy source:
public void widgetSelected(SelectionEvent e){
  Command cmd=createCommand((Button)e.getSource());
  executeCommand(cmd);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  Command cmd=createCommand((Button)e.getSource());
  executeCommand(cmd);
}
Program: 122777
Project: 122777
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent evt){
}
Program: 122778
Project: 122778
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  TnsParser tnsparser=new TnsParser(tnsFile);
  treeViewer=new TreeViewer(parent);
  Tree tree=treeViewer.getTree();
  tree.setHeaderVisible(true);
  tree.setLinesVisible(true);
  GridData layoutData=new GridData(GridData.FILL_BOTH);
  layoutData.heightHint=400;
  layoutData.widthHint=300;
  tree.setLayoutData(layoutData);
  TreeColumn column1st=new TreeColumn(tree,SWT.NONE);
  column1st.setText(Messages.getString("String_Node_Str"));
  column1st.setWidth(200);
  TreeColumn column2nd=new TreeColumn(tree,SWT.NONE);
  column2nd.setText(Messages.getString("String_Node_Str"));
  column2nd.setWidth(200);
  treeViewer.setContentProvider(new TnsContentProvider());
  treeViewer.setLabelProvider(new TnsTableProvider());
  treeViewer.setInput(tnsparser.getTree());
  treeViewer.expandAll();
  treeViewer.addDoubleClickListener(new IDoubleClickListener(){
    @Override public void doubleClick(    DoubleClickEvent event){
      okPressed();
    }
  }
);
  if (tnsparser.getTree().getChildren().size() == 0) {
    MessageDialog.openInformation(getParentShell(),"String_Node_Str","String_Node_Str");
  }
  return tree;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  TnsParser tnsparser=new TnsParser(tnsFile);
  treeViewer=new TreeViewer(parent);
  Tree tree=treeViewer.getTree();
  tree.setHeaderVisible(true);
  tree.setLinesVisible(true);
  GridData layoutData=new GridData(GridData.FILL_BOTH);
  layoutData.heightHint=400;
  layoutData.widthHint=300;
  tree.setLayoutData(layoutData);
  TreeColumn column1st=new TreeColumn(tree,SWT.NONE);
  column1st.setText(Messages.getString("String_Node_Str"));
  column1st.setWidth(200);
  TreeColumn column2nd=new TreeColumn(tree,SWT.NONE);
  column2nd.setText(Messages.getString("String_Node_Str"));
  column2nd.setWidth(200);
  treeViewer.setContentProvider(new TnsContentProvider());
  treeViewer.setLabelProvider(new TnsTableProvider());
  treeViewer.setInput(tnsparser.getTree());
  treeViewer.expandAll();
  treeViewer.addDoubleClickListener(new IDoubleClickListener(){
    @Override public void doubleClick(    DoubleClickEvent event){
      okPressed();
    }
  }
);
  return tree;
}
Program: 122779
Project: 122779
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: 122780
Project: 122780
Buggy source:
public Function getCurrentFunction(String funName,MetadataColumnExt bean){
  Function currentFun=new Function();
  List<Function> functions=getFunctionByName(bean.getTalendType());
  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 {
    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;
      }
      if (funName.equals(functions.get(i).getName())) {
        currentFun=functions.get(i);
      }
    }
    Arrays.sort(arrayTalendFunctions2,new Comparator<String>(){
      public int compare(      String n1,      String n2){
        return n1.compareTo(n2);
      }
    }
);
    bean.setArrayFunctions(arrayTalendFunctions2);
  }
  return currentFun;
}

Fixed version (ground truth):
public Function getCurrentFunction(String funLabel,MetadataColumnExt bean){
  Function currentFun=null;
  List<Function> functions=getFunctionsByType(bean.getTalendType());
  String[] arrayTalendFunctions2=new String[functions.size()];
  if (functions.isEmpty()) {
    currentFun=new Function();
    currentFun.setDescription("String_Node_Str");
    currentFun.setPreview("String_Node_Str");
    currentFun.setParameters(new ArrayList<Parameter>());
    bean.setArrayFunctions(arrayTalendFunctions2);
  }
 else {
    currentFun=getFunnctionByLabel(functions,funLabel);
    bean.setArrayFunctions(getFunctionArrays(functions));
  }
  return currentFun;
}
Program: 122781
Project: 122781
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):
private Function getDefaultFunction(List<Function> functions){
  Function currentFun=null;
  for (  Function fun : functions) {
    if (fun.getName().equals(DEFAULT_SELECTED_METHOD)) {
      currentFun=(Function)fun.clone();
      break;
    }
  }
  if (currentFun == null && !functions.isEmpty()) {
    currentFun=(Function)functions.get(0).clone();
  }
  return currentFun;
}
Program: 122782
Project: 122782
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(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;
}

Fixed version (ground truth):
public Function getFuntionFromArray(MetadataColumnExt bean,RowGeneratorComponent externalNode,int index){
  String value=externalNode.getColumnValue(bean,index);
  List<Function> functions=getFunctionsByType(bean.getTalendType());
  Function currentFun=getAvailableFunFromValue(bean,value,functions);
  if (currentFun == null) {
    currentFun=getDefaultFunction(functions);
  }
  return currentFun;
}
Program: 122783
Project: 122783
Buggy source:
/** 
 * qzhang Comment method "convert".
 * @param outputMetaTable2
 * @return TODO
 */
public void convert(RowGeneratorComponent externalNode,IMetadataTable outputMetaTable2,FunctionManagerExt functionManager){
  List<IMetadataColumn> exts=new ArrayList<IMetadataColumn>();
  for (int j=0; j < outputMetaTable2.getListColumns().size(); j++) {
    IMetadataColumn column=outputMetaTable2.getListColumns().get(j);
    if (column instanceof MetadataColumnExt) {
      exts.add(column.clone());
    }
 else     if (column instanceof MetadataColumn) {
      MetadataColumnExt ext=new MetadataColumnExt((MetadataColumn)column);
      List<Function> funs=functionManager.getFunctionByName(ext.getTalendType());
      String[] arrayTalendFunctions2=new String[funs.size()];
      List<String> list=new ArrayList<String>();
      for (int i=0; i < funs.size(); i++) {
        String name=funs.get(i).getName();
        if (list.contains(name)) {
          int indexOf=list.indexOf(name);
          arrayTalendFunctions2[indexOf]=funs.get(indexOf).getClassName() + "String_Node_Str" + name;
          String className=funs.get(i).getClassName();
          arrayTalendFunctions2[i]=className + "String_Node_Str" + name;
        }
 else {
          arrayTalendFunctions2[i]=name;
          list.add(name);
        }
      }
      ext.setArrayFunctions(arrayTalendFunctions2);
      if (!funs.isEmpty()) {
        ext.setFunction(functionManager.getFuntionFromArray(ext,externalNode,j));
      }
      exts.add(ext);
    }
  }
  outputMetaTable2.setListColumns(exts);
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "convert".
 * @param outputMetaTable2
 * @return TODO
 */
public void convert(RowGeneratorComponent externalNode,IMetadataTable outputMetaTable2,FunctionManagerExt functionManager){
  List<IMetadataColumn> exts=new ArrayList<IMetadataColumn>();
  for (int j=0; j < outputMetaTable2.getListColumns().size(); j++) {
    IMetadataColumn column=outputMetaTable2.getListColumns().get(j);
    if (column instanceof MetadataColumnExt) {
      exts.add(column.clone());
    }
 else     if (column instanceof MetadataColumn) {
      MetadataColumnExt ext=new MetadataColumnExt((MetadataColumn)column);
      List<Function> funs=functionManager.getFunctionsByType(ext.getTalendType());
      ext.setArrayFunctions(functionManager.getFunctionArrays(funs));
      if (!funs.isEmpty()) {
        ext.setFunction(functionManager.getFuntionFromArray(ext,externalNode,j));
      }
      exts.add(ext);
    }
  }
  outputMetaTable2.setListColumns(exts);
}
Program: 122784
Project: 122784
Buggy source:
protected void saveOneColumn(Document document,IMetadataColumn metadataColumn,Element column){
  super.saveOneColumn(document,metadataColumn,column);
  if (metadataColumn instanceof MetadataColumnExt) {
    MetadataColumnExt columnExt=(MetadataColumnExt)metadataColumn;
    Attr function=document.createAttribute("String_Node_Str");
    function.setNodeValue(columnExt.getFunction().getName());
    column.setAttributeNode(function);
    Attr parameter=document.createAttribute("String_Node_Str");
    parameter.setNodeValue(columnExt.getParameter());
    column.setAttributeNode(parameter);
    Attr preview=document.createAttribute("String_Node_Str");
    preview.setNodeValue(columnExt.getPreview());
    column.setAttributeNode(preview);
  }
}

Fixed version (ground truth):
@Override protected void saveOneColumn(Document document,IMetadataColumn metadataColumn,Element column){
  super.saveOneColumn(document,metadataColumn,column);
  if (metadataColumn instanceof MetadataColumnExt) {
    MetadataColumnExt columnExt=(MetadataColumnExt)metadataColumn;
    Attr function=document.createAttribute("String_Node_Str");
    function.setNodeValue(funManager.getFunctionLable(columnExt.getFunction()));
    column.setAttributeNode(function);
    Attr parameter=document.createAttribute("String_Node_Str");
    parameter.setNodeValue(columnExt.getParameter());
    column.setAttributeNode(parameter);
    Attr preview=document.createAttribute("String_Node_Str");
    preview.setNodeValue(columnExt.getPreview());
    column.setAttributeNode(preview);
  }
}
Program: 122785
Project: 122785
Buggy source:
@SuppressWarnings("String_Node_Str") protected IMetadataColumn initializeOneColumn(final IMetadataColumn metadataColumn,final NamedNodeMap nodeMap){
  IMetadataColumn column=super.initializeOneColumn(metadataColumn,nodeMap);
  MetadataColumnExt columnExt=new MetadataColumnExt((MetadataColumn)column);
  Node function=nodeMap.getNamedItem("String_Node_Str");
  if (function != null) {
    Node parameter=nodeMap.getNamedItem("String_Node_Str");
    Node preview=nodeMap.getNamedItem("String_Node_Str");
    Function function2=new FunctionManagerExt().getCurrentFunction(function.getNodeValue(),columnExt);
    List<Parameter> parms=function2.getParameters();
    String[] paraStr=parameter.getNodeValue().split("String_Node_Str");
    for (    String string : paraStr) {
      String[] nv=string.split("String_Node_Str");
      for (      Parameter para : parms) {
        if (para.getName().equals(nv[0].trim())) {
          para.setValue(nv[1]);
          break;
        }
      }
    }
    columnExt.setFunction(function2);
    columnExt.setPreview(preview.getNodeValue());
  }
 else {
    Function function2=new FunctionManagerExt().getDefaultFunction(columnExt,columnExt.getTalendType());
    columnExt.setFunction(function2);
    columnExt.setPreview("String_Node_Str");
  }
  return columnExt;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") protected IMetadataColumn initializeOneColumn(final IMetadataColumn metadataColumn,final NamedNodeMap nodeMap){
  IMetadataColumn column=super.initializeOneColumn(metadataColumn,nodeMap);
  MetadataColumnExt columnExt=new MetadataColumnExt((MetadataColumn)column);
  Node function=nodeMap.getNamedItem("String_Node_Str");
  if (function != null) {
    Node parameter=nodeMap.getNamedItem("String_Node_Str");
    Node preview=nodeMap.getNamedItem("String_Node_Str");
    Function function2=new FunctionManagerExt().getCurrentFunction(function.getNodeValue(),columnExt);
    List<Parameter> parms=function2.getParameters();
    String[] paraStr=parameter.getNodeValue().split("String_Node_Str");
    for (    String string : paraStr) {
      String[] nv=string.split("String_Node_Str");
      for (      Parameter para : parms) {
        if (para.getName().equals(nv[0].trim())) {
          para.setValue(nv[1]);
          break;
        }
      }
    }
    columnExt.setFunction(function2);
    columnExt.setPreview(preview.getNodeValue());
  }
 else {
    Function function2=new FunctionManagerExt().getDefaultFunction(columnExt,columnExt.getTalendType());
    columnExt.setFunction(function2);
    columnExt.setPreview("String_Node_Str");
  }
  return columnExt;
}
Program: 122786
Project: 122786
Buggy source:
public void run(){
  Shell shell=null;
  final IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (activeWorkbenchWindow != null) {
    shell=activeWorkbenchWindow.getShell();
  }
 else {
    if (tmpDis != null) {
      shell=tmpDis.getActiveShell();
    }
 else {
      shell=new Shell();
    }
  }
  MessageDialog.openWarning(shell,"String_Node_Str",tmpMess);
}

Fixed version (ground truth):
@Override public void run(){
  Shell shell=null;
  final IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (activeWorkbenchWindow != null) {
    shell=activeWorkbenchWindow.getShell();
  }
 else {
    if (tmpDis != null) {
      shell=tmpDis.getActiveShell();
    }
 else {
      shell=new Shell();
    }
  }
  MessageDialog.openWarning(shell,"String_Node_Str",tmpMess);
}
Program: 122787
Project: 122787
Buggy source:
private void checkUnLoadedNodeForProcess(JobEditorInput fileEditorInput){
  if (fileEditorInput == null || fileEditorInput.getLoadedProcess() == null) {
    return;
  }
  IProcess2 loadedProcess=fileEditorInput.getLoadedProcess();
  List<NodeType> unloadedNode=loadedProcess.getUnloadedNode();
  if (unloadedNode != null && !unloadedNode.isEmpty()) {
    String message="String_Node_Str";
    for (int i=0; i < unloadedNode.size(); i++) {
      message=message + unloadedNode.get(i).getComponentName() + "String_Node_Str";
    }
    if (!CommonsPlugin.isHeadless() && PlatformUI.isWorkbenchRunning()) {
      Display display=Display.getCurrent();
      if (display == null) {
        display=Display.getDefault();
      }
      if (display != null) {
        final Display tmpDis=display;
        final String tmpMess=message;
        display.syncExec(new Runnable(){
          public void run(){
            Shell shell=null;
            final IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            if (activeWorkbenchWindow != null) {
              shell=activeWorkbenchWindow.getShell();
            }
 else {
              if (tmpDis != null) {
                shell=tmpDis.getActiveShell();
              }
 else {
                shell=new Shell();
              }
            }
            MessageDialog.openWarning(shell,"String_Node_Str",tmpMess);
          }
        }
);
      }
    }
  }
}

Fixed version (ground truth):
private void checkUnLoadedNodeForProcess(JobEditorInput fileEditorInput){
  if (fileEditorInput == null || fileEditorInput.getLoadedProcess() == null) {
    return;
  }
  IProcess2 loadedProcess=fileEditorInput.getLoadedProcess();
  List<NodeType> unloadedNode=loadedProcess.getUnloadedNode();
  if (unloadedNode != null && !unloadedNode.isEmpty()) {
    String message="String_Node_Str";
    for (int i=0; i < unloadedNode.size(); i++) {
      message=message + unloadedNode.get(i).getComponentName() + "String_Node_Str";
    }
    if (!CommonsPlugin.isHeadless() && PlatformUI.isWorkbenchRunning()) {
      Display display=Display.getCurrent();
      if (display == null) {
        display=Display.getDefault();
      }
      if (display != null) {
        final Display tmpDis=display;
        final String tmpMess=message;
        display.syncExec(new Runnable(){
          @Override public void run(){
            Shell shell=null;
            final IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            if (activeWorkbenchWindow != null) {
              shell=activeWorkbenchWindow.getShell();
            }
 else {
              if (tmpDis != null) {
                shell=tmpDis.getActiveShell();
              }
 else {
                shell=new Shell();
              }
            }
            MessageDialog.openWarning(shell,"String_Node_Str",tmpMess);
          }
        }
);
      }
    }
  }
}
Program: 122788
Project: 122788
Buggy source:
protected IEditorPart getCorrespondingEditor(RepositoryNode node){
  IEditorReference[] eidtors=getActivePage().getEditorReferences();
  for (int i=0; i < eidtors.length; i++) {
    try {
      IEditorInput input=eidtors[i].getEditorInput();
      if (!(input instanceof JobEditorInput)) {
        continue;
      }
      JobEditorInput repositoryInput=(JobEditorInput)input;
      checkUnLoadedNodeForProcess(repositoryInput);
      if (repositoryInput.getItem().equals(node.getObject().getProperty().getItem())) {
        IPath path=repositoryInput.getFile().getLocation();
        return eidtors[i].getEditor(false);
      }
    }
 catch (    PartInitException e) {
      continue;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected IEditorPart getCorrespondingEditor(RepositoryNode node){
  IEditorReference[] eidtors=getActivePage().getEditorReferences();
  for (  IEditorReference eidtor : eidtors) {
    try {
      IEditorInput input=eidtor.getEditorInput();
      if (!(input instanceof JobEditorInput)) {
        continue;
      }
      JobEditorInput repositoryInput=(JobEditorInput)input;
      checkUnLoadedNodeForProcess(repositoryInput);
      if (repositoryInput.getItem().equals(node.getObject().getProperty().getItem())) {
        IPath path=repositoryInput.getFile().getLocation();
        return eidtor.getEditor(false);
      }
    }
 catch (    PartInitException e) {
      continue;
    }
  }
  return null;
}
Program: 122789
Project: 122789
Buggy source:
protected boolean refreshNewJob(){
  if (alreadyEditedByUser) {
    return false;
  }
  IProxyRepositoryFactory repositoryFactory=CorePlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
  try {
    repositoryFactory.save(getProperty(),this.originaleObjectLabel,this.originalVersion);
    ExpressionPersistance.getInstance().jobNameChanged(originaleObjectLabel,processObject.getLabel());
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    return true;
  }
 catch (  PersistenceException e) {
    MessageBoxExceptionHandler.process(e);
    return false;
  }
}

Fixed version (ground truth):
protected boolean refreshNewJob(){
  if (alreadyEditedByUser) {
    return false;
  }
  StructuredSelection selection=(StructuredSelection)mainPage.getSelection();
  if (!selection.isEmpty()) {
    RepositoryNode node=(RepositoryNode)selection.getFirstElement();
    boolean lastVersion=node.getObject().getVersion().equals(originalVersion);
    if (!lastVersion) {
      originalVersion=node.getObject().getVersion();
      String newVersion=processObject.getVersion();
      processObject=node.getObject();
      processObject.getProperty().setVersion(newVersion);
    }
  }
  IProxyRepositoryFactory repositoryFactory=CorePlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
  try {
    repositoryFactory.save(getProperty(),this.originaleObjectLabel,this.originalVersion);
    ExpressionPersistance.getInstance().jobNameChanged(originaleObjectLabel,processObject.getLabel());
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    return true;
  }
 catch (  PersistenceException e) {
    MessageBoxExceptionHandler.process(e);
    return false;
  }
}
Program: 122795
Project: 122795
Buggy source:
@Override protected RemovePushButton createRemovePushButton(){
  return new RemovePushButtonForExtendedTable(this.toolbar,getExtendedTableViewer()){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
  }
;
}

Fixed version (ground truth):
@Override protected RemovePushButton createRemovePushButton(){
  RemovePushButtonForExtendedTable removePushButton=new RemovePushButtonForExtendedTable(this.toolbar,getExtendedTableViewer()){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
  }
;
  removePushButton.addListener(getPropertyChangeListener(),false);
  return removePushButton;
}
Program: 122796
Project: 122796
Buggy source:
@Override public PastePushButton createPastePushButton(){
  return new PastePushButtonForExtendedTable(toolbar,extendedTableViewer){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
    @Override protected Command getCommandToExecute(    ExtendedTableModel extendedTableModel,    Integer indexWhereInsert){
      return new PropertyTablePasteCommand<Map<String,Object>>(extendedTableModel,indexWhereInsert);
    }
  }
;
}

Fixed version (ground truth):
@Override public PastePushButton createPastePushButton(){
  PastePushButton pastePushButton=new PastePushButtonForExtendedTable(toolbar,extendedTableViewer){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
    @Override protected Command getCommandToExecute(    ExtendedTableModel extendedTableModel,    Integer indexWhereInsert){
      return new PropertyTablePasteCommand<Map<String,Object>>(extendedTableModel,indexWhereInsert);
    }
  }
;
  pastePushButton.addListener(getPropertyChangeListener(),false);
  return pastePushButton;
}
Program: 122802
Project: 122802
Buggy source:
@Override protected RemovePushButton createRemovePushButton(){
  return new RemovePushButtonForExtendedTable(this.toolbar,getExtendedTableViewer()){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
  }
;
}

Fixed version (ground truth):
@Override protected RemovePushButton createRemovePushButton(){
  RemovePushButtonForExtendedTable removePushButton=new RemovePushButtonForExtendedTable(this.toolbar,getExtendedTableViewer()){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
  }
;
  removePushButton.addListener(getPropertyChangeListener(),false);
  return removePushButton;
}
Program: 122803
Project: 122803
Buggy source:
@Override public PastePushButton createPastePushButton(){
  return new PastePushButtonForExtendedTable(toolbar,extendedTableViewer){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
    @Override protected Command getCommandToExecute(    ExtendedTableModel extendedTableModel,    Integer indexWhereInsert){
      return new PropertyTablePasteCommand<Map<String,Object>>(extendedTableModel,indexWhereInsert);
    }
  }
;
}

Fixed version (ground truth):
@Override public PastePushButton createPastePushButton(){
  PastePushButton pastePushButton=new PastePushButtonForExtendedTable(toolbar,extendedTableViewer){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
    @Override protected Command getCommandToExecute(    ExtendedTableModel extendedTableModel,    Integer indexWhereInsert){
      return new PropertyTablePasteCommand<Map<String,Object>>(extendedTableModel,indexWhereInsert);
    }
  }
;
  pastePushButton.addListener(getPropertyChangeListener(),false);
  return pastePushButton;
}
Program: 122806
Project: 122806
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: 122807
Project: 122807
Buggy source:
public Function getCurrentFunction(String funName,MetadataColumnExt bean){
  Function currentFun=new Function();
  List<Function> functions=getFunctionByName(bean.getTalendType());
  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 {
    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;
      }
      if (funName.equals(functions.get(i).getName())) {
        currentFun=functions.get(i);
      }
    }
    Arrays.sort(arrayTalendFunctions2,new Comparator<String>(){
      public int compare(      String n1,      String n2){
        return n1.compareTo(n2);
      }
    }
);
    bean.setArrayFunctions(arrayTalendFunctions2);
  }
  return currentFun;
}

Fixed version (ground truth):
public Function getCurrentFunction(String funLabel,MetadataColumnExt bean){
  Function currentFun=null;
  List<Function> functions=getFunctionsByType(bean.getTalendType());
  String[] arrayTalendFunctions2=new String[functions.size()];
  if (functions.isEmpty()) {
    currentFun=new Function();
    currentFun.setDescription("String_Node_Str");
    currentFun.setPreview("String_Node_Str");
    currentFun.setParameters(new ArrayList<Parameter>());
    bean.setArrayFunctions(arrayTalendFunctions2);
  }
 else {
    currentFun=getFunnctionByLabel(functions,funLabel);
    bean.setArrayFunctions(getFunctionArrays(functions));
  }
  return currentFun;
}
Program: 122808
Project: 122808
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):
private Function getDefaultFunction(List<Function> functions){
  Function currentFun=null;
  for (  Function fun : functions) {
    if (fun.getName().equals(DEFAULT_SELECTED_METHOD)) {
      currentFun=(Function)fun.clone();
      break;
    }
  }
  if (currentFun == null && !functions.isEmpty()) {
    currentFun=(Function)functions.get(0).clone();
  }
  return currentFun;
}
Program: 122809
Project: 122809
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(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;
}

Fixed version (ground truth):
public Function getFuntionFromArray(MetadataColumnExt bean,RowGeneratorComponent externalNode,int index){
  String value=externalNode.getColumnValue(bean,index);
  List<Function> functions=getFunctionsByType(bean.getTalendType());
  Function currentFun=getAvailableFunFromValue(bean,value,functions);
  if (currentFun == null) {
    currentFun=getDefaultFunction(functions);
  }
  return currentFun;
}
Program: 122810
Project: 122810
Buggy source:
/** 
 * qzhang Comment method "convert".
 * @param outputMetaTable2
 * @return TODO
 */
public void convert(RowGeneratorComponent externalNode,IMetadataTable outputMetaTable2,FunctionManagerExt functionManager){
  List<IMetadataColumn> exts=new ArrayList<IMetadataColumn>();
  for (int j=0; j < outputMetaTable2.getListColumns().size(); j++) {
    IMetadataColumn column=outputMetaTable2.getListColumns().get(j);
    if (column instanceof MetadataColumnExt) {
      exts.add(column.clone());
    }
 else     if (column instanceof MetadataColumn) {
      MetadataColumnExt ext=new MetadataColumnExt((MetadataColumn)column);
      List<Function> funs=functionManager.getFunctionByName(ext.getTalendType());
      String[] arrayTalendFunctions2=new String[funs.size()];
      List<String> list=new ArrayList<String>();
      for (int i=0; i < funs.size(); i++) {
        String name=funs.get(i).getName();
        if (list.contains(name)) {
          int indexOf=list.indexOf(name);
          arrayTalendFunctions2[indexOf]=funs.get(indexOf).getClassName() + "String_Node_Str" + name;
          String className=funs.get(i).getClassName();
          arrayTalendFunctions2[i]=className + "String_Node_Str" + name;
        }
 else {
          arrayTalendFunctions2[i]=name;
          list.add(name);
        }
      }
      ext.setArrayFunctions(arrayTalendFunctions2);
      if (!funs.isEmpty()) {
        ext.setFunction(functionManager.getFuntionFromArray(ext,externalNode,j));
      }
      exts.add(ext);
    }
  }
  outputMetaTable2.setListColumns(exts);
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "convert".
 * @param outputMetaTable2
 * @return TODO
 */
public void convert(RowGeneratorComponent externalNode,IMetadataTable outputMetaTable2,FunctionManagerExt functionManager){
  List<IMetadataColumn> exts=new ArrayList<IMetadataColumn>();
  for (int j=0; j < outputMetaTable2.getListColumns().size(); j++) {
    IMetadataColumn column=outputMetaTable2.getListColumns().get(j);
    if (column instanceof MetadataColumnExt) {
      exts.add(column.clone());
    }
 else     if (column instanceof MetadataColumn) {
      MetadataColumnExt ext=new MetadataColumnExt((MetadataColumn)column);
      List<Function> funs=functionManager.getFunctionsByType(ext.getTalendType());
      ext.setArrayFunctions(functionManager.getFunctionArrays(funs));
      if (!funs.isEmpty()) {
        ext.setFunction(functionManager.getFuntionFromArray(ext,externalNode,j));
      }
      exts.add(ext);
    }
  }
  outputMetaTable2.setListColumns(exts);
}
Program: 122811
Project: 122811
Buggy source:
protected void saveOneColumn(Document document,IMetadataColumn metadataColumn,Element column){
  super.saveOneColumn(document,metadataColumn,column);
  if (metadataColumn instanceof MetadataColumnExt) {
    MetadataColumnExt columnExt=(MetadataColumnExt)metadataColumn;
    Attr function=document.createAttribute("String_Node_Str");
    function.setNodeValue(columnExt.getFunction().getName());
    column.setAttributeNode(function);
    Attr parameter=document.createAttribute("String_Node_Str");
    parameter.setNodeValue(columnExt.getParameter());
    column.setAttributeNode(parameter);
    Attr preview=document.createAttribute("String_Node_Str");
    preview.setNodeValue(columnExt.getPreview());
    column.setAttributeNode(preview);
  }
}

Fixed version (ground truth):
protected void saveOneColumn(Document document,IMetadataColumn metadataColumn,Element column){
  super.saveOneColumn(document,metadataColumn,column);
  if (metadataColumn instanceof MetadataColumnExt) {
    MetadataColumnExt columnExt=(MetadataColumnExt)metadataColumn;
    Attr function=document.createAttribute("String_Node_Str");
    function.setNodeValue(funManager.getFunctionLable(columnExt.getFunction()));
    column.setAttributeNode(function);
    Attr parameter=document.createAttribute("String_Node_Str");
    parameter.setNodeValue(columnExt.getParameter());
    column.setAttributeNode(parameter);
    Attr preview=document.createAttribute("String_Node_Str");
    preview.setNodeValue(columnExt.getPreview());
    column.setAttributeNode(preview);
  }
}
Program: 122812
Project: 122812
Buggy source:
protected IBeanPropertyAccessors<MetadataColumnExt,String> getFunctionAccessor(final ComboBoxCellEditor functComboBox){
  return new IBeanPropertyAccessors<MetadataColumnExt,String>(){
    public String get(    MetadataColumnExt bean){
      if (bean.getFunction() != null) {
        if (getTable() != null) {
          generatorUI.updateFunParameter(getTable());
        }
        String[] arrayFunctions=bean.getArrayFunctions();
        functComboBox.setItems(arrayFunctions);
        String name=bean.getFunction().getName();
        List<String> asList=Arrays.asList(arrayFunctions);
        if (asList != null && !asList.contains(name)) {
          return bean.getFunction().getClassName() + "String_Node_Str" + name;
        }
        return name;
      }
      return "String_Node_Str";
    }
    public void set(    MetadataColumnExt bean,    String value){
      bean.setFunction(MetadataTableEditorViewExt.this.getFunnctionByName(bean.getTalendType(),value));
      bean.setChanged(true);
    }
  }
;
}

Fixed version (ground truth):
protected IBeanPropertyAccessors<MetadataColumnExt,String> getFunctionAccessor(final ComboBoxCellEditor functComboBox){
  return new IBeanPropertyAccessors<MetadataColumnExt,String>(){
    @Override public String get(    MetadataColumnExt bean){
      if (bean.getFunction() != null) {
        if (getTable() != null) {
          generatorUI.updateFunParameter(getTable());
        }
        String[] arrayFunctions=bean.getArrayFunctions();
        functComboBox.setItems(arrayFunctions);
        return FunctionManagerExt.getFunctionLable(bean.getFunction());
      }
      return "String_Node_Str";
    }
    @Override public void set(    MetadataColumnExt bean,    String value){
      bean.setFunction(functionManager.getCurrentFunction(value,bean));
      bean.setChanged(true);
    }
  }
;
}
Program: 122813
Project: 122813
Buggy source:
private Function getFunnctionByName(String talendType,String value){
  Function func=null;
  for (  Function fun : functionManager.getFunctionByName(talendType)) {
    String name=fun.getName();
    if (value.contains(name)) {
      if (name.equals(value)) {
        func=(Function)fun.clone();
        break;
      }
 else {
        if (value.contains(fun.getClassName())) {
          func=(Function)fun.clone();
          break;
        }
      }
    }
  }
  return func;
}

Fixed version (ground truth):
private Function getFunnctionByName(String talendType,String value){
  Function func=null;
  for (  Function fun : functionManager.getFunctionsByType(talendType)) {
    String name=fun.getName();
    if (value.contains(name)) {
      if (name.equals(value)) {
        func=(Function)fun.clone();
        break;
      }
 else {
        if (value.contains(fun.getClassName())) {
          func=(Function)fun.clone();
          break;
        }
      }
    }
  }
  return func;
}