nus-yam/ex-repair huggingface dataset:
Program: 122720
Project: 122720
Buggy source:
/** 
 * @see org.eclipse.jface.wizard.Wizard#performFinish()
 */
@SuppressWarnings("String_Node_Str") @Override public boolean performFinish(){
  try {
    property.setId(repositoryFactory.getNextId());
    property.setLabel(property.getDisplayName());
    ProcessType process=TalendFileFactory.eINSTANCE.createProcessType();
    ParametersType parameterType=TalendFileFactory.eINSTANCE.createParametersType();
    List<RoutinesParameterType> dependenciesInPreference=RoutinesUtil.createDependenciesInPreference();
    parameterType.getRoutinesParameter().addAll(dependenciesInPreference);
    process.setParameters(parameterType);
    processItem.setProcess(process);
    RepositoryWorkUnit<Object> workUnit=new RepositoryWorkUnit<Object>(this.getWindowTitle(),this){
      @Override protected void run() throws LoginException, PersistenceException {
        repositoryFactory.create(processItem,mainPage.getDestinationPath());
        RelationshipItemBuilder.getInstance().addOrUpdateItem(processItem);
      }
    }
;
    workUnit.setAvoidUnloadResources(true);
    repositoryFactory.executeRepositoryWorkUnit(workUnit);
  }
 catch (  PersistenceException e) {
    MessageDialog.openError(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
    ExceptionHandler.process(e);
  }
  return processItem != null;
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.jface.wizard.Wizard#performFinish()
 */
@SuppressWarnings("String_Node_Str") @Override public boolean performFinish(){
  try {
    property.setId(repositoryFactory.getNextId());
    property.setLabel(property.getDisplayName());
    ProcessType process=TalendFileFactory.eINSTANCE.createProcessType();
    ParametersType parameterType=TalendFileFactory.eINSTANCE.createParametersType();
    List<RoutinesParameterType> dependenciesInPreference=RoutinesUtil.createDependenciesInPreference();
    parameterType.getRoutinesParameter().addAll(dependenciesInPreference);
    process.setParameters(parameterType);
    processItem.setProcess(process);
    RepositoryWorkUnit<Object> workUnit=new RepositoryWorkUnit<Object>(this.getWindowTitle(),this){
      @Override protected void run() throws LoginException, PersistenceException {
        repositoryFactory.create(processItem,mainPage.getDestinationPath());
      }
    }
;
    workUnit.setAvoidUnloadResources(true);
    repositoryFactory.executeRepositoryWorkUnit(workUnit);
  }
 catch (  PersistenceException e) {
    MessageDialog.openError(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
    ExceptionHandler.process(e);
  }
  return processItem != null;
}
Program: 122721
Project: 122721
Buggy source:
@Override public void run(){
  MessageDialog.openError(Display.getCurrent().getActiveShell(),"String_Node_Str",Message);
}

Fixed version (ground truth):
@Override public void run(){
  MessageDialog.openError(Display.getDefault().getActiveShell(),"String_Node_Str",Message);
}
Program: 122723
Project: 122723
Buggy source:
/** 
 * wzhang Comment method "sortOrder".
 * @param treeNode
 * @param node
 */
public void sortOrder(FOXTreeNode treeNode,FOXTreeNode node){
  if (node != null) {
    List<FOXTreeNode> children=node.getChildren();
    if (treeNode != null) {
      int tmpOrder=0;
      int attrNsCount=0;
      for (      FOXTreeNode child : children) {
        if (child.getOrder() < treeNode.getOrder()) {
          tmpOrder++;
        }
        if (child instanceof Attribute || child instanceof NameSpaceNode) {
          attrNsCount++;
        }
      }
      if (tmpOrder > -1) {
        int oldOrder=children.indexOf(treeNode);
        if (oldOrder != -1 && oldOrder != tmpOrder) {
          node.removeChild(treeNode);
          if (children.size() > tmpOrder) {
            node.addChild(tmpOrder - attrNsCount,treeNode);
          }
 else {
            node.addChild(treeNode);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * wzhang Comment method "sortOrder".
 * @param treeNode
 * @param node
 */
public void sortOrder(FOXTreeNode treeNode,FOXTreeNode node){
  if (node != null) {
    List<FOXTreeNode> children=node.getChildren();
    if (treeNode != null) {
      int tmpOrder=0;
      int attrNsCount=0;
      for (      FOXTreeNode child : children) {
        if (child.getOrder() < treeNode.getOrder()) {
          tmpOrder++;
        }
        if (child.isAttribute() || child.isNameSpace()) {
          attrNsCount++;
        }
      }
      if (tmpOrder > -1) {
        int oldOrder=children.indexOf(treeNode);
        if (oldOrder != -1 && oldOrder != tmpOrder) {
          node.removeChild(treeNode);
          if (children.size() > tmpOrder) {
            node.addChild(tmpOrder - attrNsCount,treeNode);
          }
 else {
            node.addChild(treeNode);
          }
        }
      }
    }
  }
}
Program: 122725
Project: 122725
Buggy source:
public void initNodeOrder(FOXTreeNode node){
  if (node == null) {
    return;
  }
  FOXTreeNode parent=node.getParent();
  if (parent == null) {
    node.setOrder(1);
    String path=TreeUtil.getPath(node);
    Map<String,Integer> xpathMap=orderMap.get(node.getRow());
    if (xpathMap == null) {
      xpathMap=new HashMap<String,Integer>();
      orderMap.put(node.getRow(),xpathMap);
    }
    xpathMap.put(path,order);
    order++;
  }
  List<FOXTreeNode> childNode=node.getChildren();
  for (  FOXTreeNode child : childNode) {
    child.setOrder(order);
    String path=TreeUtil.getPath(child);
    Map<String,Integer> xpathMap=orderMap.get(child.getRow());
    if (xpathMap == null) {
      xpathMap=new HashMap<String,Integer>();
      orderMap.put(child.getRow(),xpathMap);
    }
    xpathMap.put(path,order);
    order++;
    if (child.getChildren().size() > 0) {
      initNodeOrder(child);
    }
  }
}

Fixed version (ground truth):
@Override public void initNodeOrder(FOXTreeNode node){
  if (node == null) {
    return;
  }
  FOXTreeNode parent=node.getParent();
  if (parent == null) {
    node.setOrder(1);
    String path=TreeUtil.getPath(node);
    Map<String,Integer> xpathMap=orderMap.get(node.getRow());
    if (xpathMap == null) {
      xpathMap=new HashMap<String,Integer>();
      orderMap.put(node.getRow(),xpathMap);
    }
    xpathMap.put(path,order);
    order++;
  }
  List<FOXTreeNode> childNode=node.getChildren();
  for (  FOXTreeNode child : childNode) {
    child.setOrder(order);
    String path=TreeUtil.getPath(child);
    Map<String,Integer> xpathMap=orderMap.get(child.getRow());
    if (xpathMap == null) {
      xpathMap=new HashMap<String,Integer>();
      orderMap.put(child.getRow(),xpathMap);
    }
    xpathMap.put(path,order);
    order++;
    if (child.getChildren().size() > 0) {
      initNodeOrder(child);
    }
  }
}
Program: 122726
Project: 122726
Buggy source:
public int getNodeOrder(FOXTreeNode node){
  if (node != null) {
    String path=TreeUtil.getPath(node);
    Map<String,Integer> xpathMap=orderMap.get(node.getRow());
    if (xpathMap != null) {
      return xpathMap.get(path);
    }
    return 0;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int getNodeOrder(FOXTreeNode node){
  if (node != null) {
    String path=TreeUtil.getPath(node);
    Map<String,Integer> xpathMap=orderMap.get(node.getRow());
    if (xpathMap != null) {
      return xpathMap.get(path);
    }
    return 0;
  }
  return 0;
}
Program: 122728
Project: 122728
Buggy source:
/** 
 * DOC bqian Comment method "removeProblemsByProcessId".
 * @param id
 */
public static void removeProblemsByProcess(IProcess process){
  for (Iterator<Problem> iter=problemList.getProblemList().iterator(); iter.hasNext(); ) {
    Problem problem=iter.next();
    if (problem == null || problem instanceof TalendProblem)     continue;
    if (problem.getJobInfo() != null && (problem.getJobInfo().getJobId().equals(process.getId()) && problem.getJobInfo().getJobVersion().equals(process.getVersion()))) {
      iter.remove();
    }
  }
  refreshProblemTreeView();
}

Fixed version (ground truth):
/** 
 * DOC hcyi Comment method "removeProblemsByProcess".
 * @param process
 * @param isDeleted
 */
public static void removeProblemsByProcess(IProcess process,boolean isDeleted){
  for (Iterator<Problem> iter=problemList.getProblemList().iterator(); iter.hasNext(); ) {
    Problem problem=iter.next();
    if (problem == null)     continue;
    if (problem.getJobInfo() != null && (problem.getJobInfo().getJobId().equals(process.getId()) && problem.getJobInfo().getJobVersion().equals(process.getVersion()))) {
      iter.remove();
    }
    if (problem.getJobInfo() == null && problem instanceof TalendProblem) {
      TalendProblem talendProblem=(TalendProblem)problem;
      String jobName=talendProblem.getJavaUnitName();
      if (jobName != null && jobName.equals(process.getName()) && talendProblem.getVersion().equals(process.getVersion())) {
        iter.remove();
      }
    }
  }
  refreshProblemTreeView();
}
Program: 122729
Project: 122729
Buggy source:
/** 
 * DOC chuang Comment method "createTreeInput".
 * @param errors
 * @param jobNames
 * @return
 */
public List<JobErrorEntry> createTreeInput(List<Problem> errors,Set<String> jobIds){
  for (  Problem error : errors) {
    if (error instanceof TalendProblem) {
      TalendProblem talendProblem=(TalendProblem)error;
      String jobId=talendProblem.getJobInfo().getJobId();
      if (!jobIds.contains(jobId)) {
        continue;
      }
      String componentName=GENERAL_ERROR;
      JobErrorEntry jobEntry=getJobEntry(talendProblem.getJavaUnitName());
      jobEntry.addItem(componentName,talendProblem);
    }
 else {
      String jobId=error.getJobInfo().getJobId();
      if (!jobIds.contains(jobId)) {
        continue;
      }
      String componentName=error.getNodeName();
      JobErrorEntry jobEntry=getJobEntry(error.getJobInfo().getJobName());
      jobEntry.addItem(componentName,error);
    }
  }
  return new ArrayList<JobErrorEntry>(jobs.values());
}

Fixed version (ground truth):
/** 
 * DOC chuang Comment method "createTreeInput".
 * @param errors
 * @param jobNames
 * @return
 */
public List<JobErrorEntry> createTreeInput(List<Problem> errors,Set<String> jobIds){
  for (  Problem error : errors) {
    if (error instanceof TalendProblem) {
      TalendProblem talendProblem=(TalendProblem)error;
      if (talendProblem != null && talendProblem.getJobInfo() != null) {
        String jobId=talendProblem.getJobInfo().getJobId();
        if (!jobIds.contains(jobId)) {
          continue;
        }
        String componentName=GENERAL_ERROR;
        JobErrorEntry jobEntry=getJobEntry(talendProblem.getJavaUnitName());
        jobEntry.addItem(componentName,talendProblem);
      }
    }
 else {
      if (error != null && error.getJobInfo() != null) {
        String jobId=error.getJobInfo().getJobId();
        if (!jobIds.contains(jobId)) {
          continue;
        }
        String componentName=error.getNodeName();
        JobErrorEntry jobEntry=getJobEntry(error.getJobInfo().getJobName());
        jobEntry.addItem(componentName,error);
      }
    }
  }
  return new ArrayList<JobErrorEntry>(jobs.values());
}
Program: 122730
Project: 122730
Buggy source:
/** 
 * DOC chuang Comment method "createTreeInput".
 * @param errors
 * @param jobNames
 * @return
 */
public List<JobErrorEntry> createTreeInput(List<Problem> errors,Set<String> jobNames){
  for (  Problem error : errors) {
    if (error instanceof TalendProblem) {
      TalendProblem talendProblem=(TalendProblem)error;
      String job=talendProblem.getJavaUnitName();
      if (!jobNames.contains(job)) {
        continue;
      }
      String componentName=GENERAL_ERROR;
      JobErrorEntry jobEntry=getJobEntry(job);
      jobEntry.addItem(componentName,talendProblem);
    }
 else {
      String job=error.getJobInfo().getJobName();
      if (!jobNames.contains(job)) {
        continue;
      }
      String componentName=error.getNodeName();
      JobErrorEntry jobEntry=getJobEntry(job);
      jobEntry.addItem(componentName,error);
    }
  }
  return new ArrayList<JobErrorEntry>(jobs.values());
}

Fixed version (ground truth):
/** 
 * DOC chuang Comment method "createTreeInput".
 * @param errors
 * @param jobNames
 * @return
 */
public List<JobErrorEntry> createTreeInput(List<Problem> errors,Set<String> jobIds){
  for (  Problem error : errors) {
    if (error instanceof TalendProblem) {
      TalendProblem talendProblem=(TalendProblem)error;
      String jobId=talendProblem.getJobInfo().getJobId();
      if (!jobIds.contains(jobId)) {
        continue;
      }
      String componentName=GENERAL_ERROR;
      JobErrorEntry jobEntry=getJobEntry(talendProblem.getJavaUnitName());
      jobEntry.addItem(componentName,talendProblem);
    }
 else {
      String jobId=error.getJobInfo().getJobId();
      if (!jobIds.contains(jobId)) {
        continue;
      }
      String componentName=error.getNodeName();
      JobErrorEntry jobEntry=getJobEntry(error.getJobInfo().getJobName());
      jobEntry.addItem(componentName,error);
    }
  }
  return new ArrayList<JobErrorEntry>(jobs.values());
}
Program: 122731
Project: 122731
Buggy source:
public static boolean hasErrors(Shell shell){
  try {
    boolean isPerl=false;
    if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.PERL)) {
      isPerl=true;
    }
    ITalendSynchronizer synchronizer=CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
    Set<String> jobNames=new HashSet<String>();
    for (    JobInfo jobInfo : LastGenerationInfo.getInstance().getLastGeneratedjobs()) {
      IFile sourceFile=synchronizer.getProcessFile(jobInfo);
      if (isPerl) {
        validatePerlScript(sourceFile);
      }
      jobNames.add(jobInfo.getJobName());
      Problems.addRoutineFile(sourceFile,ProblemType.JOB,jobInfo.getJobName(),jobInfo.getJobVersion(),true);
    }
    Problems.refreshProblemTreeView();
    List<Problem> errors=Problems.getProblemList().getProblemsBySeverity(ProblemStatus.ERROR);
    ErrorDetailTreeBuilder builder=new ErrorDetailTreeBuilder();
    List<JobErrorEntry> input=builder.createTreeInput(errors,jobNames);
    if (input.size() > 0) {
      ErrorDetailDialog dialog=new ErrorDetailDialog(shell,input);
      if (dialog.open() != IDialogConstants.OK_ID) {
        return true;
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return false;
}

Fixed version (ground truth):
public static boolean hasErrors(Shell shell){
  try {
    boolean isPerl=false;
    if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.PERL)) {
      isPerl=true;
    }
    ITalendSynchronizer synchronizer=CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
    Set<String> jobIds=new HashSet<String>();
    for (    JobInfo jobInfo : LastGenerationInfo.getInstance().getLastGeneratedjobs()) {
      IFile sourceFile=synchronizer.getProcessFile(jobInfo);
      if (isPerl) {
        validatePerlScript(sourceFile);
      }
      jobIds.add(jobInfo.getJobId());
      Problems.addRoutineFile(sourceFile,ProblemType.JOB,jobInfo.getJobName(),jobInfo.getJobVersion(),true);
    }
    Problems.refreshProblemTreeView();
    List<Problem> errors=Problems.getProblemList().getProblemsBySeverity(ProblemStatus.ERROR);
    ErrorDetailTreeBuilder builder=new ErrorDetailTreeBuilder();
    List<JobErrorEntry> input=builder.createTreeInput(errors,jobIds);
    if (input.size() > 0) {
      ErrorDetailDialog dialog=new ErrorDetailDialog(shell,input);
      if (dialog.open() != IDialogConstants.OK_ID) {
        return true;
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return false;
}
Program: 122733
Project: 122733
Buggy source:
public boolean isNoLoopInComponent(){
  List<Map<String,String>> loopTable=(List<Map<String,String>>)foxComponent.getTableList(FileOutputXMLComponent.LOOP);
  if (currentSchema == null)   return loopTable.size() <= 0;
  List<Map<String,String>> newList=new ArrayList<Map<String,String>>();
  for (  Map<String,String> loopMap : loopTable) {
    String columnName=loopMap.get(FileOutputXMLComponent.COLUMN);
    if (columnName == null || columnName.length() == 0 || !columnName.startsWith(currentSchema)) {
      continue;
    }
    newList.add(loopMap);
  }
  return newList.size() <= 0;
}

Fixed version (ground truth):
public boolean isNoLoopInComponent(){
  List<Map<String,String>> loopTable=foxComponent.getTableList(FileOutputXMLComponent.LOOP);
  if (currentSchema == null) {
    return loopTable.size() <= 0;
  }
  List<Map<String,String>> newList=new ArrayList<Map<String,String>>();
  for (  Map<String,String> loopMap : loopTable) {
    String columnName=loopMap.get(FileOutputXMLComponent.COLUMN);
    if (columnName == null || columnName.length() == 0 || !columnName.startsWith(currentSchema)) {
      continue;
    }
    newList.add(loopMap);
  }
  return newList.size() <= 0;
}
Program: 122734
Project: 122734
Buggy source:
/** 
 * wzhang Comment method "sortOrder".
 * @param treeNode
 * @param node
 */
public void sortOrder(FOXTreeNode treeNode,FOXTreeNode node){
  if (node != null) {
    List<FOXTreeNode> children=node.getChildren();
    if (treeNode != null) {
      int tmpOrder=0;
      int attrNsCount=0;
      for (      FOXTreeNode child : children) {
        if (child.getOrder() < treeNode.getOrder()) {
          tmpOrder++;
        }
        if (child.isAttribute() || child.isNameSpace()) {
          attrNsCount++;
        }
      }
      if (tmpOrder > -1) {
        int oldOrder=children.indexOf(treeNode);
        if (oldOrder != -1 && oldOrder != tmpOrder) {
          node.removeChild(treeNode);
          if (children.size() > tmpOrder) {
            node.addChild(tmpOrder - attrNsCount,treeNode);
          }
 else {
            node.addChild(treeNode);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * wzhang Comment method "sortOrder".
 * @param treeNode
 * @param node
 */
public void sortOrder(FOXTreeNode treeNode,FOXTreeNode node){
  if (node != null) {
    List<FOXTreeNode> children=node.getChildren();
    if (treeNode != null) {
      int tmpOrder=0;
      int attrNsCount=0;
      for (      FOXTreeNode child : children) {
        if (child.getOrder() < treeNode.getOrder()) {
          tmpOrder++;
        }
        if (child instanceof Attribute || child instanceof NameSpaceNode) {
          attrNsCount++;
        }
      }
      if (tmpOrder > -1) {
        int oldOrder=children.indexOf(treeNode);
        if (oldOrder != -1 && oldOrder != tmpOrder) {
          node.removeChild(treeNode);
          if (children.size() > tmpOrder) {
            node.addChild(tmpOrder - attrNsCount,treeNode);
          }
 else {
            node.addChild(treeNode);
          }
        }
      }
    }
  }
}
Program: 122735
Project: 122735
Buggy source:
protected FOXTreeNode addElement(FOXTreeNode current,String currentPath,String newPath,String defaultValue){
  String name=newPath.substring(newPath.lastIndexOf("String_Node_Str") + 1);
  String parentPath=newPath.substring(0,newPath.lastIndexOf("String_Node_Str"));
  FOXTreeNode temp=new Element(name,defaultValue);
  if (current == null) {
    return temp;
  }
  if (currentPath.equals(parentPath)) {
    current.addChild(temp);
  }
 else {
    String[] nods=currentPath.split("String_Node_Str");
    String[] newNods=parentPath.split("String_Node_Str");
    int parentLevel=0;
    int checkLength=nods.length < newNods.length ? nods.length : newNods.length;
    for (int i=1; i < checkLength; i++) {
      if (nods[i].equals(newNods[i])) {
        parentLevel=i;
      }
    }
    FOXTreeNode parent=current;
    for (int i=0; i < nods.length - (parentLevel + 1); i++) {
      FOXTreeNode tmpParent=parent.getParent();
      if (tmpParent == null) {
        break;
      }
      parent=tmpParent;
    }
    if (parent != null)     parent.addChild(temp);
  }
  return temp;
}

Fixed version (ground truth):
protected FOXTreeNode addElement(FOXTreeNode current,String currentPath,String newPath,String defaultValue){
  String name=newPath.substring(newPath.lastIndexOf("String_Node_Str") + 1);
  String parentPath=newPath.substring(0,newPath.lastIndexOf("String_Node_Str"));
  FOXTreeNode temp=new Element(name,defaultValue);
  if (current == null) {
    return temp;
  }
  if (currentPath.equals(parentPath)) {
    current.addChild(temp);
  }
 else {
    String[] nods=currentPath.split("String_Node_Str");
    String[] newNods=parentPath.split("String_Node_Str");
    int parentLevel=0;
    int checkLength=nods.length < newNods.length ? nods.length : newNods.length;
    for (int i=1; i < checkLength; i++) {
      if (nods[i].equals(newNods[i])) {
        parentLevel=i;
      }
    }
    FOXTreeNode parent=current;
    for (int i=0; i < nods.length - (parentLevel + 1); i++) {
      FOXTreeNode tmpParent=parent.getParent();
      if (tmpParent == null) {
        break;
      }
      parent=tmpParent;
    }
    if (parent != null) {
      parent.addChild(temp);
    }
  }
  return temp;
}
Program: 122738
Project: 122738
Buggy source:
private List<File> getRoutineDependince(ExportFileResource[] process,boolean system,boolean useBeans){
  List<File> userRoutines=null;
  try {
    String classRoot=getClassRootLocation();
    if (useBeans) {
      userRoutines=getAllFiles(classRoot,USER_BEANS_PATH);
    }
 else {
      userRoutines=getAllFiles(classRoot,USER_ROUTINES_PATH);
    }
    List<IRepositoryViewObject> collectRoutines=collectRoutines(process,system,useBeans);
    Iterator<File> iterator=userRoutines.iterator();
    while (iterator.hasNext()) {
      File file=(File)iterator.next();
      boolean found=false;
      for (      IRepositoryViewObject object : collectRoutines) {
        Item item=object.getProperty().getItem();
        String pattern=item.getProperty().getLabel() + "String_Node_Str";
        if (file.getName().matches(pattern)) {
          found=true;
          break;
        }
      }
      if (!found) {
        iterator.remove();
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return userRoutines;
}

Fixed version (ground truth):
private List<File> getRoutineDependince(ExportFileResource[] process,boolean system,boolean useBeans){
  List<File> userRoutines=null;
  try {
    String classRoot=getClassRootLocation();
    if (useBeans) {
      userRoutines=getAllFiles(classRoot,USER_BEANS_PATH);
    }
 else {
      userRoutines=getAllFiles(classRoot,USER_ROUTINES_PATH);
    }
    List<IRepositoryViewObject> collectRoutines=collectRoutines(process,system,useBeans);
    Iterator<File> iterator=userRoutines.iterator();
    while (iterator.hasNext()) {
      File file=iterator.next();
      boolean found=false;
      for (      IRepositoryViewObject object : collectRoutines) {
        Item item=object.getProperty().getItem();
        String pattern=item.getProperty().getLabel() + "String_Node_Str";
        if (file.getName().matches(pattern)) {
          found=true;
          break;
        }
      }
      if (!found) {
        iterator.remove();
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return userRoutines;
}
Program: 122739
Project: 122739
Buggy source:
public List<String> getJobContextsComboValue(ProcessItem processItem){
  List<String> contextNameList=new ArrayList<String>();
  for (  Object o : ((ProcessTypeImpl)processItem.getProcess()).getContext()) {
    if (o instanceof ContextType) {
      ContextType context=(ContextType)o;
      if (contextNameList.contains(context.getName())) {
        continue;
      }
      contextNameList.add(context.getName());
    }
  }
  return contextNameList;
}

Fixed version (ground truth):
@Override public List<String> getJobContextsComboValue(ProcessItem processItem){
  List<String> contextNameList=new ArrayList<String>();
  for (  Object o : ((ProcessTypeImpl)processItem.getProcess()).getContext()) {
    if (o instanceof ContextType) {
      ContextType context=(ContextType)o;
      if (contextNameList.contains(context.getName())) {
        continue;
      }
      contextNameList.add(context.getName());
    }
  }
  return contextNameList;
}
Program: 122741
Project: 122741
Buggy source:
private BusinessAlignment getAlignment(String alignment){
  BusinessAlignment[] alignments=BusinessAlignment.values();
  BusinessAlignment position=null;
  for (int i=0; i < alignments.length; i++) {
    if (alignments[i].toString().equalsIgnoreCase(alignment)) {
      position=alignments[i];
      return position;
    }
  }
  return position;
}

Fixed version (ground truth):
private BusinessAlignment getAlignment(String alignment){
  BusinessAlignment[] alignments=BusinessAlignment.values();
  BusinessAlignment position=null;
  for (  BusinessAlignment alignment2 : alignments) {
    if (alignment2.toString().equalsIgnoreCase(alignment)) {
      position=alignment2;
      return position;
    }
  }
  return position;
}
Program: 122742
Project: 122742
Buggy source:
/** 
 * DOC mhelleboid BusinessItemShapeEditPart constructor comment.
 * @param view
 */
public BusinessItemShapeEditPart(View view){
  super(view);
  tooltipFigure=new BusinessTooltipFigure();
  elementHelper=new ElementHelper();
}

Fixed version (ground truth):
/** 
 * DOC mhelleboid BusinessItemShapeEditPart constructor comment.
 * @param view
 */
public BusinessItemShapeEditPart(View view){
  super(view);
  tooltipFigure=new BusinessTooltipFigure();
  elementHelper=new ElementHelper();
  editPart=this;
}
Program: 122746
Project: 122746
Buggy source:
/** 
 * See also AbstractEMFRepositoryFactory.computePropertyMaxInformationLevel
 * @param property
 */
public static void computePropertyMaxInformationLevel(Property property){
  EList<Information> informations=property.getInformations();
  InformationLevel maxLevel=null;
  for (int i=0; i < informations.size(); i++) {
    Information information=informations.get(i);
    if (i == 0) {
      maxLevel=information.getLevel();
      continue;
    }
    int value=information.getLevel().getValue();
    if (maxLevel == null || value > maxLevel.getValue()) {
      maxLevel=information.getLevel();
    }
  }
  if (maxLevel != null) {
    property.setMaxInformationLevel(maxLevel);
  }
 else {
    property.setMaxInformationLevel(InformationLevel.DEBUG_LITERAL);
  }
}

Fixed version (ground truth):
/** 
 * See also AbstractEMFRepositoryFactory.computePropertyMaxInformationLevel
 * @param property
 */
public static void computePropertyMaxInformationLevel(Property property){
  EList<Information> informations=property.getInformations();
  InformationLevel maxLevel=null;
  for (int i=0; i < informations.size(); i++) {
    Information information=informations.get(i);
    if (i == 0) {
      maxLevel=information.getLevel();
      continue;
    }
    int value=information.getLevel().getValue();
    if (maxLevel == null || value > maxLevel.getValue()) {
      maxLevel=information.getLevel();
    }
  }
  InformationLevel propertyMaxLevel=property.getMaxInformationLevel();
  boolean isModified=false;
  if (maxLevel != null) {
    if (!maxLevel.equals(propertyMaxLevel)) {
      property.setMaxInformationLevel(maxLevel);
      isModified=true;
    }
  }
 else   if (!InformationLevel.DEBUG_LITERAL.equals(propertyMaxLevel)) {
    property.setMaxInformationLevel(InformationLevel.DEBUG_LITERAL);
    isModified=true;
  }
  if (isModified && isSVN()) {
    IRepositoryService service=CorePlugin.getDefault().getRepositoryService();
    IProxyRepositoryFactory factory=service.getProxyRepositoryFactory();
    Item item=property.getItem();
    try {
      factory.save(item,false);
    }
 catch (    PersistenceException e) {
      e.printStackTrace();
    }
  }
}
Program: 122748
Project: 122748
Buggy source:
protected List<URL> getLib(List<String> libs,Boolean needLib){
  List<URL> list=new ArrayList<URL>();
  if (!needLib) {
    return list;
  }
  try {
    org.talend.core.model.general.Project projecdddt=ProjectManager.getInstance().getCurrentProject();
    IProject fsProject=null;
    try {
      fsProject=ResourceModelUtils.getProject(projecdddt);
    }
 catch (    PersistenceException e2) {
      ExceptionHandler.process(e2);
    }
    IPath temPath=fsProject.getLocation().append(File.separator + "String_Node_Str");
    ILibraryManagerService repositoryBundleService=CorePlugin.getDefault().getRepositoryBundleService();
    if (repositoryBundleService != null) {
      repositoryBundleService.retrieve(libs,temPath.toString());
    }
    File file=temPath.toFile();
    File[] files=file.listFiles(new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.toLowerCase().endsWith("String_Node_Str") || name.toLowerCase().endsWith("String_Node_Str") || name.toLowerCase().endsWith("String_Node_Str") ? true : false;
      }
    }
);
    for (int i=0; i < files.length; i++) {
      File tempFile=files[i];
      try {
        if (libs.contains(tempFile.getName())) {
          list.add(tempFile.toURL());
        }
      }
 catch (      MalformedURLException e) {
        ExceptionHandler.process(e);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return list;
}

Fixed version (ground truth):
protected List<URL> getLib(List<String> libs,Boolean needLib){
  List<URL> list=new ArrayList<URL>();
  if (!needLib) {
    return list;
  }
  try {
    org.talend.core.model.general.Project projecdddt=ProjectManager.getInstance().getCurrentProject();
    IProject fsProject=null;
    try {
      fsProject=ResourceModelUtils.getProject(projecdddt);
    }
 catch (    PersistenceException e2) {
      ExceptionHandler.process(e2);
    }
    IPath temPath=fsProject.getLocation().append(File.separator + "String_Node_Str");
    ILibraryManagerService repositoryBundleService=CorePlugin.getDefault().getRepositoryBundleService();
    if (repositoryBundleService != null) {
      repositoryBundleService.retrieve(libs,temPath.toString());
    }
    File file=temPath.toFile();
    File[] files=file.listFiles(new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.toLowerCase().endsWith("String_Node_Str") || name.toLowerCase().endsWith("String_Node_Str") || name.toLowerCase().endsWith("String_Node_Str") ? true : false;
      }
    }
);
    for (    File tempFile : files) {
      try {
        if (libs.contains(tempFile.getName())) {
          list.add(tempFile.toURL());
        }
      }
 catch (      MalformedURLException e) {
        ExceptionHandler.process(e);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return list;
}
Program: 122750
Project: 122750
Buggy source:
private List<File> getRoutineDependince(ExportFileResource[] process,boolean system,boolean useBeans){
  List<File> userRoutines=null;
  try {
    String classRoot=getClassRootLocation();
    if (useBeans) {
      userRoutines=getAllFiles(classRoot,USER_BEANS_PATH);
    }
 else {
      userRoutines=getAllFiles(classRoot,USER_ROUTINES_PATH);
    }
    List<IRepositoryViewObject> collectRoutines=collectRoutines(process,system,useBeans);
    Iterator<File> iterator=userRoutines.iterator();
    while (iterator.hasNext()) {
      File file=(File)iterator.next();
      boolean found=false;
      for (      IRepositoryViewObject object : collectRoutines) {
        Item item=object.getProperty().getItem();
        String pattern=item.getProperty().getLabel() + "String_Node_Str";
        if (file.getName().matches(pattern)) {
          found=true;
          break;
        }
      }
      if (!found) {
        iterator.remove();
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return userRoutines;
}

Fixed version (ground truth):
private List<File> getRoutineDependince(ExportFileResource[] process,boolean system,boolean useBeans){
  List<File> userRoutines=null;
  try {
    String classRoot=getClassRootLocation();
    if (useBeans) {
      userRoutines=getAllFiles(classRoot,USER_BEANS_PATH);
    }
 else {
      userRoutines=getAllFiles(classRoot,USER_ROUTINES_PATH);
    }
    List<IRepositoryViewObject> collectRoutines=collectRoutines(process,system,useBeans);
    Iterator<File> iterator=userRoutines.iterator();
    while (iterator.hasNext()) {
      File file=iterator.next();
      boolean found=false;
      for (      IRepositoryViewObject object : collectRoutines) {
        Item item=object.getProperty().getItem();
        String pattern=item.getProperty().getLabel() + "String_Node_Str";
        if (file.getName().matches(pattern)) {
          found=true;
          break;
        }
      }
      if (!found) {
        iterator.remove();
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return userRoutines;
}
Program: 122751
Project: 122751
Buggy source:
public List<String> getJobContextsComboValue(ProcessItem processItem){
  List<String> contextNameList=new ArrayList<String>();
  for (  Object o : ((ProcessTypeImpl)processItem.getProcess()).getContext()) {
    if (o instanceof ContextType) {
      ContextType context=(ContextType)o;
      if (contextNameList.contains(context.getName())) {
        continue;
      }
      contextNameList.add(context.getName());
    }
  }
  return contextNameList;
}

Fixed version (ground truth):
@Override public List<String> getJobContextsComboValue(ProcessItem processItem){
  List<String> contextNameList=new ArrayList<String>();
  for (  Object o : ((ProcessTypeImpl)processItem.getProcess()).getContext()) {
    if (o instanceof ContextType) {
      ContextType context=(ContextType)o;
      if (contextNameList.contains(context.getName())) {
        continue;
      }
      contextNameList.add(context.getName());
    }
  }
  return contextNameList;
}
Program: 122754
Project: 122754
Buggy source:
protected List<URL> addChildrenResources(ExportFileResource[] allResources,ProcessItem process,boolean needChildren,ExportFileResource resource,Map<ExportChoice,Object> exportChoice,String... selectedJobVersion){
  List<JobInfo> list=new ArrayList<JobInfo>();
  String projectName=getCorrespondingProjectName(process);
  try {
    List<ProcessItem> processedJob=new ArrayList<ProcessItem>();
    getChildrenJobAndContextName(allResources,process.getProperty().getLabel(),list,process,projectName,processedJob,resource,exportChoice,selectedJobVersion);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  List<URL> allJobScripts=new ArrayList<URL>();
  if (needChildren) {
    ProjectManager projectManager=ProjectManager.getInstance();
    for (Iterator<JobInfo> iter=list.iterator(); iter.hasNext(); ) {
      JobInfo jobInfo=iter.next();
      Project project=projectManager.getProject(jobInfo.getProcessItem());
      String childProjectName=projectName;
      if (project != null) {
        childProjectName=project.getTechnicalLabel().toLowerCase();
      }
      allJobScripts.addAll(getJobScripts(childProjectName,jobInfo.getJobName(),jobInfo.getJobVersion(),isOptionChoosed(ExportChoice.needJobScript)));
      addContextScripts(jobInfo.getProcessItem(),jobInfo.getJobName(),jobInfo.getJobVersion(),resource,isOptionChoosed(ExportChoice.needContext));
      addDependencies(allResources,jobInfo.getProcessItem(),isOptionChoosed(ExportChoice.needDependencies),resource);
    }
  }
  return allJobScripts;
}

Fixed version (ground truth):
protected List<URL> addChildrenResources(ExportFileResource[] allResources,ProcessItem process,boolean needChildren,ExportFileResource resource,Map<ExportChoice,Object> exportChoice,String... selectedJobVersion){
  List<JobInfo> list=new ArrayList<JobInfo>();
  String projectName=getCorrespondingProjectName(process);
  try {
    List<ProcessItem> processedJob=new ArrayList<ProcessItem>();
    getChildrenJobAndContextName(allResources,process.getProperty().getLabel(),list,process,projectName,processedJob,resource,exportChoice,selectedJobVersion);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  List<URL> allJobScripts=new ArrayList<URL>();
  if (needChildren) {
    ProjectManager projectManager=ProjectManager.getInstance();
    for (    JobInfo jobInfo : list) {
      Project project=projectManager.getProject(jobInfo.getProcessItem());
      String childProjectName=projectName;
      if (project != null) {
        childProjectName=project.getTechnicalLabel().toLowerCase();
      }
      allJobScripts.addAll(getJobScripts(childProjectName,jobInfo.getJobName(),jobInfo.getJobVersion(),isOptionChoosed(ExportChoice.needJobScript)));
      addContextScripts(jobInfo.getProcessItem(),jobInfo.getJobName(),jobInfo.getJobVersion(),resource,isOptionChoosed(ExportChoice.needContext));
      addDependencies(allResources,jobInfo.getProcessItem(),isOptionChoosed(ExportChoice.needDependencies),resource);
    }
  }
  return allJobScripts;
}
Program: 122755
Project: 122755
Buggy source:
/** 
 * DOC mhelleboid BusinessItemShapeEditPart constructor comment.
 * @param view
 */
public BusinessItemShapeEditPart(View view){
  super(view);
  tooltipFigure=new BusinessTooltipFigure();
  elementHelper=new ElementHelper();
}

Fixed version (ground truth):
/** 
 * DOC mhelleboid BusinessItemShapeEditPart constructor comment.
 * @param view
 */
public BusinessItemShapeEditPart(View view){
  super(view);
  tooltipFigure=new BusinessTooltipFigure();
  elementHelper=new ElementHelper();
  editPart=this;
}
Program: 122758
Project: 122758
Buggy source:
/** 
 * wzhang Comment method "sortOrder".
 * @param treeNode
 * @param node
 */
public void sortOrder(FOXTreeNode treeNode,FOXTreeNode node){
  if (node != null) {
    List<FOXTreeNode> children=node.getChildren();
    if (treeNode != null) {
      int tmpOrder=0;
      int attrNsCount=0;
      for (      FOXTreeNode child : children) {
        if (child.getOrder() < treeNode.getOrder()) {
          tmpOrder++;
        }
        if (child.isAttribute() || child.isNameSpace()) {
          attrNsCount++;
        }
      }
      if (tmpOrder > -1) {
        int oldOrder=children.indexOf(treeNode);
        if (oldOrder != -1 && oldOrder != tmpOrder) {
          node.removeChild(treeNode);
          if (children.size() > tmpOrder) {
            node.addChild(tmpOrder - attrNsCount,treeNode);
          }
 else {
            node.addChild(treeNode);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * wzhang Comment method "sortOrder".
 * @param treeNode
 * @param node
 */
public void sortOrder(FOXTreeNode treeNode,FOXTreeNode node){
  if (node != null) {
    List<FOXTreeNode> children=node.getChildren();
    if (treeNode != null) {
      int tmpOrder=0;
      int attrNsCount=0;
      for (      FOXTreeNode child : children) {
        if (child.getOrder() < treeNode.getOrder()) {
          tmpOrder++;
        }
        if (child instanceof Attribute || child instanceof NameSpaceNode) {
          attrNsCount++;
        }
      }
      if (tmpOrder > -1) {
        int oldOrder=children.indexOf(treeNode);
        if (oldOrder != -1 && oldOrder != tmpOrder) {
          node.removeChild(treeNode);
          if (children.size() > tmpOrder) {
            node.addChild(tmpOrder - attrNsCount,treeNode);
          }
 else {
            node.addChild(treeNode);
          }
        }
      }
    }
  }
}
Program: 122759
Project: 122759
Buggy source:
/** 
 * DOC mhelleboid BusinessItemShapeEditPart constructor comment.
 * @param view
 */
public BusinessItemShapeEditPart(View view){
  super(view);
  tooltipFigure=new BusinessTooltipFigure();
  elementHelper=new ElementHelper();
}

Fixed version (ground truth):
/** 
 * DOC mhelleboid BusinessItemShapeEditPart constructor comment.
 * @param view
 */
public BusinessItemShapeEditPart(View view){
  super(view);
  tooltipFigure=new BusinessTooltipFigure();
  elementHelper=new ElementHelper();
  editPart=this;
}
Program: 122762
Project: 122762
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>(){
      @Override 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: 122763
Project: 122763
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>(){
      @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;
}

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: 122764
Project: 122764
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: 122765
Project: 122765
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);
}