nus-yam/ex-repair huggingface dataset:
Program: 122367
Project: 122367
Buggy source:
@Override protected void addMavenBuildScripts(List<URL> scriptsUrls,Map<String,String> mavenPropertiesMap){
  IExportJobResourcesService resourcesService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IExportJobResourcesService.class)) {
    resourcesService=(IExportJobResourcesService)GlobalServiceRegister.getDefault().getService(IExportJobResourcesService.class);
  }
  if (resourcesService == null) {
    return;
  }
  String mavenScript=resourcesService.getScriptFromPreferenceStore(IExportJobPrefConstants.MAVEN_OSGI_SCRIPT_TEMPLATE);
  if (mavenScript == null) {
    return;
  }
  File mavenBuildFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_BUILD_FILE_NAME);
  try {
    FileOutputStream mavenBuildFileOutputStream=null;
    try {
      mavenBuildFileOutputStream=new FileOutputStream(mavenBuildFile);
      mavenBuildFileOutputStream.write(mavenScript.getBytes());
    }
  finally {
      if (mavenBuildFileOutputStream != null) {
        mavenBuildFileOutputStream.close();
      }
    }
    updateMavenBuildFileContent(mavenBuildFile,mavenPropertiesMap,true);
    scriptsUrls.add(mavenBuildFile.toURL());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
@Override protected void addMavenBuildScripts(List<URL> scriptsUrls,Map<String,String> mavenPropertiesMap){
  IExportJobResourcesService resourcesService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IExportJobResourcesService.class)) {
    resourcesService=(IExportJobResourcesService)GlobalServiceRegister.getDefault().getService(IExportJobResourcesService.class);
  }
  if (resourcesService == null) {
    return;
  }
  String mavenScript=resourcesService.getScriptFromPreferenceStore(IExportJobPrefConstants.MAVEN_OSGI_SCRIPT_TEMPLATE);
  if (mavenScript == null) {
    return;
  }
  File mavenBuildFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_BUILD_FILE_NAME);
  try {
    FileOutputStream mavenBuildFileOutputStream=null;
    try {
      mavenBuildFileOutputStream=new FileOutputStream(mavenBuildFile);
      mavenBuildFileOutputStream.write(mavenScript.getBytes());
    }
  finally {
      if (mavenBuildFileOutputStream != null) {
        mavenBuildFileOutputStream.close();
      }
    }
    updateMavenBuildFileContent(mavenBuildFile,mavenPropertiesMap,true,false);
    scriptsUrls.add(mavenBuildFile.toURL());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}
Program: 122369
Project: 122369
Buggy source:
public void transform(NodeType node){
  ElementParameterType db_version=ComponentUtilities.getNodeProperty(node,"String_Node_Str");
  if (db_version != null) {
    String jar_value=db_version.getValue();
    if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
      db_version.setValue("String_Node_Str");
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
      db_version.setValue("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void transform(NodeType node){
  ElementParameterType dbVersion=ComponentUtilities.getNodeProperty(node,"String_Node_Str");
  if (dbVersion != null) {
    String jarValue=dbVersion.getValue();
    if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
      dbVersion.setValue("String_Node_Str");
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
      dbVersion.setValue("String_Node_Str");
    }
  }
}
Program: 122370
Project: 122370
Buggy source:
public Date getOrder(){
  GregorianCalendar gc=new GregorianCalendar(2012,9,26,10,0,0);
  return gc.getTime();
}

Fixed version (ground truth):
public Date getOrder(){
  GregorianCalendar gc=new GregorianCalendar(2012,10,26,10,0,0);
  return gc.getTime();
}
Program: 122371
Project: 122371
Buggy source:
@Override public ExecutionResult execute(Item item){
  ProcessType processType=getProcessType(item);
  String[] mysqlCompNames={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  IComponentConversion changeOracleDriverJarType=new IComponentConversion(){
    public void transform(    NodeType node){
      ElementParameterType db_version=ComponentUtilities.getNodeProperty(node,"String_Node_Str");
      if (db_version != null) {
        String jar_value=db_version.getValue();
        if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
          db_version.setValue("String_Node_Str");
        }
 else         if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
          db_version.setValue("String_Node_Str");
        }
      }
    }
  }
;
  for (  String name : mysqlCompNames) {
    IComponentFilter filter=new NameComponentFilter(name);
    try {
      ModifyComponentsAction.searchAndModify(item,processType,filter,Arrays.<IComponentConversion>asList(changeOracleDriverJarType));
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
      return ExecutionResult.FAILURE;
    }
  }
  return ExecutionResult.SUCCESS_NO_ALERT;
}

Fixed version (ground truth):
@Override public ExecutionResult execute(Item item){
  ProcessType processType=getProcessType(item);
  String[] mysqlCompNames={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  IComponentConversion changeOracleDriverJarType=new IComponentConversion(){
    public void transform(    NodeType node){
      ElementParameterType dbVersion=ComponentUtilities.getNodeProperty(node,"String_Node_Str");
      if (dbVersion != null) {
        String jarValue=dbVersion.getValue();
        if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
          dbVersion.setValue("String_Node_Str");
        }
 else         if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
          dbVersion.setValue("String_Node_Str");
        }
      }
    }
  }
;
  for (  String name : mysqlCompNames) {
    IComponentFilter filter=new NameComponentFilter(name);
    try {
      ModifyComponentsAction.searchAndModify(item,processType,filter,Arrays.<IComponentConversion>asList(changeOracleDriverJarType));
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
      return ExecutionResult.FAILURE;
    }
  }
  return ExecutionResult.SUCCESS_NO_ALERT;
}
Program: 122372
Project: 122372
Buggy source:
public void transform(NodeType node){
  ElementParameterType db_version=ComponentUtilities.getNodeProperty(node,"String_Node_Str");
  if (db_version != null) {
    String jar_value=db_version.getValue();
    if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
      db_version.setValue("String_Node_Str");
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
      db_version.setValue("String_Node_Str");
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
      db_version.setValue("String_Node_Str");
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jar_value)) {
      db_version.setValue("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void transform(NodeType node){
  ElementParameterType dbVersion=ComponentUtilities.getNodeProperty(node,"String_Node_Str");
  if (dbVersion != null) {
    String jarValue=dbVersion.getValue();
    if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
      dbVersion.setValue("String_Node_Str");
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
      dbVersion.setValue("String_Node_Str");
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
      dbVersion.setValue("String_Node_Str");
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
    }
 else     if ("String_Node_Str".equalsIgnoreCase(jarValue)) {
      dbVersion.setValue("String_Node_Str");
    }
  }
}
Program: 122381
Project: 122381
Buggy source:
protected List<URL> getBuildScriptLibraries(){
  List<URL> list=new ArrayList<URL>();
  if (isOptionChoosed(ExportChoice.needAntScript)) {
    Bundle bundle=Platform.getBundle(org.talend.resources.ResourcesPlugin.PLUGIN_ID);
    Enumeration entryPaths=bundle.getEntryPaths(IExportJobConstants.ANT_BUILD_SCRIPT_LIB_DIR);
    if (entryPaths == null) {
      return list;
    }
    while (entryPaths.hasMoreElements()) {
      Object entryPath=entryPaths.nextElement();
      if (entryPath != null && entryPath instanceof String) {
        String path=(String)entryPath;
        if (path.endsWith(FileConstants.JAR_FILE_SUFFIX)) {
          URL entry=bundle.getEntry(path);
          if (entry != null) {
            try {
              URL fileUrl=FileLocator.toFileURL(entry);
              list.add(fileUrl);
            }
 catch (            Exception e) {
              continue;
            }
          }
        }
      }
    }
  }
 else   if (isOptionChoosed(ExportChoice.needMavenScript)) {
  }
  return list;
}

Fixed version (ground truth):
protected List<URL> getBuildScriptLibraries(){
  List<URL> list=new ArrayList<URL>();
  if (isOptionChoosed(ExportChoice.needAntScript)) {
    IExportJobResourcesService resourcesService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IExportJobResourcesService.class)) {
      resourcesService=(IExportJobResourcesService)GlobalServiceRegister.getDefault().getService(IExportJobResourcesService.class);
    }
    if (resourcesService != null) {
      list=resourcesService.getAntRequiredLibs();
    }
  }
 else   if (isOptionChoosed(ExportChoice.needMavenScript)) {
  }
  return list;
}
Program: 122384
Project: 122384
Buggy source:
@SuppressWarnings("String_Node_Str") public ExternalNodeChangeCommand(Node node,IExternalNode externalNode,IExternalData oldExternalData,boolean... bs){
  if (bs.length > 0)   this.isMetaLanguage=bs[0];
  this.node=node;
  this.inAndOut=externalNode.getIODataComponents();
  this.oldExternalData=oldExternalData;
  oldMetaDataList=node.getMetadataList();
  newExternalData=externalNode.getExternalData();
  newMetaDataList=externalNode.getMetadataList();
  init();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public ExternalNodeChangeCommand(Node node,IExternalNode externalNode,IExternalData oldExternalData,boolean... bs){
  if (bs.length > 0) {
    this.isMetaLanguage=bs[0];
  }
  this.node=node;
  this.inAndOut=externalNode.getIODataComponents();
  this.oldExternalData=oldExternalData;
  oldMetaDataList=node.getMetadataList();
  newExternalData=externalNode.getExternalData();
  newMetaDataList=externalNode.getMetadataList();
  init();
}
Program: 122388
Project: 122388
Buggy source:
/** 
 * DOC ycbai Comment method "checkJavaProjectLib".
 * @param jarsNeeded
 */
public static void checkJavaProjectLib(Collection<String> jarsNeeded){
  File libDir=getJavaProjectLibFolder();
  if ((libDir != null) && (libDir.isDirectory())) {
    Set<String> jarsNeedRetrieve=new HashSet<String>(jarsNeeded);
    for (    File externalLib : libDir.listFiles(FilesUtils.getAcceptJARFilesFilter())) {
      jarsNeedRetrieve.remove(externalLib.getName());
    }
    if (!jarsNeedRetrieve.isEmpty()) {
      ILibraryManagerService repositoryBundleService=CorePlugin.getDefault().getRepositoryBundleService();
      repositoryBundleService.retrieve(jarsNeedRetrieve,libDir.getAbsolutePath());
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "checkJavaProjectLib".
 * @param jarsNeeded
 */
public static void checkJavaProjectLib(Collection<String> jarsNeeded){
  File libDir=getJavaProjectLibFolder();
  if ((libDir != null) && (libDir.isDirectory())) {
    Set<String> jarsNeedRetrieve=new HashSet<String>(jarsNeeded);
    for (    File externalLib : libDir.listFiles(FilesUtils.getAcceptJARFilesFilter())) {
      jarsNeedRetrieve.remove(externalLib.getName());
    }
    if (!jarsNeedRetrieve.isEmpty()) {
      ILibraryManagerService repositoryBundleService=CorePlugin.getDefault().getRepositoryBundleService();
      repositoryBundleService.retrieve(jarsNeedRetrieve,libDir.getAbsolutePath(),false);
    }
  }
}
Program: 122390
Project: 122390
Buggy source:
protected boolean enableNeededLibraries(ModuleNeeded module){
  if (module.getBundleName() == null || "String_Node_Str".equals(module.getBundleName())) {
    return !isExcludedLib(module.getModuleName());
  }
  return false;
}

Fixed version (ground truth):
protected boolean enableNeededLibraries(ModuleNeeded module){
  if (module.getBundleName() == null) {
    return !isExcludedLib(module.getModuleName());
  }
  return false;
}
Program: 122391
Project: 122391
Buggy source:
/** 
 * Hook method for saving widget values for restoration by the next instance of this class.
 */
protected void internalSaveWidgetValues(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    if (directoryNames == null) {
      directoryNames=new String[0];
    }
    directoryNames=addToHistory(directoryNames,getDestinationValue());
    settings.put(STORE_DESTINATION_NAMES_ID,directoryNames);
    settings.put(STORE_SHELL_LAUNCHER_ID,shellLauncherButton.getSelection());
    settings.put(STORE_SYSTEM_ROUTINE_ID,systemRoutineButton.getSelection());
    settings.put(STORE_USER_ROUTINE_ID,userRoutineButton.getSelection());
    settings.put(STORE_MODEL_ID,modelButton.getSelection());
    settings.put(STORE_JOB_ID,jobItemButton.getSelection());
    settings.put(STORE_SOURCE_ID,jobScriptButton.getSelection());
    settings.put(STORE_CONTEXT_ID,contextButton.getSelection());
    settings.put(APPLY_TO_CHILDREN_ID,applyToChildrenButton.getSelection());
  }
}

Fixed version (ground truth):
/** 
 * Hook method for saving widget values for restoration by the next instance of this class.
 */
@Override protected void internalSaveWidgetValues(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    if (directoryNames == null) {
      directoryNames=new String[0];
    }
    directoryNames=addToHistory(directoryNames,getDestinationValue());
    settings.put(STORE_DESTINATION_NAMES_ID,directoryNames);
    settings.put(STORE_SHELL_LAUNCHER_ID,shellLauncherButton.getSelection());
    settings.put(STORE_SYSTEM_ROUTINE_ID,systemRoutineButton.getSelection());
    settings.put(STORE_USER_ROUTINE_ID,userRoutineButton.getSelection());
    settings.put(STORE_MODEL_ID,modelButton.getSelection());
    settings.put(STORE_JOB_ID,jobItemButton.getSelection());
    settings.put(STORE_SOURCE_ID,jobScriptButton.getSelection());
    settings.put(STORE_CONTEXT_ID,contextButton.getSelection());
    settings.put(APPLY_TO_CHILDREN_ID,applyToChildrenButton.getSelection());
  }
}
Program: 122393
Project: 122393
Buggy source:
protected Map<ExportChoice,Object> getExportChoiceMap(){
  Map<ExportChoice,Object> exportChoiceMap=new EnumMap<ExportChoice,Object>(ExportChoice.class);
  exportChoiceMap.put(ExportChoice.needLauncher,shellLauncherButton.getSelection());
  exportChoiceMap.put(ExportChoice.needSystemRoutine,systemRoutineButton.getSelection());
  exportChoiceMap.put(ExportChoice.needUserRoutine,userRoutineButton.getSelection());
  exportChoiceMap.put(ExportChoice.needTalendLibraries,modelButton.getSelection());
  exportChoiceMap.put(ExportChoice.needJobItem,jobItemButton.getSelection());
  exportChoiceMap.put(ExportChoice.needJobScript,jobScriptButton.getSelection());
  exportChoiceMap.put(ExportChoice.needContext,contextButton.getSelection());
  exportChoiceMap.put(ExportChoice.applyToChildren,applyToChildrenButton.getSelection());
  return exportChoiceMap;
}

Fixed version (ground truth):
@Override protected Map<ExportChoice,Object> getExportChoiceMap(){
  Map<ExportChoice,Object> exportChoiceMap=new EnumMap<ExportChoice,Object>(ExportChoice.class);
  exportChoiceMap.put(ExportChoice.needLauncher,shellLauncherButton.getSelection());
  exportChoiceMap.put(ExportChoice.needSystemRoutine,systemRoutineButton.getSelection());
  exportChoiceMap.put(ExportChoice.needUserRoutine,userRoutineButton.getSelection());
  exportChoiceMap.put(ExportChoice.needTalendLibraries,modelButton.getSelection());
  exportChoiceMap.put(ExportChoice.needJobItem,jobItemButton.getSelection());
  exportChoiceMap.put(ExportChoice.needJobScript,jobScriptButton.getSelection());
  exportChoiceMap.put(ExportChoice.needContext,contextButton.getSelection());
  exportChoiceMap.put(ExportChoice.applyToChildren,applyToChildrenButton.getSelection());
  return exportChoiceMap;
}
Program: 122394
Project: 122394
Buggy source:
protected List<ExportFileResource> getExportResources() throws ProcessorException {
  return manager.getExportResources(process);
}

Fixed version (ground truth):
@Override protected List<ExportFileResource> getExportResources() throws ProcessorException {
  return getManager().getExportResources(process);
}
Program: 122395
Project: 122395
Buggy source:
/** 
 * Answer the string to display in self as the destination type.
 * @return java.lang.String
 */
protected String getDestinationLabel(){
  return Messages.getString("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Answer the string to display in self as the destination type.
 * @return java.lang.String
 */
@Override protected String getDestinationLabel(){
  return Messages.getString("String_Node_Str");
}
Program: 122396
Project: 122396
Buggy source:
protected boolean validateSourceGroup(){
  return true;
}

Fixed version (ground truth):
@Override protected boolean validateSourceGroup(){
  return true;
}
Program: 122397
Project: 122397
Buggy source:
protected String destinationEmptyMessage(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override protected String destinationEmptyMessage(){
  return "String_Node_Str";
}
Program: 122398
Project: 122398
Buggy source:
private void addTreeNode(RepositoryNode node,String path,List<ExportFileResource> list){
  if (node != null && node.getType() == ENodeType.REPOSITORY_ELEMENT) {
    IRepositoryViewObject repositoryObject=node.getObject();
    if (repositoryObject.getProperty().getItem() instanceof ProcessItem) {
      ProcessItem processItem=(ProcessItem)repositoryObject.getProperty().getItem();
      ExportFileResource resource=new ExportFileResource(processItem,path);
      resource.setNode(node);
      list.add(resource);
    }
  }
  Object[] nodes=node.getChildren().toArray();
  if (nodes.length <= 0) {
    return;
  }
  for (int i=0; i < nodes.length; i++) {
    addTreeNode((RepositoryNode)nodes[i],path + "String_Node_Str" + ((RepositoryNode)nodes[i]).getProperties(EProperties.LABEL).toString(),list);
  }
}

Fixed version (ground truth):
private void addTreeNode(RepositoryNode node,String path,List<ExportFileResource> list){
  if (node != null && node.getType() == ENodeType.REPOSITORY_ELEMENT) {
    IRepositoryViewObject repositoryObject=node.getObject();
    if (repositoryObject.getProperty().getItem() instanceof ProcessItem) {
      ProcessItem processItem=(ProcessItem)repositoryObject.getProperty().getItem();
      ExportFileResource resource=new ExportFileResource(processItem,path);
      resource.setNode(node);
      list.add(resource);
    }
  }
  Object[] nodes=node.getChildren().toArray();
  if (nodes.length <= 0) {
    return;
  }
  for (  Object node2 : nodes) {
    addTreeNode((RepositoryNode)node2,path + "String_Node_Str" + ((RepositoryNode)node2).getProperties(EProperties.LABEL).toString(),list);
  }
}
Program: 122399
Project: 122399
Buggy source:
/** 
 * Hook method for saving widget values for restoration by the next instance of this class.
 */
protected void internalSaveWidgetValues(){
}

Fixed version (ground truth):
/** 
 * Hook method for saving widget values for restoration by the next instance of this class.
 */
@Override protected void internalSaveWidgetValues(){
}
Program: 122400
Project: 122400
Buggy source:
/** 
 * Hook method for restoring widget values to the values that they held last time this wizard was used to completion.
 */
protected void restoreWidgetValues(){
}

Fixed version (ground truth):
/** 
 * Hook method for restoring widget values to the values that they held last time this wizard was used to completion.
 */
@Override protected void restoreWidgetValues(){
}
Program: 122401
Project: 122401
Buggy source:
/** 
 * Create an instance of this class.
 * @param name java.lang.String
 */
protected SpagicDeployWizardPage(String name,IStructuredSelection selection){
  super(name,null);
  RepositoryNode[] nodes=(RepositoryNode[])selection.toList().toArray(new RepositoryNode[selection.size()]);
  List<ExportFileResource> list=new ArrayList<ExportFileResource>();
  for (int i=0; i < nodes.length; i++) {
    RepositoryNode node=nodes[i];
    if (node.getType() == ENodeType.SYSTEM_FOLDER || node.getType() == ENodeType.SIMPLE_FOLDER) {
      addTreeNode(node,node.getProperties(EProperties.LABEL).toString(),list);
    }
    if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
      IRepositoryViewObject repositoryObject=node.getObject();
      if (repositoryObject.getProperty().getItem() instanceof ProcessItem) {
        ProcessItem processItem=(ProcessItem)repositoryObject.getProperty().getItem();
        ExportFileResource resource=new ExportFileResource(processItem,processItem.getProperty().getLabel());
        resource.setNode(node);
        list.add(resource);
      }
    }
  }
  process=list.toArray(new ExportFileResource[list.size()]);
}

Fixed version (ground truth):
/** 
 * Create an instance of this class.
 * @param name java.lang.String
 */
protected SpagicDeployWizardPage(String name,IStructuredSelection selection){
  super(name,null);
  RepositoryNode[] nodes=(RepositoryNode[])selection.toList().toArray(new RepositoryNode[selection.size()]);
  List<ExportFileResource> list=new ArrayList<ExportFileResource>();
  for (  RepositoryNode node : nodes) {
    if (node.getType() == ENodeType.SYSTEM_FOLDER || node.getType() == ENodeType.SIMPLE_FOLDER) {
      addTreeNode(node,node.getProperties(EProperties.LABEL).toString(),list);
    }
    if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
      IRepositoryViewObject repositoryObject=node.getObject();
      if (repositoryObject.getProperty().getItem() instanceof ProcessItem) {
        ProcessItem processItem=(ProcessItem)repositoryObject.getProperty().getItem();
        ExportFileResource resource=new ExportFileResource(processItem,processItem.getProperty().getLabel());
        resource.setNode(node);
        list.add(resource);
      }
    }
  }
  process=list.toArray(new ExportFileResource[list.size()]);
}
Program: 122402
Project: 122402
Buggy source:
/** 
 * Answer the contents of self's destination specification widget. If this value does not have a suffix then add it first.
 */
protected String getDestinationValue(){
  String idealSuffix=getOutputSuffix();
  String destinationText=super.getDestinationValue();
  if (destinationText.length() != 0 && !destinationText.endsWith(File.separator)) {
    int dotIndex=destinationText.lastIndexOf('.');
    if (dotIndex != -1) {
      int pathSepIndex=destinationText.lastIndexOf(File.separator);
      if (pathSepIndex != -1 && dotIndex < pathSepIndex) {
        destinationText+=idealSuffix;
      }
    }
 else {
      destinationText+=idealSuffix;
    }
  }
  return destinationText;
}

Fixed version (ground truth):
/** 
 * Answer the contents of self's destination specification widget. If this value does not have a suffix then add it first.
 */
@Override protected String getDestinationValue(){
  String idealSuffix=getOutputSuffix();
  String destinationText=super.getDestinationValue();
  if (destinationText.length() != 0 && !destinationText.endsWith(File.separator)) {
    int dotIndex=destinationText.lastIndexOf('.');
    if (dotIndex != -1) {
      int pathSepIndex=destinationText.lastIndexOf(File.separator);
      if (pathSepIndex != -1 && dotIndex < pathSepIndex) {
        destinationText+=idealSuffix;
      }
    }
 else {
      destinationText+=idealSuffix;
    }
  }
  return destinationText;
}
Program: 122403
Project: 122403
Buggy source:
/** 
 * Open an appropriate destination browser so that the user can specify a source to import from.
 */
protected void handleDestinationBrowseButtonPressed(){
  FileDialog dialog=new FileDialog(getContainer().getShell(),SWT.SAVE);
  dialog.setFilterExtensions(new String[]{"String_Node_Str","String_Node_Str"});
  dialog.setText("String_Node_Str");
  String currentSourceString=getDestinationValue();
  int lastSeparatorIndex=currentSourceString.lastIndexOf(File.separator);
  if (lastSeparatorIndex != -1) {
    dialog.setFilterPath(currentSourceString.substring(0,lastSeparatorIndex));
  }
  String selectedFileName=dialog.open();
  if (selectedFileName != null) {
    setErrorMessage(null);
    setDestinationValue(selectedFileName);
  }
}

Fixed version (ground truth):
/** 
 * Open an appropriate destination browser so that the user can specify a source to import from.
 */
@Override protected void handleDestinationBrowseButtonPressed(){
  FileDialog dialog=new FileDialog(getContainer().getShell(),SWT.SAVE);
  dialog.setFilterExtensions(new String[]{"String_Node_Str","String_Node_Str"});
  dialog.setText("String_Node_Str");
  String currentSourceString=getDestinationValue();
  int lastSeparatorIndex=currentSourceString.lastIndexOf(File.separator);
  if (lastSeparatorIndex != -1) {
    dialog.setFilterPath(currentSourceString.substring(0,lastSeparatorIndex));
  }
  String selectedFileName=dialog.open();
  if (selectedFileName != null) {
    setErrorMessage(null);
    setDestinationValue(selectedFileName);
  }
}
Program: 122404
Project: 122404
Buggy source:
/** 
 * Create the export options specification widgets.
 */
protected void createOptionsGroupButtons(Group optionsGroup){
  Font font=optionsGroup.getFont();
  optionsGroup.setLayout(new GridLayout(1,true));
  Composite left=new Composite(optionsGroup,SWT.NONE);
  left.setLayoutData(new GridData(SWT.LEFT,SWT.TOP,true,false));
  left.setLayout(new GridLayout(3,true));
  createOptions(left,font);
}

Fixed version (ground truth):
/** 
 * Create the export options specification widgets.
 */
@Override protected void createOptionsGroupButtons(Group optionsGroup){
  Font font=optionsGroup.getFont();
  optionsGroup.setLayout(new GridLayout(1,true));
  Composite left=new Composite(optionsGroup,SWT.NONE);
  left.setLayoutData(new GridData(SWT.LEFT,SWT.TOP,true,false));
  left.setLayout(new GridLayout(3,true));
  createOptions(left,font);
}
Program: 122406
Project: 122406
Buggy source:
/** 
 * (non-Javadoc) Method declared on IDialogPage.
 */
public void createControl(Composite parent){
  initializeDialogUnits(parent);
  Composite composite=new Composite(parent,SWT.NULL);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
  composite.setFont(parent.getFont());
  createDestinationGroup(composite);
  createOptionsGroup(composite);
  restoreResourceSpecificationWidgetValues();
  restoreWidgetValues();
  updateWidgetEnablements();
  setPageComplete(determinePageCompletion());
  setErrorMessage(null);
  setControl(composite);
  giveFocusToDestination();
}

Fixed version (ground truth):
/** 
 * (non-Javadoc) Method declared on IDialogPage.
 */
@Override public void createControl(Composite parent){
  initializeDialogUnits(parent);
  Composite composite=new Composite(parent,SWT.NULL);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
  composite.setFont(parent.getFont());
  createDestinationGroup(composite);
  createOptionsGroup(composite);
  restoreResourceSpecificationWidgetValues();
  restoreWidgetValues();
  updateWidgetEnablements();
  setPageComplete(determinePageCompletion());
  setErrorMessage(null);
  setControl(composite);
  giveFocusToDestination();
}
Program: 122407
Project: 122407
Buggy source:
@Override public boolean isMultiplyingOutputs(){
  if (compType == null) {
    isLoaded=false;
    try {
      load();
    }
 catch (    BusinessException e) {
      ExceptionHandler.process(e);
    }
  }
  return compType.getHEADER().isISMULTIPLYINGOUTPUTS();
}

Fixed version (ground truth):
@Override public boolean isMultiplyingOutputs(){
  if (compType == null) {
    isLoaded=false;
    try {
      load();
    }
 catch (    BusinessException e) {
      ExceptionHandler.process(e);
    }
  }
  if (needSingleOutput) {
    return false;
  }
  return compType.getHEADER().isISMULTIPLYINGOUTPUTS();
}
Program: 122408
Project: 122408
Buggy source:
public boolean needCheck(java.io.File file,long currentCRC){
  String path=file.getAbsolutePath();
  if (forceXSDAlreadyChecked) {
    alreadyCheckedXsd.put(path,currentCRC);
    return false;
  }
 else {
    Long lastCheckedCRC=alreadyCheckedXsd.get(path);
    if (lastCheckedCRC == null) {
      return true;
    }
    boolean isChanged=currentCRC != lastCheckedCRC;
    return isChanged;
  }
}

Fixed version (ground truth):
public boolean needCheck(java.io.File file,long currentCRC){
  String path=file.getAbsolutePath();
  Long lastCheckedCRC=alreadyCheckedXsd.get(path);
  if (lastCheckedCRC == null) {
    return true;
  }
  boolean isChanged=currentCRC != lastCheckedCRC;
  return isChanged;
}
Program: 122410
Project: 122410
Buggy source:
@Override protected List<ExportFileResource> getExportResources() throws ProcessorException {
  return manager.getExportResources(process);
}

Fixed version (ground truth):
@Override protected List<ExportFileResource> getExportResources() throws ProcessorException {
  return getManager().getExportResources(process);
}
Program: 122414
Project: 122414
Buggy source:
protected boolean selectRepositoryNode(Viewer viewer,Object element){
  if (element == null) {
    return false;
  }
  if (element instanceof IContainerNode) {
    List importElement=((IContainerNode)element).getChildren();
    for (    Object node : importElement) {
      if (node != null && node instanceof ItemRecord) {
        ERepositoryObjectType type=((ItemRecord)node).getType();
        if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
          return false;
        }
      }
    }
  }
 else   if (element instanceof ItemRecord) {
    ERepositoryObjectType type=((ItemRecord)element).getType();
    if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean selectRepositoryNode(Viewer viewer,Object element){
  if (element == null) {
    return false;
  }
  if (element != null && element instanceof TypeNode) {
    ERepositoryObjectType type=((TypeNode)element).type;
    if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
      return false;
    }
  }
  if (element instanceof IContainerNode) {
    List importElement=((IContainerNode)element).getChildren();
    for (    Object node : importElement) {
      if (node != null && node instanceof ItemRecord) {
        ERepositoryObjectType type=((ItemRecord)node).getType();
        if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
          return false;
        }
      }
    }
  }
 else   if (element instanceof ItemRecord) {
    ERepositoryObjectType type=((ItemRecord)element).getType();
    if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
      return false;
    }
  }
  return true;
}
Program: 122415
Project: 122415
Buggy source:
protected boolean selectRepositoryNode(Viewer viewer,Object element){
  if (element == null) {
    return false;
  }
  if (element instanceof IContainerNode) {
    List importElement=((IContainerNode)element).getChildren();
    for (    Object node : importElement) {
      if (node != null && node instanceof ItemRecord) {
        ERepositoryObjectType type=((ItemRecord)node).getType();
        if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
          return false;
        }
      }
    }
  }
 else   if (element instanceof ItemRecord) {
    ERepositoryObjectType type=((ItemRecord)element).getType();
    if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean selectRepositoryNode(Viewer viewer,Object element){
  if (element == null) {
    return false;
  }
  if (element != null && element instanceof TypeNode) {
    ERepositoryObjectType type=((TypeNode)element).type;
    if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
      return false;
    }
  }
  if (element instanceof IContainerNode) {
    List importElement=((IContainerNode)element).getChildren();
    for (    Object node : importElement) {
      if (node != null && node instanceof ItemRecord) {
        ERepositoryObjectType type=((ItemRecord)node).getType();
        if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
          return false;
        }
      }
    }
  }
 else   if (element instanceof ItemRecord) {
    ERepositoryObjectType type=((ItemRecord)element).getType();
    if (ERepositoryObjectType.JOB_DOC.equals(type) || ERepositoryObjectType.JOBLET_DOC.equals(type)) {
      return false;
    }
  }
  return true;
}
Program: 122418
Project: 122418
Buggy source:
private static void copyFileM(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws IOException {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null;
  FileChannel out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    in.transferTo(0,in.size(),out);
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}

Fixed version (ground truth):
private static void copyFileM(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws IOException {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null;
  FileChannel out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    int maxCount=(32 * 1024 * 1024) - (28 * 1024);
    long size=in.size();
    long position=0;
    while (position < size) {
      position+=in.transferTo(position,maxCount,out);
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}
Program: 122419
Project: 122419
Buggy source:
public void doZip(String zipDirectory){
  File file;
  File zipDir;
  zipDir=new File(zipDirectory);
  String zipFileName=zipDir.getName() + "String_Node_Str";
  try {
    this.zipOut=new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFileName)));
    handleDir(zipDir,this.zipOut);
    this.zipOut.close();
  }
 catch (  IOException ioe) {
    ioe.printStackTrace();
  }
}

Fixed version (ground truth):
public void doZip(String zipDirectory){
  File file;
  File zipDir;
  zipDir=new File(zipDirectory);
  String zipFileName=zipDir.getName() + FileConstants.ZIP_FILE_SUFFIX;
  try {
    this.zipOut=new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFileName)));
    handleDir(zipDir,this.zipOut);
    this.zipOut.close();
  }
 catch (  IOException ioe) {
    ioe.printStackTrace();
  }
}
Program: 122420
Project: 122420
Buggy source:
public static boolean deleteDirectory(String dir){
  if (!dir.endsWith(File.separator)) {
    dir=dir + File.separator;
  }
  File dirFile=new File(dir);
  if (!dirFile.exists() || !dirFile.isDirectory()) {
    return false;
  }
  boolean flag=true;
  File[] files=dirFile.listFiles();
  for (int i=0; i < files.length; i++) {
    if (files[i].isFile()) {
      flag=deleteFile(files[i].getAbsolutePath());
      if (!flag) {
        break;
      }
    }
 else {
      flag=deleteDirectory(files[i].getAbsolutePath());
      if (!flag) {
        break;
      }
    }
  }
  if (!flag) {
    return false;
  }
  if (dirFile.delete()) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public static boolean deleteDirectory(String dir){
  if (!dir.endsWith(File.separator)) {
    dir=dir + File.separator;
  }
  File dirFile=new File(dir);
  if (!dirFile.exists() || !dirFile.isDirectory()) {
    return false;
  }
  boolean flag=true;
  File[] files=dirFile.listFiles();
  for (  File file : files) {
    if (file.isFile()) {
      flag=deleteFile(file.getAbsolutePath());
      if (!flag) {
        break;
      }
    }
 else {
      flag=deleteDirectory(file.getAbsolutePath());
      if (!flag) {
        break;
      }
    }
  }
  if (!flag) {
    return false;
  }
  if (dirFile.delete()) {
    return true;
  }
 else {
    return false;
  }
}
Program: 122422
Project: 122422
Buggy source:
private void saveResources(ResourceSet resourceSet) throws IOException, PersistenceException {
  for (  Resource resource : resourceSet.getResources()) {
    if (resource.getURI().isFile())     EmfHelper.saveResource(resource);
  }
}

Fixed version (ground truth):
private void saveResources(ResourceSet resourceSet) throws IOException, PersistenceException {
  for (  Resource resource : resourceSet.getResources()) {
    if (resource.getURI().isFile()) {
      EmfHelper.saveResource(resource);
    }
  }
}
Program: 122423
Project: 122423
Buggy source:
private void computeReferenceFilesAndPaths(File destinationFile,Item item,IPath fileNamePath){
  List<ReferenceFileItem> referenceFiles=(List<ReferenceFileItem>)item.getReferenceResources();
  if (referenceFiles != null && !referenceFiles.isEmpty()) {
    for (    ReferenceFileItem ri : referenceFiles) {
      IPath rfPath=fileNamePath.addFileExtension(ri.getExtension());
      File rfFile=new File(destinationFile,rfPath.toOSString());
      if (refereneceFilesToBeExport != null) {
        refereneceFilesToBeExport.put(rfFile,rfPath);
      }
 else {
        refereneceFilesToBeExport=new HashMap<File,IPath>();
        refereneceFilesToBeExport.put(rfFile,rfPath);
      }
      if (referenceFilesMapping != null) {
        referenceFilesMapping.put(rfFile,ri);
      }
 else {
        referenceFilesMapping=new HashMap<File,ReferenceFileItem>();
        referenceFilesMapping.put(rfFile,ri);
      }
    }
  }
}

Fixed version (ground truth):
private void computeReferenceFilesAndPaths(File destinationFile,Item item,IPath fileNamePath){
  List<ReferenceFileItem> referenceFiles=item.getReferenceResources();
  if (referenceFiles != null && !referenceFiles.isEmpty()) {
    for (    ReferenceFileItem ri : referenceFiles) {
      IPath rfPath=fileNamePath.addFileExtension(ri.getExtension());
      File rfFile=new File(destinationFile,rfPath.toOSString());
      if (refereneceFilesToBeExport != null) {
        refereneceFilesToBeExport.put(rfFile,rfPath);
      }
 else {
        refereneceFilesToBeExport=new HashMap<File,IPath>();
        refereneceFilesToBeExport.put(rfFile,rfPath);
      }
      if (referenceFilesMapping != null) {
        referenceFilesMapping.put(rfFile,ri);
      }
 else {
        referenceFilesMapping=new HashMap<File,ReferenceFileItem>();
        referenceFilesMapping.put(rfFile,ri);
      }
    }
  }
}
Program: 122425
Project: 122425
Buggy source:
@SuppressWarnings("String_Node_Str") protected void handleLocationDirectoryButtonPressed(){
  DirectoryDialog dialog=new DirectoryDialog(directoryPathField.getShell());
  dialog.setMessage(DataTransferMessages.FileExport_selectDestinationTitle);
  String dirName=directoryPathField.getText().trim();
  if (dirName.length() == 0) {
    dirName=previouslyBrowsedDirectory;
  }
  if (dirName.length() == 0) {
    dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getLocation().toOSString());
  }
 else {
    File path=new File(dirName);
    if (path.exists()) {
      dialog.setFilterPath(new Path(dirName).toOSString());
    }
  }
  String selectedDirectory=dialog.open();
  if (selectedDirectory != null) {
    previouslyBrowsedDirectory=selectedDirectory;
    directoryPathField.setText(previouslyBrowsedDirectory);
    lastPath=directoryPathField.getText().trim();
    saveExportPath(DIRECTORY_PATH);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected void handleLocationDirectoryButtonPressed(){
  DirectoryDialog dialog=new DirectoryDialog(directoryPathField.getShell());
  dialog.setMessage(DataTransferMessages.FileExport_selectDestinationTitle);
  String dirName=directoryPathField.getText().trim();
  if (dirName.length() == 0) {
    dirName=previouslyBrowsedDirectory;
  }
  if (dirName.length() == 0) {
    dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getLocation().toOSString());
  }
 else {
    File path=new File(dirName);
    if (path.exists()) {
      dialog.setFilterPath(new Path(dirName).toOSString());
    }
  }
  String selectedDirectory=dialog.open();
  if (selectedDirectory != null) {
    previouslyBrowsedDirectory=selectedDirectory;
    directoryPathField.setText(previouslyBrowsedDirectory);
    lastPath=directoryPathField.getText().trim();
    saveExportPath(DIRECTORY_PATH,lastPath);
  }
}
Program: 122426
Project: 122426
Buggy source:
/** 
 * The browse button has been selected. Select the location.
 */
@SuppressWarnings("String_Node_Str") protected void handleLocationArchiveButtonPressed(){
  FileDialog dialog=new FileDialog(archivePathField.getShell(),SWT.SAVE);
  dialog.setFilterExtensions(FILE_EXPORT_MASK);
  dialog.setText(DataTransferMessages.ArchiveExport_selectDestinationTitle);
  String fileName=archivePathField.getText().trim();
  if (fileName.length() == 0) {
    fileName=previouslyBrowsedArchive;
  }
  if (fileName.length() == 0) {
    dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getLocation().toOSString());
  }
 else {
    File path=new File(fileName);
    if (path.exists()) {
      dialog.setFilterPath(new Path(fileName).toOSString());
    }
  }
  String selectedArchive=dialog.open();
  if (selectedArchive != null) {
    previouslyBrowsedArchive=selectedArchive;
    archivePathField.setText(previouslyBrowsedArchive);
    lastPath=archivePathField.getText().trim();
    saveExportPath(ARCHIVE_PATH);
  }
}

Fixed version (ground truth):
/** 
 * The browse button has been selected. Select the location.
 */
@SuppressWarnings("String_Node_Str") protected void handleLocationArchiveButtonPressed(){
  FileDialog dialog=new FileDialog(archivePathField.getShell(),SWT.SAVE);
  dialog.setFilterExtensions(FILE_EXPORT_MASK);
  dialog.setText(DataTransferMessages.ArchiveExport_selectDestinationTitle);
  String fileName=archivePathField.getText().trim();
  if (fileName.length() == 0) {
    fileName=previouslyBrowsedArchive;
  }
  if (fileName.length() == 0) {
    dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getLocation().toOSString());
  }
 else {
    File path=new File(fileName);
    if (path.exists()) {
      dialog.setFilterPath(new Path(fileName).toOSString());
    }
  }
  String selectedArchive=dialog.open();
  if (selectedArchive != null) {
    previouslyBrowsedArchive=selectedArchive;
    archivePathField.setText(previouslyBrowsedArchive);
    lastPath=archivePathField.getText().trim();
    saveExportPath(ARCHIVE_PATH,lastPath);
  }
}
Program: 122427
Project: 122427
Buggy source:
public void modifyText(ModifyEvent e){
  if (getDialogSettings() != null) {
    IDialogSettings section=getDialogSettings().getSection(DESTINATION_FILE);
    if (section == null) {
      section=getDialogSettings().addNewSection(DESTINATION_FILE);
    }
    section.put(ARCHIVE_PATH,archivePathField.getText());
  }
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  saveExportPath(ARCHIVE_PATH,archivePathField.getText());
}
Program: 122428
Project: 122428
Buggy source:
private void saveExportPath(String pathType){
  if (getDialogSettings() != null) {
    IDialogSettings section=getDialogSettings().getSection(DESTINATION_FILE);
    if (section == null) {
      section=getDialogSettings().addNewSection(DESTINATION_FILE);
    }
    section.put(pathType,lastPath);
  }
}

Fixed version (ground truth):
private void saveExportPath(String pathType,String path){
  if (getDialogSettings() != null) {
    IDialogSettings section=getDialogSettings().getSection(DESTINATION_FILE);
    if (section == null) {
      section=getDialogSettings().addNewSection(DESTINATION_FILE);
    }
    if (section != null) {
      section.put(pathType,path);
    }
  }
}
Program: 122429
Project: 122429
Buggy source:
private String getClasspath(){
  StringBuffer sb=new StringBuffer();
  String[] fs=getJobFolderJarFilenames();
  for (int i=0; i < fs.length; i++) {
    sb.append(fs[i] + "String_Node_Str");
  }
  if (needModuleJarStrs != null && !needModuleJarStrs.equals("String_Node_Str")) {
    String[] needjars=needModuleJarStrs.split("String_Node_Str");
    if (needjars != null) {
      for (int i=0; i < needjars.length; i++) {
        if ("String_Node_Str".equals(needjars[i])) {
          break;
        }
        sb.append(needjars[i] + "String_Node_Str");
      }
    }
  }
 else {
    if (shFile != null) {
      String[] fn=getLibJarFilenames();
      if (fn != null) {
        for (int i=0; i < fn.length; i++) {
          sb.append("String_Node_Str" + LIB + "String_Node_Str"+ fn[i]+ "String_Node_Str");
        }
      }
    }
  }
  sb.append("String_Node_Str" + RULES_ROOT + "String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
private String getClasspath(){
  StringBuffer sb=new StringBuffer();
  String[] fs=getJobFolderJarFilenames();
  for (  String element : fs) {
    sb.append(element + "String_Node_Str");
  }
  if (needModuleJarStrs != null && !needModuleJarStrs.equals("String_Node_Str")) {
    String[] needjars=needModuleJarStrs.split("String_Node_Str");
    if (needjars != null) {
      for (      String needjar : needjars) {
        if ("String_Node_Str".equals(needjar)) {
          break;
        }
        sb.append(needjar + "String_Node_Str");
      }
    }
  }
 else {
    if (shFile != null) {
      String[] fn=getLibJarFilenames();
      if (fn != null) {
        for (        String element : fn) {
          sb.append("String_Node_Str" + LIB + "String_Node_Str"+ element+ "String_Node_Str");
        }
      }
    }
  }
  sb.append("String_Node_Str" + RULES_ROOT + "String_Node_Str");
  return sb.toString();
}