nus-yam/ex-repair huggingface dataset:
Program: 126802
Project: 126802
Buggy source:
/** 
 * qzhang Comment method "refreshContextView".
 */
@Override public void execute(){
  boolean found;
  List<IContextParameter> listParams;
  for (int i=0; i < contextManager.getListContext().size(); i++) {
    listParams=contextManager.getListContext().get(i).getContextParameterList();
    found=false;
    for (int j=0; j < listParams.size() && !found; j++) {
      IContextParameter contextParameter=listParams.get(j);
      String tempName=contextParameter.getName();
      String tempSourceId=contextParameter.getSource();
      if (tempName.equals(oldName) && tempSourceId.equals(sourceId)) {
        contextParameter.setName(newName);
        String scriptCode=contextParameter.getScriptCode().replaceAll(oldName,newName);
        contextParameter.setScriptCode(scriptCode);
        if (contextParameter.getPrompt().equals(oldName + "String_Node_Str")) {
          contextParameter.setPrompt(newName + "String_Node_Str");
        }
        found=true;
      }
    }
  }
  contextManager.fireContextsChangedEvent();
  this.helper.refreshContextView();
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "refreshContextView".
 */
@Override public void execute(){
  boolean found;
  List<IContextParameter> listParams;
  for (int i=0; i < contextManager.getListContext().size(); i++) {
    listParams=contextManager.getListContext().get(i).getContextParameterList();
    found=false;
    for (int j=0; j < listParams.size() && !found; j++) {
      IContextParameter contextParameter=listParams.get(j);
      String tempName=contextParameter.getName();
      String tempSourceId=contextParameter.getSource();
      if (tempName.equals(oldName) && tempSourceId.equals(sourceId)) {
        contextParameter.setName(newName);
        String scriptCode=contextParameter.getScriptCode().replaceAll(oldName,newName);
        contextParameter.setScriptCode(scriptCode);
        if (contextParameter.getPrompt().equals(oldName + "String_Node_Str")) {
          contextParameter.setPrompt(newName + "String_Node_Str");
        }
        found=true;
      }
    }
  }
  contextManager.fireContextsChangedEvent();
  this.helper.refreshContextViewForRename();
}
Program: 126805
Project: 126805
Buggy source:
public void refreshContextView(){
  IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  IViewPart view=page.findView(AbstractContextView.CTX_ID_DESIGNER);
  if (view instanceof AbstractContextView) {
    ((AbstractContextView)view).updateContextView(true);
  }
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqUiService.class)) {
    ITdqUiService tdqUiService=(ITdqUiService)GlobalServiceRegister.getDefault().getService(ITdqUiService.class);
    if (tdqUiService != null) {
      tdqUiService.updateContextView(true);
    }
  }
}

Fixed version (ground truth):
public void refreshContextView(){
  IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  IViewPart view=page.findView(AbstractContextView.CTX_ID_DESIGNER);
  if (view instanceof AbstractContextView) {
    ((AbstractContextView)view).updateContextView(true,false,false);
  }
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqUiService.class)) {
    ITdqUiService tdqUiService=(ITdqUiService)GlobalServiceRegister.getDefault().getService(ITdqUiService.class);
    if (tdqUiService != null) {
      tdqUiService.updateContextView(true,false,false);
    }
  }
}
Program: 126806
Project: 126806
Buggy source:
@Override public void undo(){
  List<IContext> removeList=new ArrayList<IContext>();
  for (  IContext con : manager.getListContext()) {
    if (nameSet.contains(con.getName())) {
      removeList.add(con);
    }
  }
  manager.getListContext().removeAll(removeList);
  for (  ContextParameterType defaultContextParamType : newAddParameter) {
    ContextItem contextItem=(ContextItem)helper.getParentContextItem(defaultContextParamType);
    if (contextItem == null) {
      continue;
    }
    IContextParameter paramExisted=helper.getExistedContextParameter(defaultContextParamType.getName());
    if (paramExisted != null) {
      new ContextRemoveParameterCommand(manager,defaultContextParamType.getName(),paramExisted.getSource()).execute();
    }
  }
  this.helper.refreshContextView();
}

Fixed version (ground truth):
@Override public void undo(){
  List<IContext> removeList=new ArrayList<IContext>();
  for (  IContext con : manager.getListContext()) {
    if (nameSet.contains(con.getName())) {
      removeList.add(con);
    }
  }
  manager.getListContext().removeAll(removeList);
  cmds.clear();
  for (  ContextParameterType defaultContextParamType : newAddParameter) {
    ContextItem contextItem=(ContextItem)helper.getParentContextItem(defaultContextParamType);
    if (contextItem == null) {
      continue;
    }
    IContextParameter paramExisted=helper.getExistedContextParameter(defaultContextParamType.getName());
    if (paramExisted != null) {
      ContextRemoveParameterCommand contextRemoveParameterCommand=new ContextRemoveParameterCommand(manager,defaultContextParamType.getName(),paramExisted.getSource());
      contextRemoveParameterCommand.execute();
      cmds.add(contextRemoveParameterCommand);
    }
  }
  this.helper.refreshContextView();
}
Program: 126807
Project: 126807
Buggy source:
@Override public void redo(){
  execute();
  this.helper.refreshContextView();
}

Fixed version (ground truth):
@Override public void redo(){
  for (  ContextRemoveParameterCommand cmd : cmds) {
    if (cmd.canUndo()) {
      cmd.undo();
    }
  }
  List<IContext> removeList=new ArrayList<IContext>();
  for (  IContext con : manager.getListContext()) {
    if (nameSet.contains(con.getName())) {
      removeList.add(con);
    }
  }
  manager.getListContext().addAll(removeList);
  this.helper.refreshContextView();
}
Program: 126808
Project: 126808
Buggy source:
/** 
 * Create an instance of this class.
 * @param filename java.lang.String
 * @param compress boolean
 * @exception java.io.IOException
 */
public ZipFileExporterFullPath(String filename,boolean compress) throws IOException {
  outputStream=new ZipOutputStream(new FileOutputStream(filename));
  useCompression=compress;
}

Fixed version (ground truth):
/** 
 * Create an instance of this class.
 * @param filename java.lang.String
 * @param compress boolean
 * @exception java.io.IOException
 */
public ZipFileExporterFullPath(String filename,boolean compress) throws IOException {
  outputStream=new ZipOutputStream(new FileOutputStream(filename));
  outputStream.setEncoding("String_Node_Str");
  useCompression=compress;
}
Program: 126811
Project: 126811
Buggy source:
public ContextChangeDefaultCommand(IContextManager contextManager,IContext newDefault){
  this.newDefault=newDefault;
  this.contextManager=contextManager;
  this.oldDefault=contextManager.getDefaultContext();
  this.setLabel(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
public ContextChangeDefaultCommand(IContextManager contextManager,IContext newDefault){
  this.newDefault=newDefault;
  this.contextManager=contextManager;
  this.oldDefault=contextManager.getDefaultContext();
  this.helper=new ContextManagerHelper(contextManager);
  this.setLabel(Messages.getString("String_Node_Str"));
}
Program: 126812
Project: 126812
Buggy source:
/** 
 * Extracts all convert services which are registed by the extension point <b> <code>org.talend.designer.core.process_convert</code> </b>. Added by Marvin Wang on Mar 19, 2013.
 * @return
 */
public List<IProcessConvertService> extractAllConvertServices(){
  List<IProcessConvertService> processConvertServices=new ArrayList<IProcessConvertService>();
  IExtensionRegistry extensionRegistry=Platform.getExtensionRegistry();
  IExtensionPoint extensionPoint=extensionRegistry.getExtensionPoint(EXTENSION_POINT_FOR_CONVERT);
  if (extensionPoint != null) {
    IExtension[] extensions=extensionPoint.getExtensions();
    for (    IExtension extension : extensions) {
      IConfigurationElement[] configurationElements=extension.getConfigurationElements();
      for (      IConfigurationElement configurationElement : configurationElements) {
        try {
          Object service=configurationElement.createExecutableExtension("String_Node_Str");
          if (service instanceof IProcessConvertService) {
            processConvertServices.add((IProcessConvertService)service);
          }
        }
 catch (        CoreException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  return processConvertServices;
}

Fixed version (ground truth):
/** 
 * Extracts all convert services which are registed by the extension point <b> <code>org.talend.designer.core.process_convert</code> </b>. Added by Marvin Wang on Mar 19, 2013.
 * @return
 */
public List<IProcessConvertService> extractAllConvertServices(){
  if (processConvertServices.size() > 0) {
    return processConvertServices;
  }
  IExtensionRegistry extensionRegistry=Platform.getExtensionRegistry();
  IExtensionPoint extensionPoint=extensionRegistry.getExtensionPoint(EXTENSION_POINT_FOR_CONVERT);
  if (extensionPoint != null) {
    IExtension[] extensions=extensionPoint.getExtensions();
    for (    IExtension extension : extensions) {
      IConfigurationElement[] configurationElements=extension.getConfigurationElements();
      for (      IConfigurationElement configurationElement : configurationElements) {
        try {
          Object service=configurationElement.createExecutableExtension("String_Node_Str");
          if (service instanceof IProcessConvertService) {
            processConvertServices.add((IProcessConvertService)service);
          }
        }
 catch (        CoreException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  return processConvertServices;
}
Program: 126813
Project: 126813
Buggy source:
/** 
 * DOC liuwu find all the tRecollectors which match to tPartitioner
 * @param node : should be tPartitioner
 * @param recollectors
 */
public static void getRecollectorsFromPartitioner(INode node,List<String> recollectors){
  List<? extends INode> listRecollectors=node.getProcess().getNodesOfType("String_Node_Str");
  if (listRecollectors != null && listRecollectors.size() > 0) {
    for (    INode recNode : listRecollectors) {
      String departitionerName=ElementParameterParser.getValue(recNode,"String_Node_Str");
      List<? extends INode> listDepartitioner=node.getProcess().getNodesOfType("String_Node_Str");
      if (listDepartitioner == null) {
        return;
      }
      for (      INode tnode : listDepartitioner) {
        if (tnode.getUniqueName().equals(departitionerName)) {
          INode startNode=tnode.getDesignSubjobStartNode();
          List<? extends IConnection> inConns=startNode.getIncomingConnections(EConnectionType.STARTS);
          if (inConns != null && inConns.size() > 0) {
            if (inConns.get(0).getSource() == node) {
              recollectors.add(recNode.getUniqueName());
            }
          }
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC liuwu find all the tRecollectors which match to tPartitioner
 * @param node : should be tPartitioner
 * @param recollectors
 */
public static void getRecollectorsFromPartitioner(INode node,List<String> recollectors){
  List<? extends INode> listRecollectors=node.getProcess().getNodesOfType("String_Node_Str");
  if (listRecollectors != null && listRecollectors.size() > 0) {
    for (    INode recNode : listRecollectors) {
      String departitionerName=ElementParameterParser.getValue(recNode,"String_Node_Str");
      List<? extends INode> listDepartitioner=node.getProcess().getNodesOfType("String_Node_Str");
      if (listDepartitioner == null) {
        return;
      }
      for (      INode tnode : listDepartitioner) {
        if (tnode.getUniqueName().equals(departitionerName)) {
          INode startNode=getSubProcessStartNode(tnode);
          List<? extends IConnection> inConns=startNode.getIncomingConnections(EConnectionType.STARTS);
          if (inConns != null && inConns.size() > 0) {
            if (inConns.get(0).getSource() == node) {
              recollectors.add(recNode.getUniqueName());
            }
          }
          break;
        }
      }
    }
  }
}
Program: 126816
Project: 126816
Buggy source:
@Override public boolean isChecked(Object element){
  if (element instanceof TableNode) {
    TableNode node=(TableNode)element;
    if (node.getType() == TableNode.TABLE) {
      if (isExistTable(node)) {
        return true;
      }
 else {
        return false;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean isChecked(Object element){
  if (element instanceof TableNode) {
    TableNode node=(TableNode)element;
    if (node.getType() == TableNode.TABLE) {
      if (isExistTable(node)) {
        return true;
      }
 else {
        return false;
      }
    }
  }
  return false;
}
Program: 126817
Project: 126817
Buggy source:
@Override public boolean isGrayed(Object element){
  return false;
}

Fixed version (ground truth):
public boolean isGrayed(Object element){
  return false;
}
Program: 126819
Project: 126819
Buggy source:
/** 
 * Create an instance of this class.
 * @param filename java.lang.String
 * @param compress boolean
 * @exception java.io.IOException
 */
public ZipFileExporterFullPath(String filename,boolean compress) throws IOException {
  outputStream=new ZipOutputStream(new FileOutputStream(filename));
  useCompression=compress;
}

Fixed version (ground truth):
/** 
 * Create an instance of this class.
 * @param filename java.lang.String
 * @param compress boolean
 * @exception java.io.IOException
 */
public ZipFileExporterFullPath(String filename,boolean compress) throws IOException {
  outputStream=new ZipOutputStream(new FileOutputStream(filename));
  outputStream.setEncoding("String_Node_Str");
  useCompression=compress;
}
Program: 126820
Project: 126820
Buggy source:
public Property getProperty(Object nodeObject);

Fixed version (ground truth):
/** 
 * DOC wchen Comment method "getProperty".
 * @param repository nodeObject
 * @return property of this repository object
 */
public Property getProperty(Object nodeObject);
Program: 126821
Project: 126821
Buggy source:
public ERepositoryObjectType getObjectType(Object repositoryNode);

Fixed version (ground truth):
/** 
 * DOC get ERepositoryObjectType for repository selection
 * @param repository selected object
 * @return
 */
public ERepositoryObjectType getObjectType(Object repositoryNode);
Program: 126823
Project: 126823
Buggy source:
private void logError(Exception e){
  ImportCacheHelper.getInstance().setImportingError(true);
  ExceptionHandler.process(e);
}

Fixed version (ground truth):
protected void logError(Exception e){
  ImportCacheHelper.getInstance().setImportingError(true);
  ExceptionHandler.process(e);
}
Program: 126824
Project: 126824
Buggy source:
public String getLabel(){
  if (label == null) {
    IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    boolean allowVerchange=brandingService.getBrandingConfiguration().isAllowChengeVersion();
    if (allowVerchange) {
      label=property.getLabel() + "String_Node_Str" + property.getVersion();
    }
 else {
      label=property.getLabel();
    }
  }
  return label;
}

Fixed version (ground truth):
public String getLabel(){
  if (label == null) {
    IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    boolean allowVerchange=brandingService.getBrandingConfiguration().isAllowChengeVersion();
    if (allowVerchange && property.getItem().isNeedVersion()) {
      label=property.getLabel() + "String_Node_Str" + property.getVersion();
    }
 else {
      label=property.getLabel();
    }
  }
  return label;
}
Program: 126826
Project: 126826
Buggy source:
/** 
 * Download file from specific url.
 * @param componentUrl The file url to download
 * @param destination The local file to be saved
 * @throws IOException
 * @throws Exception
 */
public void download(URL componentUrl,File destination) throws IOException {
  BufferedInputStream bis=null;
  BufferedOutputStream bos=null;
  try {
    URLConnection connection=componentUrl.openConnection();
    bis=new BufferedInputStream(connection.getInputStream());
    bos=new BufferedOutputStream(new FileOutputStream(destination));
    fireDownloadStart(connection.getContentLength());
    byte[] buf=new byte[BUFFER_SIZE];
    int bytesDownloaded=0;
    int bytesRead=-1;
    while ((bytesRead=bis.read(buf)) != -1) {
      bos.write(buf,0,bytesRead);
      bytesDownloaded+=bytesRead;
      fireDownloadProgress(bytesRead);
      if (isCancel()) {
        return;
      }
    }
    bos.flush();
    fireDownloadComplete();
  }
  finally {
    IOException e=null;
    if (bis != null) {
      try {
        bis.close();
      }
 catch (      IOException ioe) {
        e=ioe;
      }
    }
    if (bos != null) {
      try {
        bos.close();
      }
 catch (      IOException ioe) {
        e=ioe;
      }
    }
    if (e != null) {
      throw e;
    }
  }
}

Fixed version (ground truth):
/** 
 * Download file from specific url.
 * @param componentUrl The file url to download
 * @param destination The local file to be saved
 * @throws IOException
 * @throws Exception
 */
public void download(URL componentUrl,File destination) throws IOException {
  BufferedInputStream bis=null;
  BufferedOutputStream bos=null;
  try {
    if (destination.exists()) {
      destination.delete();
    }
    File destParentFile=destination.getParentFile();
    if (!destParentFile.exists()) {
      destParentFile.mkdirs();
    }
    URLConnection connection=componentUrl.openConnection();
    bis=new BufferedInputStream(connection.getInputStream());
    bos=new BufferedOutputStream(new FileOutputStream(destination));
    fireDownloadStart(connection.getContentLength());
    byte[] buf=new byte[BUFFER_SIZE];
    int bytesDownloaded=0;
    int bytesRead=-1;
    while ((bytesRead=bis.read(buf)) != -1) {
      bos.write(buf,0,bytesRead);
      bytesDownloaded+=bytesRead;
      fireDownloadProgress(bytesRead);
      if (isCancel()) {
        return;
      }
    }
    bos.flush();
    fireDownloadComplete();
  }
  finally {
    IOException e=null;
    if (bis != null) {
      try {
        bis.close();
      }
 catch (      IOException ioe) {
        e=ioe;
      }
    }
    if (bos != null) {
      try {
        bos.close();
      }
 catch (      IOException ioe) {
        e=ioe;
      }
    }
    if (e != null) {
      throw e;
    }
  }
}
Program: 126829
Project: 126829
Buggy source:
public Property getProperty(Object nodeObject);

Fixed version (ground truth):
/** 
 * DOC wchen Comment method "getProperty".
 * @param repository nodeObject
 * @return property of this repository object
 */
public Property getProperty(Object nodeObject);
Program: 126830
Project: 126830
Buggy source:
public ERepositoryObjectType getObjectType(Object repositoryNode);

Fixed version (ground truth):
/** 
 * DOC get ERepositoryObjectType for repository selection
 * @param repository selected object
 * @return
 */
public ERepositoryObjectType getObjectType(Object repositoryNode);
Program: 126832
Project: 126832
Buggy source:
private void logError(Exception e){
  ImportCacheHelper.getInstance().setImportingError(true);
  ExceptionHandler.process(e);
}

Fixed version (ground truth):
protected void logError(Exception e){
  ImportCacheHelper.getInstance().setImportingError(true);
  ExceptionHandler.process(e);
}
Program: 126833
Project: 126833
Buggy source:
public String getLabel(){
  if (label == null) {
    IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    boolean allowVerchange=brandingService.getBrandingConfiguration().isAllowChengeVersion();
    if (allowVerchange) {
      label=property.getLabel() + "String_Node_Str" + property.getVersion();
    }
 else {
      label=property.getLabel();
    }
  }
  return label;
}

Fixed version (ground truth):
public String getLabel(){
  if (label == null) {
    IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    boolean allowVerchange=brandingService.getBrandingConfiguration().isAllowChengeVersion();
    if (allowVerchange && property.getItem().isNeedVersion()) {
      label=property.getLabel() + "String_Node_Str" + property.getVersion();
    }
 else {
      label=property.getLabel();
    }
  }
  return label;
}
Program: 126840
Project: 126840
Buggy source:
/** 
 * Extracts all convert services which are registed by the extension point <b> <code>org.talend.designer.core.process_convert</code> </b>. Added by Marvin Wang on Mar 19, 2013.
 * @return
 */
public List<IProcessConvertService> extractAllConvertServices(){
  List<IProcessConvertService> processConvertServices=new ArrayList<IProcessConvertService>();
  IExtensionRegistry extensionRegistry=Platform.getExtensionRegistry();
  IExtensionPoint extensionPoint=extensionRegistry.getExtensionPoint(EXTENSION_POINT_FOR_CONVERT);
  if (extensionPoint != null) {
    IExtension[] extensions=extensionPoint.getExtensions();
    for (    IExtension extension : extensions) {
      IConfigurationElement[] configurationElements=extension.getConfigurationElements();
      for (      IConfigurationElement configurationElement : configurationElements) {
        try {
          Object service=configurationElement.createExecutableExtension("String_Node_Str");
          if (service instanceof IProcessConvertService) {
            processConvertServices.add((IProcessConvertService)service);
          }
        }
 catch (        CoreException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  return processConvertServices;
}

Fixed version (ground truth):
/** 
 * Extracts all convert services which are registed by the extension point <b> <code>org.talend.designer.core.process_convert</code> </b>. Added by Marvin Wang on Mar 19, 2013.
 * @return
 */
public List<IProcessConvertService> extractAllConvertServices(){
  if (processConvertServices.size() > 0) {
    return processConvertServices;
  }
  IExtensionRegistry extensionRegistry=Platform.getExtensionRegistry();
  IExtensionPoint extensionPoint=extensionRegistry.getExtensionPoint(EXTENSION_POINT_FOR_CONVERT);
  if (extensionPoint != null) {
    IExtension[] extensions=extensionPoint.getExtensions();
    for (    IExtension extension : extensions) {
      IConfigurationElement[] configurationElements=extension.getConfigurationElements();
      for (      IConfigurationElement configurationElement : configurationElements) {
        try {
          Object service=configurationElement.createExecutableExtension("String_Node_Str");
          if (service instanceof IProcessConvertService) {
            processConvertServices.add((IProcessConvertService)service);
          }
        }
 catch (        CoreException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  return processConvertServices;
}
Program: 126842
Project: 126842
Buggy source:
/** 
 * This method is used when export job , check if one of the database component node use dynamic metadata
 */
private static void checkMetadataDynamic(ProcessItem selectedProcessItem,JobInfo jobInfo){
  if (exportConfig && !LastGenerationInfo.getInstance().isUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion())) {
    boolean hasDynamicMetadata=false;
    final ProcessType process=selectedProcessItem.getProcess();
    if (process != null) {
      out:       for (      NodeType node : (List<NodeType>)process.getNode()) {
        boolean isDbNode=false;
        for (        ElementParameterType param : (List<ElementParameterType>)node.getElementParameter()) {
          if ("String_Node_Str".equals(param.getName()) && "String_Node_Str".equals(param.getField()) && param.getValue() != null && !"String_Node_Str".equals(param.getValue())) {
            isDbNode=true;
            break;
          }
        }
        if (isDbNode) {
          for (          MetadataType metadataType : (List<MetadataType>)node.getMetadata()) {
            for (            ColumnType column : (List<ColumnType>)metadataType.getColumn()) {
              if ("String_Node_Str".equals(column.getType())) {
                hasDynamicMetadata=true;
                break out;
              }
            }
          }
        }
      }
    }
    LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion(),hasDynamicMetadata);
  }
}

Fixed version (ground truth):
/** 
 * This method is used when export job or joblet , check if one of the database component node use dynamic metadata
 */
private static void checkMetadataDynamic(IProcess currentProcess,JobInfo jobInfo){
  if (exportConfig && !LastGenerationInfo.getInstance().isUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion())) {
    boolean hasDynamicMetadata=false;
    out:     for (    INode node : (List<? extends INode>)currentProcess.getGeneratingNodes()) {
      boolean isDbNode=false;
      for (      IElementParameter param : (List<? extends IElementParameter>)node.getElementParameters()) {
        if ("String_Node_Str".equals(param.getName()) && "String_Node_Str".equals(param.getFieldType().getName()) && param.getValue() != null && !"String_Node_Str".equals(param.getValue())) {
          isDbNode=true;
          break;
        }
      }
      if (isDbNode) {
        for (        IMetadataTable metadataTable : node.getMetadataList()) {
          for (          IMetadataColumn column : metadataTable.getListColumns()) {
            if ("String_Node_Str".equals(column.getTalendType())) {
              hasDynamicMetadata=true;
              break out;
            }
          }
        }
      }
    }
    LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion(),hasDynamicMetadata);
  }
}
Program: 126843
Project: 126843
Buggy source:
public static void fillConnectionsForStat(List<String> connsName,INode currentNode){
  for (  IConnection conn : currentNode.getOutgoingConnections()) {
    if (conn.getLineStyle() == EConnectionType.FLOW_MAIN) {
      connsName.add(conn.getUniqueName());
      fillConnectionsForStat(connsName,conn.getTarget());
    }
 else     if (conn.getLineStyle() == EConnectionType.FLOW_MERGE) {
      connsName.add(conn.getUniqueName());
      continue;
    }
 else     if (conn.getLineStyle() == EConnectionType.ON_ROWS_END) {
      connsName.add(conn.getUniqueName());
      fillConnectionsForStat(connsName,conn.getTarget());
    }
  }
}

Fixed version (ground truth):
public static void fillConnectionsForStat(List<String> connsName,INode currentNode){
  for (  IConnection conn : currentNode.getOutgoingConnections()) {
    if (conn.getLineStyle() == EConnectionType.FLOW_MAIN) {
      if (!(currentNode.isVirtualGenerateNode() && currentNode.getVirtualLinkTo() != null)) {
        connsName.add(conn.getUniqueName());
      }
      fillConnectionsForStat(connsName,conn.getTarget());
    }
 else     if (conn.getLineStyle() == EConnectionType.FLOW_MERGE) {
      connsName.add(conn.getUniqueName());
      continue;
    }
 else     if (conn.getLineStyle() == EConnectionType.ON_ROWS_END) {
      fillConnectionsForStat(connsName,conn.getTarget());
    }
  }
}
Program: 126845
Project: 126845
Buggy source:
/** 
 * This method is used when export job , check if one of the database component node use dynamic metadata
 */
private static void checkMetadataDynamic(ProcessItem selectedProcessItem,JobInfo jobInfo){
  if (exportConfig && !LastGenerationInfo.getInstance().isUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion())) {
    boolean hasDynamicMetadata=false;
    final ProcessType process=selectedProcessItem.getProcess();
    if (process != null) {
      out:       for (      NodeType node : (List<NodeType>)process.getNode()) {
        boolean isDbNode=false;
        for (        ElementParameterType param : (List<ElementParameterType>)node.getElementParameter()) {
          if ("String_Node_Str".equals(param.getName()) && "String_Node_Str".equals(param.getField()) && param.getValue() != null && !"String_Node_Str".equals(param.getValue())) {
            isDbNode=true;
            break;
          }
        }
        if (isDbNode) {
          for (          MetadataType metadataType : (List<MetadataType>)node.getMetadata()) {
            for (            ColumnType column : (List<ColumnType>)metadataType.getColumn()) {
              if ("String_Node_Str".equals(column.getType())) {
                hasDynamicMetadata=true;
                break out;
              }
            }
          }
        }
      }
    }
    LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion(),hasDynamicMetadata);
  }
}

Fixed version (ground truth):
/** 
 * This method is used when export job or joblet , check if one of the database component node use dynamic metadata
 */
private static void checkMetadataDynamic(IProcess currentProcess,JobInfo jobInfo){
  if (exportConfig && !LastGenerationInfo.getInstance().isUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion())) {
    boolean hasDynamicMetadata=false;
    out:     for (    INode node : (List<? extends INode>)currentProcess.getGeneratingNodes()) {
      boolean isDbNode=false;
      for (      IElementParameter param : (List<? extends IElementParameter>)node.getElementParameters()) {
        if ("String_Node_Str".equals(param.getName()) && "String_Node_Str".equals(param.getFieldType().getName()) && param.getValue() != null && !"String_Node_Str".equals(param.getValue())) {
          isDbNode=true;
          break;
        }
      }
      if (isDbNode) {
        for (        IMetadataTable metadataTable : node.getMetadataList()) {
          for (          IMetadataColumn column : metadataTable.getListColumns()) {
            if ("String_Node_Str".equals(column.getTalendType())) {
              hasDynamicMetadata=true;
              break out;
            }
          }
        }
      }
    }
    LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion(),hasDynamicMetadata);
  }
}
Program: 126846
Project: 126846
Buggy source:
public static void fillConnectionsForStat(List<String> connsName,INode currentNode){
  for (  IConnection conn : currentNode.getOutgoingConnections()) {
    if (conn.getLineStyle() == EConnectionType.FLOW_MAIN) {
      connsName.add(conn.getUniqueName());
      fillConnectionsForStat(connsName,conn.getTarget());
    }
 else     if (conn.getLineStyle() == EConnectionType.FLOW_MERGE) {
      connsName.add(conn.getUniqueName());
      continue;
    }
 else     if (conn.getLineStyle() == EConnectionType.ON_ROWS_END) {
      connsName.add(conn.getUniqueName());
      fillConnectionsForStat(connsName,conn.getTarget());
    }
  }
}

Fixed version (ground truth):
public static void fillConnectionsForStat(List<String> connsName,INode currentNode){
  for (  IConnection conn : currentNode.getOutgoingConnections()) {
    if (conn.getLineStyle() == EConnectionType.FLOW_MAIN) {
      if (!(currentNode.isVirtualGenerateNode() && currentNode.getVirtualLinkTo() != null)) {
        connsName.add(conn.getUniqueName());
      }
      fillConnectionsForStat(connsName,conn.getTarget());
    }
 else     if (conn.getLineStyle() == EConnectionType.FLOW_MERGE) {
      connsName.add(conn.getUniqueName());
      continue;
    }
 else     if (conn.getLineStyle() == EConnectionType.ON_ROWS_END) {
      fillConnectionsForStat(connsName,conn.getTarget());
    }
  }
}
Program: 126848
Project: 126848
Buggy source:
public static void fillConnectionsForStat(List<String> connsName,INode currentNode){
  for (  IConnection conn : currentNode.getOutgoingConnections()) {
    if (conn.getLineStyle() == EConnectionType.FLOW_MAIN) {
      connsName.add(conn.getUniqueName());
      fillConnectionsForStat(connsName,conn.getTarget());
    }
 else     if (conn.getLineStyle() == EConnectionType.FLOW_MERGE) {
      connsName.add(conn.getUniqueName());
      continue;
    }
 else     if (conn.getLineStyle() == EConnectionType.ON_ROWS_END) {
      connsName.add(conn.getUniqueName());
      fillConnectionsForStat(connsName,conn.getTarget());
    }
  }
}

Fixed version (ground truth):
public static void fillConnectionsForStat(List<String> connsName,INode currentNode){
  for (  IConnection conn : currentNode.getOutgoingConnections()) {
    if (conn.getLineStyle() == EConnectionType.FLOW_MAIN) {
      if (!(currentNode.isVirtualGenerateNode() && currentNode.getVirtualLinkTo() != null)) {
        connsName.add(conn.getUniqueName());
      }
      fillConnectionsForStat(connsName,conn.getTarget());
    }
 else     if (conn.getLineStyle() == EConnectionType.FLOW_MERGE) {
      connsName.add(conn.getUniqueName());
      continue;
    }
 else     if (conn.getLineStyle() == EConnectionType.ON_ROWS_END) {
      fillConnectionsForStat(connsName,conn.getTarget());
    }
  }
}
Program: 126849
Project: 126849
Buggy source:
/** 
 * This method is used when export job , check if one of the database component node use dynamic metadata
 */
private static void checkMetadataDynamic(ProcessItem selectedProcessItem,JobInfo jobInfo){
  if (exportConfig && !LastGenerationInfo.getInstance().isUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion())) {
    boolean hasDynamicMetadata=false;
    final ProcessType process=selectedProcessItem.getProcess();
    if (process != null) {
      out:       for (      NodeType node : (List<NodeType>)process.getNode()) {
        boolean isDbNode=false;
        for (        ElementParameterType param : (List<ElementParameterType>)node.getElementParameter()) {
          if ("String_Node_Str".equals(param.getName()) && "String_Node_Str".equals(param.getField()) && param.getValue() != null && !"String_Node_Str".equals(param.getValue())) {
            isDbNode=true;
            break;
          }
        }
        if (isDbNode) {
          for (          MetadataType metadataType : (List<MetadataType>)node.getMetadata()) {
            for (            ColumnType column : (List<ColumnType>)metadataType.getColumn()) {
              if ("String_Node_Str".equals(column.getType())) {
                hasDynamicMetadata=true;
                break out;
              }
            }
          }
        }
      }
    }
    LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion(),hasDynamicMetadata);
  }
}

Fixed version (ground truth):
/** 
 * This method is used when export job or joblet , check if one of the database component node use dynamic metadata
 */
private static void checkMetadataDynamic(IProcess currentProcess,JobInfo jobInfo){
  if (exportConfig && !LastGenerationInfo.getInstance().isUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion())) {
    boolean hasDynamicMetadata=false;
    out:     for (    INode node : (List<? extends INode>)currentProcess.getGeneratingNodes()) {
      boolean isDbNode=false;
      for (      IElementParameter param : (List<? extends IElementParameter>)node.getElementParameters()) {
        if ("String_Node_Str".equals(param.getName()) && "String_Node_Str".equals(param.getFieldType().getName()) && param.getValue() != null && !"String_Node_Str".equals(param.getValue())) {
          isDbNode=true;
          break;
        }
      }
      if (isDbNode) {
        for (        IMetadataTable metadataTable : node.getMetadataList()) {
          for (          IMetadataColumn column : metadataTable.getListColumns()) {
            if ("String_Node_Str".equals(column.getTalendType())) {
              hasDynamicMetadata=true;
              break out;
            }
          }
        }
      }
    }
    LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion(),hasDynamicMetadata);
  }
}
Program: 126851
Project: 126851
Buggy source:
@Override public RootContainer<String,IRepositoryViewObject> getTdqRepositoryViewObjects(Project project,ERepositoryObjectType type,String folderName,boolean[] options) throws PersistenceException {
  String relativeFolder=folderName;
  if (type != null && type.hasFolder()) {
    String baseFolder=ERepositoryObjectType.getFolderName(type);
    relativeFolder=StringUtils.removeStart(relativeFolder,baseFolder);
  }
  return getObjectFromFolder(project,type,relativeFolder,true,options);
}

Fixed version (ground truth):
@Override public RootContainer<String,IRepositoryViewObject> getTdqRepositoryViewObjects(Project project,ERepositoryObjectType type,String folderName,boolean[] options) throws PersistenceException {
  String relativeFolder=folderName;
  if (type != null && type.hasFolder()) {
    String baseFolder=ERepositoryObjectType.getFolderName(type);
    relativeFolder=StringUtils.removeStart(relativeFolder,baseFolder);
  }
  return getObjectFromFolder(project,type,relativeFolder,OPTION_ONLY_LAST_VERSION | OPTION_DYNAMIC_OBJECTS);
}
Program: 126853
Project: 126853
Buggy source:
/** 
 * DOC wliu <p> get the original connection instance className of the pamameter:conn.\n It is used to help optimize the code to avoid 65535 bytes in a method </p> Notice: It is used in tFileOutputMSXML in TDI-21606
 * @param connection
 * @return
 */
public static String getPrivateConnClassName(final IConnection conn){
  if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
    INode node=conn.getSource();
    if (node.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(node))) {
      return conn.getUniqueName();
    }
    List<? extends IConnection> listInConns=node.getIncomingConnections();
    if (listInConns != null && listInConns.size() > 0) {
      String retResult=getPrivateConnClassName(listInConns.get(0));
      if (retResult == null) {
        return conn.getUniqueName();
      }
 else {
        return retResult;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC wliu <p> get the original connection instance className of the pamameter:conn.\n It is used to help optimize the code to avoid 65535 bytes in a method </p> Notice: It is used in tFileOutputMSXML in TDI-21606
 * @param connection
 * @return
 */
public static String getPrivateConnClassName(final IConnection conn){
  if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
    INode node=conn.getSource();
    if (node.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(node))) {
      return conn.getName();
    }
    List<? extends IConnection> listInConns=node.getIncomingConnections();
    if (listInConns != null && listInConns.size() > 0) {
      String retResult=getPrivateConnClassName(listInConns.get(0));
      if (retResult == null) {
        return conn.getName();
      }
 else {
        return retResult;
      }
    }
  }
  return null;
}
Program: 126858
Project: 126858
Buggy source:
public static String addShutDownForHSQLUrl(String url,String AdditionalParams){
  String dbUrl=url;
  boolean isHSQL=ConnectionUtils.isHsql(dbUrl);
  if (isHSQL && AdditionalParams.indexOf(SHUTDOWN_PARAM) == -1) {
    dbUrl=dbUrl + SHUTDOWN_PARAM;
  }
  return dbUrl;
}

Fixed version (ground truth):
/** 
 * add ";shutdown=true" to the end of the hsql url when the url don't contain it.
 * @param url
 * @param AdditionalParams
 * @return String the url after added
 */
public static String addShutDownForHSQLUrl(String url,String AdditionalParams){
  String dbUrl=url;
  boolean isHSQL=ConnectionUtils.isHsql(dbUrl);
  if (isHSQL && AdditionalParams.indexOf(SHUTDOWN_PARAM) == -1) {
    dbUrl=dbUrl + SHUTDOWN_PARAM;
  }
  return dbUrl;
}
Program: 126859
Project: 126859
Buggy source:
public static boolean isServerModeHsql(String url){
  return url != null && url.startsWith("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * from the url to check whether the hsql is Server Mode.
 * @param url
 * @return
 */
public static boolean isServerModeHsql(String url){
  return url != null && url.startsWith("String_Node_Str");
}
Program: 126860
Project: 126860
Buggy source:
public static boolean isHsql(String url){
  return url != null && url.startsWith("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * from the url to check whether it is hsql.
 * @param url
 * @return
 */
public static boolean isHsql(String url){
  return url != null && url.startsWith("String_Node_Str");
}
Program: 126861
Project: 126861
Buggy source:
public static void executeShutDownForHSQL(java.sql.Connection connection) throws SQLException {
  Statement statement=connection.createStatement();
  statement.executeUpdate("String_Node_Str");
  statement.close();
}

Fixed version (ground truth):
/** 
 * execute ShutDown For HSQL connection.
 * @param connection
 * @throws SQLException
 */
public static void executeShutDownForHSQL(java.sql.Connection connection) throws SQLException {
  Statement statement=connection.createStatement();
  statement.executeUpdate("String_Node_Str");
  statement.close();
}
Program: 126863
Project: 126863
Buggy source:
public void closeConnection(boolean force){
  try {
    if (conn != null && !conn.isClosed()) {
      if (isReconnect || force) {
        if (conn.getMetaData() != null) {
          String url=conn.getMetaData().getURL();
          boolean isHsql=ConnectionUtils.isHsql(url);
          if (isHsql) {
            Statement statement=conn.createStatement();
            statement.executeUpdate("String_Node_Str");
          }
        }
        conn.close();
      }
    }
  }
 catch (  SQLException e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
catch (  Exception e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void closeConnection(boolean force){
  try {
    if (conn != null && !conn.isClosed()) {
      if (isReconnect || force) {
        if (conn.getMetaData() != null) {
          String url=conn.getMetaData().getURL();
          boolean isHsql=ConnectionUtils.isHsql(url);
          if (isHsql && !ConnectionUtils.isServerModeHsql(url)) {
            ConnectionUtils.executeShutDownForHSQL(conn);
          }
        }
        conn.close();
      }
    }
  }
 catch (  SQLException e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
catch (  Exception e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
}
Program: 126865
Project: 126865
Buggy source:
public boolean getEnabledState(){
  return super.getEnabledState() && this.enableStateHandler.getEnabledState();
}

Fixed version (ground truth):
@Override public boolean getEnabledState(){
  return super.getEnabledState() && this.enableStateHandler.getEnabledState();
}
Program: 126866
Project: 126866
Buggy source:
protected Command getCommandToExecute(){
  AbstractExtendedTableViewer extendedTableViewer=(AbstractExtendedTableViewer)extendedControlViewer;
  TableViewer tableViewer=extendedTableViewer.getTableViewerCreator().getTableViewer();
  ISelection selection=tableViewer.getSelection();
  StructuredSelection structuredSelection=(StructuredSelection)selection;
  Object[] objects=structuredSelection.toArray();
  colNum=getExtendedTableViewer().getTableViewerCreator().getTable().getColumnCount();
  return new ExtendedTableCopyCommand(Arrays.asList(objects));
}

Fixed version (ground truth):
@Override protected Command getCommandToExecute(){
  AbstractExtendedTableViewer extendedTableViewer=(AbstractExtendedTableViewer)extendedControlViewer;
  TableViewer tableViewer=extendedTableViewer.getTableViewerCreator().getTableViewer();
  ISelection selection=tableViewer.getSelection();
  StructuredSelection structuredSelection=(StructuredSelection)selection;
  Object[] objects=structuredSelection.toArray();
  return new ExtendedTableCopyCommand(Arrays.asList(objects));
}
Program: 126867
Project: 126867
Buggy source:
public boolean getEnabledState(){
  Object data=SimpleClipboard.getInstance().getData();
  boolean flag=true;
  int a=CopyPushButtonForExtendedTable.colNum;
  int colNum=getExtendedTableViewer().getTableViewerCreator().getTable().getColumnCount();
  if (data != null) {
    if (colNum == a) {
      flag=true;
    }
 else {
      flag=false;
    }
  }
  return super.getEnabledState() && data != null && data instanceof List && !getExtendedControlViewer().isReadOnly() && flag;
}

Fixed version (ground truth):
@Override public boolean getEnabledState(){
  Object data=SimpleClipboard.getInstance().getData();
  return super.getEnabledState() && data != null && data instanceof List && !getExtendedControlViewer().isReadOnly();
}
Program: 126880
Project: 126880
Buggy source:
/** 
 * DOC wliu <p> get the original connection instance className of the pamameter:conn.\n It is used to help optimize the code to avoid 65535 bytes in a method </p> Notice: It is used in tFileOutputMSXML in TDI-21606
 * @param connection
 * @return
 */
public static String getPrivateConnClassName(final IConnection conn){
  if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
    INode node=conn.getSource();
    if (node.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(node))) {
      return conn.getUniqueName();
    }
    List<? extends IConnection> listInConns=node.getIncomingConnections();
    if (listInConns != null && listInConns.size() > 0) {
      String retResult=getPrivateConnClassName(listInConns.get(0));
      if (retResult == null) {
        return conn.getUniqueName();
      }
 else {
        return retResult;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC wliu <p> get the original connection instance className of the pamameter:conn.\n It is used to help optimize the code to avoid 65535 bytes in a method </p> Notice: It is used in tFileOutputMSXML in TDI-21606
 * @param connection
 * @return
 */
public static String getPrivateConnClassName(final IConnection conn){
  if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
    INode node=conn.getSource();
    if (node.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(node))) {
      return conn.getName();
    }
    List<? extends IConnection> listInConns=node.getIncomingConnections();
    if (listInConns != null && listInConns.size() > 0) {
      String retResult=getPrivateConnClassName(listInConns.get(0));
      if (retResult == null) {
        return conn.getName();
      }
 else {
        return retResult;
      }
    }
  }
  return null;
}
Program: 126886
Project: 126886
Buggy source:
private String getFolderPath(FolderItem folder,String path){
  if (FolderType.FOLDER_LITERAL.equals(folder.getType())) {
    final EObject parent=folder.getParent();
    if (parent instanceof FolderItem) {
      FolderItem parentFolder=(FolderItem)parent;
      if (parentFolder.getParent() instanceof Project) {
        if (path == null) {
          path="String_Node_Str";
        }
        return path;
      }
      if (path == null || "String_Node_Str".equals(path)) {
        path=parentFolder.getProperty().getLabel();
      }
 else {
        path=parentFolder.getProperty().getLabel() + "String_Node_Str" + path;
      }
      return getFolderPath(parentFolder,path);
    }
    return path;
  }
 else {
    return path;
  }
}

Fixed version (ground truth):
private String getFolderPath(FolderItem folder,String path){
  if (FolderType.FOLDER_LITERAL.equals(folder.getType())) {
    final EObject parent=folder.getParent();
    if (parent instanceof FolderItem) {
      FolderItem parentFolder=(FolderItem)parent;
      if (FolderType.SYSTEM_FOLDER_LITERAL.equals(parentFolder.getType())) {
        if (path == null) {
          path="String_Node_Str";
        }
        return path;
      }
      if (path == null || "String_Node_Str".equals(path)) {
        path=parentFolder.getProperty().getLabel();
      }
 else {
        path=parentFolder.getProperty().getLabel() + "String_Node_Str" + path;
      }
      return getFolderPath(parentFolder,path);
    }
    return path;
  }
 else {
    return path;
  }
}