nus-yam/ex-repair huggingface dataset:
Program: 117821
Project: 117821
Buggy source:
public static String getDefaultInterpreter() throws ProcessorException {
  IPreferenceStore prefStore=CorePlugin.getDefault().getPreferenceStore();
  String javaInterpreter=prefStore.getString(ITalendCorePrefConstants.JAVA_INTERPRETER);
  if (javaInterpreter == null || javaInterpreter.length() == 0) {
    throw new ProcessorException(Messages.getString("String_Node_Str"));
  }
  Path path=new Path(javaInterpreter);
  javaInterpreter=path.toPortableString();
  return javaInterpreter;
}

Fixed version (ground truth):
public static String getDefaultInterpreter() throws ProcessorException {
  IPreferenceStore prefStore=CorePlugin.getDefault().getPreferenceStore();
  String javaInterpreter=prefStore.getString(ITalendCorePrefConstants.JAVA_INTERPRETER);
  if (javaInterpreter == null || javaInterpreter.length() == 0) {
    javaInterpreter="String_Node_Str";
  }
  Path path=new Path(javaInterpreter);
  javaInterpreter=path.toPortableString();
  return javaInterpreter;
}
Program: 117822
Project: 117822
Buggy source:
@Override public Object start(IApplicationContext context) throws Exception {
  Timer.getTimer("String_Node_Str").start();
  CommonsPlugin.setHeadless(true);
  initLocalRepository();
  init(ECodeLanguage.JAVA);
  removeLinkedResources();
  addMarkersForTemplatesNextInitialization();
  saveWorkspace();
  Timer.getTimer("String_Node_Str").stop();
  Timer.getTimer("String_Node_Str").print();
  return EXIT_OK;
}

Fixed version (ground truth):
@Override public Object start(IApplicationContext context) throws Exception {
  System.setProperty("String_Node_Str","String_Node_Str");
  Timer.getTimer("String_Node_Str").start();
  CommonsPlugin.setHeadless(true);
  initLocalRepository();
  init(ECodeLanguage.JAVA);
  removeLinkedResources();
  addMarkersForTemplatesNextInitialization();
  saveWorkspace();
  Timer.getTimer("String_Node_Str").stop();
  Timer.getTimer("String_Node_Str").print();
  return EXIT_OK;
}
Program: 117823
Project: 117823
Buggy source:
private static void synchronizedComponent(List<JetBean> components,IProgressMonitor sub,List<JetBean> alreadyCompiledEmitters,TalendJetEmitter dummyEmitter,int monitorBuffer,IProgressMonitor monitorWrap){
  for (  JetBean jetBean : components) {
    if (!emitterPool.containsKey(jetBean)) {
      ComponentCompilations.deleteMarkers();
      TalendJetEmitter emitter=new TalendJetEmitter(jetBean,dummyEmitter.getTalendEclipseHelper());
      if (monitorWrap.isCanceled()) {
        if (!CommonUIPlugin.isFullyHeadless()) {
          Display.getDefault().syncExec(new Runnable(){
            @Override public void run(){
              MessageDialog.openError(Display.getDefault().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
            }
          }
);
        }
        return;
      }
      try {
        emitter.initialize(sub);
      }
 catch (      JETException e) {
        log.error(Messages.getString("String_Node_Str") + e.getMessage(),e);
        continue;
      }
      if (emitter.isClassAvailable()) {
        alreadyCompiledEmitters.add(jetBean);
      }
 else {
        jetFilesCompileFail.add(jetBean);
      }
      emitterPool.put(jetBean,emitter);
      monitorBuffer++;
      if (monitorBuffer % 100 == 0) {
        monitorWrap.worked(100);
        monitorBuffer=0;
      }
    }
  }
}

Fixed version (ground truth):
private static void synchronizedComponent(List<JetBean> components,IProgressMonitor sub,List<JetBean> alreadyCompiledEmitters,TalendJetEmitter dummyEmitter,int monitorBuffer,IProgressMonitor monitorWrap){
  for (  JetBean jetBean : components) {
    if (!emitterPool.containsKey(jetBean)) {
      ComponentCompilations.deleteMarkers();
      TalendJetEmitter emitter=new TalendJetEmitter(jetBean,dummyEmitter.getTalendEclipseHelper());
      if (monitorWrap.isCanceled()) {
        if (!CommonUIPlugin.isFullyHeadless()) {
          Display.getDefault().syncExec(new Runnable(){
            @Override public void run(){
              MessageDialog.openError(Display.getDefault().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
            }
          }
);
        }
        return;
      }
      if (Boolean.getBoolean("String_Node_Str")) {
        try {
          emitter.initialize(sub);
        }
 catch (        JETException e) {
          log.error(Messages.getString("String_Node_Str") + e.getMessage(),e);
          continue;
        }
      }
      if (emitter.isClassAvailable()) {
        alreadyCompiledEmitters.add(jetBean);
      }
 else {
        jetFilesCompileFail.add(jetBean);
      }
      emitterPool.put(jetBean,emitter);
      monitorBuffer++;
      if (monitorBuffer % 100 == 0) {
        monitorWrap.worked(100);
        monitorBuffer=0;
      }
    }
  }
}
Program: 117824
Project: 117824
Buggy source:
/** 
 * initialization of available templates.
 * @param template
 * @param codeLanguage
 * @return
 */
private static JetBean initializeUtilTemplate(TemplateUtil template,ECodeLanguage codeLanguage){
  JetBean jetBean=new JetBean(template.getJetPluginRepository(),template.getTemplateRelativeUri(),template.getResourceName(),template.getVersion(),codeLanguage.getName(),"String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str",CorePlugin.PLUGIN_ID);
  jetBean.addClassPath("String_Node_Str",CodeGeneratorActivator.PLUGIN_ID);
  jetBean.addClassPath("String_Node_Str",CommonsPlugin.PLUGIN_ID);
  jetBean.setClassLoader(new CodeGeneratorEmittersPoolFactory().getClass().getClassLoader());
  String sparkUtilsPluginName="String_Node_Str";
  if (PluginChecker.isPluginLoaded(sparkUtilsPluginName)) {
    jetBean.addClassPath("String_Node_Str",sparkUtilsPluginName);
    jetBean.setClassLoader(createDelegateClassLoader(jetBean.getClassLoader(),sparkUtilsPluginName,"String_Node_Str"));
  }
  return jetBean;
}

Fixed version (ground truth):
/** 
 * initialization of available templates.
 * @param template
 * @param codeLanguage
 * @return
 */
private static JetBean initializeUtilTemplate(TemplateUtil template,ECodeLanguage codeLanguage){
  JetBean jetBean=new JetBean(template.getJetPluginRepository(),template.getTemplateRelativeUri(),template.getResourceName(),template.getVersion(),codeLanguage.getName(),"String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str",CorePlugin.PLUGIN_ID);
  jetBean.addClassPath("String_Node_Str",CodeGeneratorActivator.PLUGIN_ID);
  jetBean.addClassPath("String_Node_Str",CommonsPlugin.PLUGIN_ID);
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.addClassPath("String_Node_Str","String_Node_Str");
  jetBean.setClassLoader(new CodeGeneratorEmittersPoolFactory().getClass().getClassLoader());
  String sparkUtilsPluginName="String_Node_Str";
  if (PluginChecker.isPluginLoaded(sparkUtilsPluginName)) {
    jetBean.addClassPath("String_Node_Str",sparkUtilsPluginName);
    jetBean.setClassLoader(createDelegateClassLoader(jetBean.getClassLoader(),sparkUtilsPluginName,"String_Node_Str"));
  }
  return jetBean;
}
Program: 117826
Project: 117826
Buggy source:
@Override public void dispose(){
  this.disposed=true;
  this.unit=null;
  this.process=null;
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  this.disposed=true;
  this.process=null;
  super.dispose();
}
Program: 117827
Project: 117827
Buggy source:
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  addCompiler();
  getSourceViewer().setEditable(isEditable());
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  getSourceViewer().setEditable(isEditable());
}
Program: 117828
Project: 117828
Buggy source:
/** 
 * Getter for unit.
 * @return the unit
 */
public org.eclipse.jdt.core.ICompilationUnit getUnit(){
  return unit;
}

Fixed version (ground truth):
/** 
 * Getter for unit.
 * @return the unit
 */
public org.eclipse.jdt.core.ICompilationUnit getUnit(){
  return (org.eclipse.jdt.core.ICompilationUnit)getInputJavaElement();
}
Program: 117829
Project: 117829
Buggy source:
@Override protected String getExportJarsStr(){
  if (isOldBuildJob()) {
    return super.getExportJarsStr();
  }
  final String libPrefixPath=getRootWorkingDir(true);
  final String classPathSeparator=extractClassPathSeparator();
  String jobName=process.getName();
  String jobVersion=process.getVersion();
  if (ProcessUtils.isTestContainer(process)) {
    IProcess basePrcess=ProcessUtils.getTestContainerBaseProcess(process);
    jobName=basePrcess.getName();
    jobVersion=basePrcess.getVersion();
  }
  String jarName=JavaResourcesHelper.getJobJarName(jobName,jobVersion);
  String exportJar=libPrefixPath + jarName + FileExtensions.JAR_FILE_SUFFIX;
  Set<JobInfo> infos=getBuildChildrenJobs();
  for (  JobInfo jobInfo : infos) {
    if (jobInfo.isTestContainer()) {
      continue;
    }
    String childJarName=JavaResourcesHelper.getJobJarName(jobInfo.getJobName(),jobInfo.getJobVersion());
    exportJar+=classPathSeparator + libPrefixPath + childJarName+ FileExtensions.JAR_FILE_SUFFIX;
  }
  return exportJar;
}

Fixed version (ground truth):
@Override protected String getExportJarsStr(){
  if (isOldBuildJob()) {
    return super.getExportJarsStr();
  }
  final String libPrefixPath=getRootWorkingDir(true);
  final String classPathSeparator=extractClassPathSeparator();
  String jobName=process.getName();
  String jobVersion=process.getVersion();
  if (ProcessUtils.isTestContainer(process)) {
    IProcess basePrcess=ProcessUtils.getTestContainerBaseProcess(process);
    jobName=basePrcess.getName();
    jobVersion=basePrcess.getVersion();
  }
  String jarName=JavaResourcesHelper.getJobJarName(jobName,jobVersion);
  String exportJar=libPrefixPath + jarName + FileExtensions.JAR_FILE_SUFFIX;
  if (!isMainJob || isMainJob && !ProcessorUtilities.hasLoopDependency()) {
    Set<JobInfo> infos=getBuildChildrenJobs();
    for (    JobInfo jobInfo : infos) {
      if (jobInfo.isTestContainer()) {
        continue;
      }
      String childJarName=JavaResourcesHelper.getJobJarName(jobInfo.getJobName(),jobInfo.getJobVersion());
      exportJar+=classPathSeparator + libPrefixPath + childJarName+ FileExtensions.JAR_FILE_SUFFIX;
    }
  }
  return exportJar;
}
Program: 117830
Project: 117830
Buggy source:
public void generatePom(int option){
  if (buildChildrenJobs != null) {
    buildChildrenJobs.clear();
  }
  if (ProcessorUtilities.isGeneratePomOnly()) {
    ProcessorUtilities.resetExportConfig();
  }
 else {
    initJobClasspath();
  }
  try {
    IMavenPomCreator createTemplatePom=createMavenPomCreator();
    if (createTemplatePom != null) {
      createTemplatePom.setSyncCodesPoms(option == 0);
      boolean previousValue=ProcessUtils.jarNeedsToContainContext();
      ProcessUtils.setJarWithContext(ProcessUtils.needsToHaveContextInsideJar((ProcessItem)property.getItem()));
      createTemplatePom.create(null);
      ProcessUtils.setJarWithContext(previousValue);
      if (getTalendJavaProject() != null) {
        getTalendJavaProject().setUseTempPom(false);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public void generatePom(int option){
  if (buildChildrenJobs != null) {
    buildChildrenJobs.clear();
  }
  isMainJob=BitwiseOptionUtils.containOption(option,TalendProcessOptionConstants.GENERATE_IS_MAINJOB);
  if (ProcessorUtilities.isGeneratePomOnly()) {
    ProcessorUtilities.resetExportConfig();
  }
 else {
    initJobClasspath();
  }
  try {
    IMavenPomCreator createTemplatePom=createMavenPomCreator();
    if (createTemplatePom != null) {
      createTemplatePom.setSyncCodesPoms(isMainJob);
      if (isMainJob) {
        createTemplatePom.setHasLoopDependency(ProcessorUtilities.hasLoopDependency());
      }
      boolean previousValue=ProcessUtils.jarNeedsToContainContext();
      ProcessUtils.setJarWithContext(ProcessUtils.needsToHaveContextInsideJar((ProcessItem)property.getItem()));
      createTemplatePom.create(null);
      ProcessUtils.setJarWithContext(previousValue);
      if (getTalendJavaProject() != null) {
        getTalendJavaProject().setUseTempPom(false);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}
Program: 117831
Project: 117831
Buggy source:
protected boolean hasTcomp0Component(final INode iNode){
  return iNode.getProcess() != null && new ArrayList<>(iNode.getProcess().getGraphicalNodes()).stream().anyMatch(node -> node.getComponent().getComponentType() == EComponentType.GENERIC && !getClass().isInstance(node.getComponent()));
}

Fixed version (ground truth):
protected boolean hasTcomp0Component(final INode iNode){
  if (iNode == null) {
    return false;
  }
  IProcess process=iNode.getProcess();
  if (process == null) {
    return false;
  }
  List<? extends INode> graphicalNodes=process.getGraphicalNodes();
  if (graphicalNodes == null || graphicalNodes.isEmpty()) {
    return false;
  }
  boolean hasTcomp0Component=false;
  for (  INode node : graphicalNodes) {
    if (node != null) {
      IComponent component=node.getComponent();
      if (component != null) {
        if (component.getComponentType() == EComponentType.GENERIC && !getClass().isInstance(component)) {
          hasTcomp0Component=true;
          break;
        }
      }
    }
  }
  return hasTcomp0Component;
}
Program: 117832
Project: 117832
Buggy source:
/** 
 * DOC nrousseau Comment method "getItemPomFolder".
 * @param property
 * @param helper
 * @return
 * @throws CoreException 
 */
public static IFolder getItemPomFolder(Property property) throws CoreException {
  String projectTechName=ProjectManager.getInstance().getProject(property).getTechnicalLabel();
  AggregatorPomsHelper helper=new AggregatorPomsHelper(projectTechName);
  IPath itemRelativePath=ItemResourceUtil.getItemRelativePath(property);
  String jobFolderName=AggregatorPomsHelper.getJobProjectFolderName(property);
  ERepositoryObjectType type=ERepositoryObjectType.getItemType(property.getItem());
  IFolder jobFolder=helper.getProcessFolder(type).getFolder(itemRelativePath).getFolder(jobFolderName);
  createFoldersIfNeeded(jobFolder);
  return jobFolder;
}

Fixed version (ground truth):
/** 
 * DOC nrousseau Comment method "getItemPomFolder".
 * @param property
 * @param helper
 * @return
 * @throws Exception 
 */
public static IFolder getItemPomFolder(Property property) throws Exception {
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService.isTestContainerItem(property.getItem())) {
      Item jobItem=testContainerService.getParentJobItem(property.getItem());
      if (jobItem != null) {
        property=jobItem.getProperty();
      }
    }
  }
  String projectTechName=ProjectManager.getInstance().getProject(property).getTechnicalLabel();
  AggregatorPomsHelper helper=new AggregatorPomsHelper(projectTechName);
  IPath itemRelativePath=ItemResourceUtil.getItemRelativePath(property);
  String jobFolderName=AggregatorPomsHelper.getJobProjectFolderName(property);
  ERepositoryObjectType type=ERepositoryObjectType.getItemType(property.getItem());
  IFolder jobFolder=helper.getProcessFolder(type).getFolder(itemRelativePath).getFolder(jobFolderName);
  createFoldersIfNeeded(jobFolder);
  return jobFolder;
}
Program: 117833
Project: 117833
Buggy source:
/** 
 * .Java/pom_TestJob_0.1.xml
 */
protected IFile getPomFile(){
  if (isStandardJob()) {
    String pomFileName=TalendMavenConstants.POM_FILE_NAME;
    if (this.getTalendJavaProject() == null) {
      try {
        return TalendJavaProjectManager.getItemPomFolder(property).getFile(pomFileName);
      }
 catch (      CoreException e) {
        ExceptionHandler.process(e);
        return null;
      }
    }
 else {
      return this.getTalendJavaProject().getProject().getFile(pomFileName);
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * .Java/pom_TestJob_0.1.xml
 */
protected IFile getPomFile(){
  if (isStandardJob()) {
    String pomFileName=TalendMavenConstants.POM_FILE_NAME;
    if (this.getTalendJavaProject() == null) {
      try {
        return TalendJavaProjectManager.getItemPomFolder(property).getFile(pomFileName);
      }
 catch (      Exception e) {
        ExceptionHandler.process(e);
        return null;
      }
    }
 else {
      return this.getTalendJavaProject().getProject().getFile(pomFileName);
    }
  }
 else {
    return null;
  }
}
Program: 117834
Project: 117834
Buggy source:
@SuppressWarnings("String_Node_Str") private void caseImport(String propertyName,Object newValue){
  if (newValue instanceof Set) {
    Set<Item> importItems=(Set<Item>)newValue;
    for (    Item item : importItems) {
      if (item instanceof ProcessItem) {
        TalendJavaProjectManager.generatePom((ProcessItem)item);
      }
 else       if (item instanceof RoutineItem) {
        updateCodesChange((RoutineItem)item);
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void caseImport(String propertyName,Object newValue){
  if (newValue instanceof Set) {
    Set<Item> importItems=(Set<Item>)newValue;
    for (    Item item : importItems) {
      if (item instanceof ProcessItem) {
        ITestContainerProviderService testcontainerService=getTestContainerProviderService();
        if (testcontainerService != null && testcontainerService.isTestContainerItem(item)) {
          return;
        }
        TalendJavaProjectManager.generatePom((ProcessItem)item);
      }
 else       if (item instanceof RoutineItem) {
        updateCodesChange((RoutineItem)item);
      }
    }
  }
}
Program: 117836
Project: 117836
Buggy source:
@Override public ExecutionResult execute(Item item){
  if (item instanceof ProcessItem) {
    ProcessItem processItem=(ProcessItem)item;
    CorePlugin.getDefault().getRunProcessService().generateJobPom(processItem);
    return ExecutionResult.SUCCESS_NO_ALERT;
  }
  return ExecutionResult.NOTHING_TO_DO;
}

Fixed version (ground truth):
@Override public ExecutionResult execute(Item item){
  if (item instanceof ProcessItem && !ProxyRepositoryFactory.getInstance().isFullLogonFinished()) {
    ProcessItem processItem=(ProcessItem)item;
    CorePlugin.getDefault().getRunProcessService().generateJobPom(processItem);
    return ExecutionResult.SUCCESS_NO_ALERT;
  }
  return ExecutionResult.NOTHING_TO_DO;
}
Program: 117838
Project: 117838
Buggy source:
public static void deleteTalendJobProjectsUnderFolder(ERepositoryObjectType processType,IPath folderPath,boolean deleteContent){
  try {
    Iterator<String> iterator=talendJobJavaProjects.keySet().iterator();
    while (iterator.hasNext()) {
      String key=iterator.next();
      ITalendProcessJavaProject project=talendJobJavaProjects.get(key);
      IPath jobPath=ItemResourceUtil.getItemRelativePath(project.getPropery());
      if (folderPath.isPrefixOf(jobPath)) {
        project.getProject().delete(deleteContent,true,null);
        iterator.remove();
      }
    }
    if (deleteContent) {
      AggregatorPomsHelper helper=new AggregatorPomsHelper();
      IFolder folder=helper.getProcessFolder(processType).getFolder(folderPath);
      folder.delete(true,false,null);
    }
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public static void deleteTalendJobProjectsUnderFolder(ERepositoryObjectType processType,IPath folderPath,boolean deleteContent){
  try {
    Iterator<String> iterator=talendJobJavaProjects.keySet().iterator();
    while (iterator.hasNext()) {
      String key=iterator.next();
      ITalendProcessJavaProject project=talendJobJavaProjects.get(key);
      Property property=project.getPropery();
      if (property != null) {
        IPath jobPath=ItemResourceUtil.getItemRelativePath(property);
        if (folderPath.isPrefixOf(jobPath)) {
          project.getProject().delete(deleteContent,true,null);
          iterator.remove();
        }
      }
    }
    if (deleteContent) {
      AggregatorPomsHelper helper=new AggregatorPomsHelper();
      IFolder folder=helper.getProcessFolder(processType).getFolder(folderPath);
      folder.delete(true,false,null);
    }
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
}
Program: 117839
Project: 117839
Buggy source:
@Override public Property getPropery(){
  return property;
}

Fixed version (ground truth):
@Override public Property getPropery(){
  ProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  IRepositoryViewObject object;
  try {
    object=factory.getSpecificVersion(id,version,true);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
    return null;
  }
  return object.getProperty();
}
Program: 117840
Project: 117840
Buggy source:
public TalendProcessJavaProject(IJavaProject javaProject,Property property){
  this(javaProject);
  this.property=property;
}

Fixed version (ground truth):
public TalendProcessJavaProject(IJavaProject javaProject,Property property){
  this(javaProject);
  this.id=property.getId();
  this.version=property.getVersion();
}
Program: 117844
Project: 117844
Buggy source:
/** 
 * qzhang Comment method "setExecBtn".
 * @param runnable
 */
private void setExecBtn(final boolean runnable){
  if (runnable == oldRunning) {
    return;
  }
  oldRunning=runnable;
  if (run != null && !run.isDisposed()) {
    run.setEnabled(runnable);
    run.redraw();
    run.getParent().layout();
    run.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    run.setToolTipText(Messages.getString("String_Node_Str"));
    run.setImage(ImageProvider.getImage(ERunprocessImages.RUN_PROCESS_ACTION));
    run.setData(ProcessView.EXEC_ID);
  }
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "setExecBtn".
 * @param runnable
 */
private void setExecBtn(final boolean runnable){
  if (run != null && !run.isDisposed()) {
    run.setEnabled(runnable);
    run.redraw();
    run.getParent().layout();
    run.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    run.setToolTipText(Messages.getString("String_Node_Str"));
    run.setImage(ImageProvider.getImage(ERunprocessImages.RUN_PROCESS_ACTION));
    run.setData(ProcessView.EXEC_ID);
  }
}
Program: 117846
Project: 117846
Buggy source:
/** 
 * qzhang Comment method "setExecBtn".
 * @param runnable
 */
private void setExecBtn(final boolean runnable){
  if (run != null && !run.isDisposed()) {
    run.setEnabled(runnable);
    run.redraw();
    run.getParent().layout();
    run.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    run.setToolTipText(Messages.getString("String_Node_Str"));
    run.setImage(ImageProvider.getImage(ERunprocessImages.RUN_PROCESS_ACTION));
    run.setData(ProcessView.EXEC_ID);
  }
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "setExecBtn".
 * @param runnable
 */
private void setExecBtn(final boolean runnable){
  if (runnable == oldRunning) {
    return;
  }
  oldRunning=runnable;
  if (run != null && !run.isDisposed()) {
    run.setEnabled(runnable);
    run.redraw();
    run.getParent().layout();
    run.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    run.setToolTipText(Messages.getString("String_Node_Str"));
    run.setImage(ImageProvider.getImage(ERunprocessImages.RUN_PROCESS_ACTION));
    run.setData(ProcessView.EXEC_ID);
  }
}
Program: 117848
Project: 117848
Buggy source:
/** 
 * bqian Comment method "launch".
 * @param object
 * @param mode
 */
private void launch(Item item,String mode){
  if (item instanceof ProcessItem) {
    ILaunchConfiguration config=findLaunchConfiguration((ProcessItem)item,mode);
    if (config != null) {
      DebugUITools.launch(config,mode);
    }
  }
}

Fixed version (ground truth):
/** 
 * bqian Comment method "launch".
 * @param object
 * @param mode
 */
private void launch(Item item,String mode){
  if (item instanceof ProcessItem) {
    ILaunchConfiguration config=findLaunchConfiguration((ProcessItem)item,mode);
    if (config != null) {
      IPreferenceStore debugUiStore=DebugUITools.getPreferenceStore();
      debugUiStore.setValue(IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH,Boolean.FALSE);
      DebugUITools.launch(config,mode);
    }
  }
}
Program: 117849
Project: 117849
Buggy source:
/** 
 * Launch the last launch, or open the launch config dialog if none.
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 */
@Override public void run(IAction action){
  if (selection instanceof IStructuredSelection) {
    IStructuredSelection sel=(IStructuredSelection)selection;
    Object o=sel.getFirstElement();
    if ((o instanceof RepositoryNode)) {
      RepositoryNode node=(RepositoryNode)o;
      if (node.getObject() != null && node.getObject().getRepositoryObjectType().equals(ERepositoryObjectType.PROCESS)) {
        JobLaunchShortcutManager.run(selection);
        return;
      }
    }
  }
  if (window != null) {
    IWorkbenchPage page=window.getActivePage();
    if (page != null) {
      if (page.getActivePart() == page.getActiveEditor()) {
        IEditorPart editor=page.getActiveEditor();
        IEditorInput input=editor.getEditorInput();
        if (input instanceof RepositoryEditorInput) {
          JobLaunchShortcutManager.run(editor);
          return;
        }
      }
    }
  }
  ILaunchConfiguration configuration=getLastLaunch();
  if (configuration == null) {
    MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
 else {
    DebugUITools.launch(configuration,getMode());
  }
}

Fixed version (ground truth):
/** 
 * Launch the last launch, or open the launch config dialog if none.
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 */
@Override public void run(IAction action){
  if (selection instanceof IStructuredSelection) {
    IStructuredSelection sel=(IStructuredSelection)selection;
    Object o=sel.getFirstElement();
    if ((o instanceof RepositoryNode)) {
      RepositoryNode node=(RepositoryNode)o;
      if (node.getObject() != null && node.getObject().getRepositoryObjectType().equals(ERepositoryObjectType.PROCESS)) {
        JobLaunchShortcutManager.run(selection);
        return;
      }
    }
  }
  if (window != null) {
    IWorkbenchPage page=window.getActivePage();
    if (page != null) {
      if (page.getActivePart() == page.getActiveEditor()) {
        IEditorPart editor=page.getActiveEditor();
        IEditorInput input=editor.getEditorInput();
        if (input instanceof RepositoryEditorInput) {
          JobLaunchShortcutManager.run(editor);
          return;
        }
      }
    }
  }
  ILaunchConfiguration configuration=getLastLaunch();
  if (configuration == null) {
    MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
 else {
    IPreferenceStore debugUiStore=DebugUITools.getPreferenceStore();
    debugUiStore.setValue(IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH,Boolean.FALSE);
    DebugUITools.launch(configuration,getMode());
  }
}
Program: 117854
Project: 117854
Buggy source:
/** 
 * DOC ggu Comment method "buildWholeCodeProject".
 */
private void buildWholeCodeProject(){
  try {
    NullProgressMonitor monitor=new NullProgressMonitor();
    IProject project=getProject();
    if (!project.isSynchronized(IResource.DEPTH_INFINITE)) {
      project.refreshLocal(IResource.DEPTH_INFINITE,monitor);
    }
    project.build(IncrementalProjectBuilder.FULL_BUILD,monitor);
    project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD,monitor);
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 * DOC ggu Comment method "buildWholeCodeProject".
 */
@Override public void buildWholeCodeProject(){
  try {
    NullProgressMonitor monitor=new NullProgressMonitor();
    IProject project=getProject();
    if (!project.isSynchronized(IResource.DEPTH_INFINITE)) {
      project.refreshLocal(IResource.DEPTH_INFINITE,monitor);
    }
    project.build(IncrementalProjectBuilder.FULL_BUILD,monitor);
    project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD,monitor);
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
}
Program: 117856
Project: 117856
Buggy source:
private void createAssistText(org.eclipse.swt.graphics.Point cursorRelativePosition){
  if (bindingService != null) {
    bindingService.setKeyFilterEnabled(false);
  }
  highlightOveredConnection(cursorRelativePosition);
  assistText=new Text((Composite)graphicControl,SWT.BORDER);
  assistText.setLocation(cursorRelativePosition.x,cursorRelativePosition.y - assistText.getLineHeight());
  assistText.setSize(200,assistText.computeSize(SWT.DEFAULT,SWT.DEFAULT).y);
  assistText.setFocus();
  TalendEditorComponentProposalProvider proposalProvider=new TalendEditorComponentProposalProvider(this,proposalList,process);
  contentProposalAdapter=new ContentProposalAdapter(assistText,new TextContentAdapter(),proposalProvider,null,null);
  contentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
  contentProposalAdapter.setLabelProvider(new TalendEditorComponentLabelProvider());
}

Fixed version (ground truth):
private void createAssistText(org.eclipse.swt.graphics.Point cursorRelativePosition){
  if (bindingService != null) {
    bindingService.setKeyFilterEnabled(false);
  }
  highlightOveredConnection(cursorRelativePosition);
  assistText=new Text((Composite)graphicControl,SWT.BORDER);
  assistText.setLocation(cursorRelativePosition.x,cursorRelativePosition.y - assistText.getLineHeight());
  assistText.setSize(200,assistText.computeSize(SWT.DEFAULT,SWT.DEFAULT).y);
  assistText.setFocus();
  TalendEditorComponentProposalProvider proposalProvider=new TalendEditorComponentProposalProvider(this,proposalList,process);
  contentProposalAdapter=new ContentProposalAdapter(assistText,new TextContentAdapter(),proposalProvider,null,null);
  contentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
  contentProposalAdapter.setLabelProvider(new TalendEditorComponentLabelProvider(assistText));
}
Program: 117857
Project: 117857
Buggy source:
@Override public void proposalPopupClosed(ContentProposalAdapter adapter){
  if (assistText != null && !assistText.isFocusControl()) {
    disposeAssistText();
  }
}

Fixed version (ground truth):
@Override public void proposalPopupClosed(ContentProposalAdapter adapter){
  filterText=assistText.getText();
  if (assistText != null && !assistText.isFocusControl()) {
    disposeAssistText();
  }
}
Program: 117858
Project: 117858
Buggy source:
private void initListeners(){
  assistText.addKeyListener(new KeyListener(){
    @Override public void keyReleased(    KeyEvent e){
      if (e.stateMask == SWT.NONE) {
        if (e.keyCode == SWT.ESC) {
          disposeAssistText();
        }
 else         if (e.keyCode == SWT.CR) {
          acceptProposal();
        }
      }
    }
    @Override public void keyPressed(    KeyEvent e){
    }
  }
);
  assistText.addFocusListener(new FocusListener(){
    @Override public void focusLost(    FocusEvent e){
      if (!(contentProposalAdapter.isProposalPopupOpen())) {
        disposeAssistText();
      }
    }
    @Override public void focusGained(    FocusEvent e){
    }
  }
);
  contentProposalAdapter.addContentProposalListener(new IContentProposalListener2(){
    @Override public void proposalPopupOpened(    ContentProposalAdapter adapter){
    }
    @Override public void proposalPopupClosed(    ContentProposalAdapter adapter){
      if (assistText != null && !assistText.isFocusControl()) {
        disposeAssistText();
      }
    }
  }
);
  contentProposalAdapter.addContentProposalListener(new IContentProposalListener(){
    @Override public void proposalAccepted(    IContentProposal proposal){
      acceptProposal();
    }
  }
);
}

Fixed version (ground truth):
private void initListeners(){
  assistText.addKeyListener(new KeyListener(){
    @Override public void keyReleased(    KeyEvent e){
      if (e.stateMask == SWT.NONE) {
        if (e.keyCode == SWT.ESC) {
          disposeAssistText();
        }
 else         if (e.keyCode == SWT.CR) {
          acceptProposal();
        }
      }
    }
    @Override public void keyPressed(    KeyEvent e){
    }
  }
);
  assistText.addFocusListener(new FocusListener(){
    @Override public void focusLost(    FocusEvent e){
      if (!(contentProposalAdapter.isProposalPopupOpen())) {
        disposeAssistText();
      }
    }
    @Override public void focusGained(    FocusEvent e){
    }
  }
);
  contentProposalAdapter.addContentProposalListener(new IContentProposalListener2(){
    @Override public void proposalPopupOpened(    ContentProposalAdapter adapter){
    }
    @Override public void proposalPopupClosed(    ContentProposalAdapter adapter){
      filterText=assistText.getText();
      if (assistText != null && !assistText.isFocusControl()) {
        disposeAssistText();
      }
    }
  }
);
  contentProposalAdapter.addContentProposalListener(new IContentProposalListener(){
    @Override public void proposalAccepted(    IContentProposal proposal){
      acceptProposal();
    }
  }
);
}
Program: 117859
Project: 117859
Buggy source:
protected Object createComponent(IComponent component,org.eclipse.swt.graphics.Point location){
  if (component == null) {
    return null;
  }
  Object newNode;
  Event e=new Event();
  e.x=location.x;
  e.y=location.y;
  e.button=1;
  e.count=1;
  e.stateMask=0;
  e.widget=graphicControl;
  MouseEvent mouseEvent=new MouseEvent(e);
  TalendAssistantCreationTool creationTool=new TalendAssistantCreationTool(new PaletteComponentFactory(component));
  newNode=creationTool.getCreateRequest().getNewObject();
  if (!canCreateAt(newNode,new Point(e.x,e.y))) {
    return null;
  }
  creationTool.mouseMove(mouseEvent,graphicViewer);
  graphicViewer.getEditDomain().setActiveTool(creationTool);
  graphicViewer.getEditDomain().mouseMove(mouseEvent,graphicViewer);
  graphicViewer.getEditDomain().mouseDown(mouseEvent,graphicViewer);
  graphicViewer.getEditDomain().mouseUp(mouseEvent,graphicViewer);
  return newNode;
}

Fixed version (ground truth):
protected Object createComponent(IComponent component,org.eclipse.swt.graphics.Point location){
  if (component == null) {
    return null;
  }
  Object newNode;
  Event e=new Event();
  e.x=location.x;
  e.y=location.y;
  e.button=1;
  e.count=1;
  e.stateMask=0;
  e.widget=graphicControl;
  MouseEvent mouseEvent=new MouseEvent(e);
  TalendAssistantCreationTool creationTool=new TalendAssistantCreationTool(new PaletteComponentFactory(component,filterText));
  newNode=creationTool.getCreateRequest().getNewObject();
  if (!canCreateAt(newNode,new Point(e.x,e.y))) {
    return null;
  }
  creationTool.mouseMove(mouseEvent,graphicViewer);
  graphicViewer.getEditDomain().setActiveTool(creationTool);
  graphicViewer.getEditDomain().mouseMove(mouseEvent,graphicViewer);
  graphicViewer.getEditDomain().mouseDown(mouseEvent,graphicViewer);
  graphicViewer.getEditDomain().mouseUp(mouseEvent,graphicViewer);
  return newNode;
}
Program: 117860
Project: 117860
Buggy source:
@Override public String getText(Object element){
  if (element != null && element instanceof ComponentContentProposal) {
    ComponentContentProposal proposal=(ComponentContentProposal)element;
    String label=proposal.getLabel();
    IComponent iComponent=proposal.getComponent();
    if (iComponent != null) {
      return label + "String_Node_Str" + iComponent.getOriginalFamilyName();
    }
 else {
      return label;
    }
  }
  return super.getText(element);
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (element != null && element instanceof ComponentContentProposal) {
    ComponentContentProposal proposal=(ComponentContentProposal)element;
    String label=proposal.getLabel();
    IComponent iComponent=proposal.getComponent();
    if (iComponent != null) {
      if (!assistText.isDisposed()) {
        label=UnifiedComponentUtil.getComponentDisplayNameForPalette(iComponent,assistText.getText());
      }
      return label + "String_Node_Str" + iComponent.getOriginalFamilyName();
    }
 else {
      return label;
    }
  }
  return super.getText(element);
}
Program: 117861
Project: 117861
Buggy source:
public PaletteComponentFactory(IComponent c){
  component=c;
}

Fixed version (ground truth):
public PaletteComponentFactory(IComponent c,String filter){
  component=c;
  this.filter=filter;
}
Program: 117862
Project: 117862
Buggy source:
@Override public Object getNewObject(){
  String componentName=null;
  if (component != null) {
    componentName=component.getName();
  }
  if (componentName != null && componentName.toLowerCase().equals("String_Node_Str")) {
    return new Note();
  }
 else {
    return new Node(component);
  }
}

Fixed version (ground truth):
@Override public Object getNewObject(){
  String componentName=null;
  if (component != null) {
    componentName=component.getName();
  }
  if (componentName != null && componentName.toLowerCase().equals("String_Node_Str")) {
    return new Note();
  }
 else {
    IComponent emfComponent=UnifiedComponentUtil.getUnifiedComponentByFilter(component,filter);
    if (emfComponent != null) {
      return new Node(component,emfComponent);
    }
    return new Node(component);
  }
}
Program: 117863
Project: 117863
Buggy source:
public static TalendCombinedTemplateCreationEntry createEntryFrom(IComponent component){
  if (component == null) {
    return null;
  }
  String name=component.getName();
  ImageDescriptor imageSmall=component.getIcon16();
  IPreferenceStore store=DesignerPlugin.getDefault().getPreferenceStore();
  ImageDescriptor imageLarge;
  final String string=store.getString(TalendDesignerPrefConstants.LARGE_ICONS_SIZE);
  if (string.equals("String_Node_Str")) {
    imageLarge=component.getIcon24();
  }
 else {
    imageLarge=component.getIcon32();
  }
  TalendCombinedTemplateCreationEntry newEntry=new TalendCombinedTemplateCreationEntry(name,name,Node.class,component,imageSmall,imageLarge);
  newEntry.setDescription(component.getLongName());
  return newEntry;
}

Fixed version (ground truth):
public static TalendCombinedTemplateCreationEntry createEntryFrom(IComponent component){
  if (component == null) {
    return null;
  }
  IComponent delegateComponent=UnifiedComponentUtil.getDelegateComponent(component);
  String name=component.getName();
  String filter=null;
  if (delegateComponent != component) {
    filter=component.getName();
    name=UnifiedComponentUtil.getComponentDisplayNameForPalette(delegateComponent,filter);
  }
  ImageDescriptor imageSmall=delegateComponent.getIcon16();
  IPreferenceStore store=DesignerPlugin.getDefault().getPreferenceStore();
  ImageDescriptor imageLarge;
  final String string=store.getString(TalendDesignerPrefConstants.LARGE_ICONS_SIZE);
  if (string.equals("String_Node_Str")) {
    imageLarge=delegateComponent.getIcon24();
  }
 else {
    imageLarge=delegateComponent.getIcon32();
  }
  TalendCombinedTemplateCreationEntry newEntry=new TalendCombinedTemplateCreationEntry(name,name,Node.class,delegateComponent,imageSmall,imageLarge,filter);
  newEntry.setDescription(component.getLongName());
  return newEntry;
}
Program: 117867
Project: 117867
Buggy source:
@Override public boolean setGenericPropertyValue(IElementParameter param){
  if (param == null || param.getName() == null) {
    return false;
  }
  if (param instanceof GenericElementParameter) {
    ComponentProperties componentProperties=((Node)((GenericElementParameter)param).getElement()).getComponentProperties();
    Properties currentProperties=ComponentsUtils.getCurrentProperties(componentProperties,param.getName());
    if (currentProperties == null) {
      return false;
    }
    Property<?> property=componentProperties.getValuedProperty(param.getName());
    if (property != null) {
      property.setTaggedValue(IGenericConstants.REPOSITORY_VALUE,param.getName());
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean setGenericPropertyValue(IElementParameter param){
  if (param == null || param.getName() == null) {
    return false;
  }
  if (param instanceof GenericElementParameter) {
    ComponentProperties componentProperties=((Node)((GenericElementParameter)param).getElement()).getComponentProperties();
    Property<?> property=componentProperties.getValuedProperty(param.getName());
    if (property != null) {
      property.setTaggedValue(IGenericConstants.REPOSITORY_VALUE,param.getName());
      return true;
    }
    Properties currentProperties=((GenericElementParameter)param).getProperties();
    if (currentProperties != null) {
      boolean isRepostory=false;
      for (      NamedThing thing : currentProperties.getProperties()) {
        if (thing instanceof Property) {
          ((Property)thing).setTaggedValue(IGenericConstants.REPOSITORY_VALUE,param.getName());
          isRepostory=true;
        }
      }
      return isRepostory;
    }
  }
  return false;
}
Program: 117868
Project: 117868
Buggy source:
@Override public Object getElementParameterValueFromComponentProperties(INode iNode,IElementParameter param){
  if (iNode != null) {
    ComponentProperties iNodeComponentProperties=iNode.getComponentProperties();
    if (iNodeComponentProperties != null && param instanceof GenericElementParameter) {
      Properties paramProperties=ComponentsUtils.getCurrentProperties(iNodeComponentProperties,param.getName());
      if (paramProperties != null) {
        Property property=iNodeComponentProperties.getValuedProperty(param.getName());
        if (property != null) {
          if (property.getTaggedValue(IGenericConstants.REPOSITORY_VALUE) != null) {
            param.setRepositoryValue(param.getName());
            param.setRepositoryValueUsed(true);
          }
        }
        Object value=ComponentsUtils.getGenericPropertyValue(iNodeComponentProperties,param.getName());
        if (value == null && EParameterFieldType.TABLE.equals(param.getFieldType())) {
          value=GenericTableUtils.getTableValues(iNodeComponentProperties.getProperties(param.getName()),param);
        }
        return value;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Object getElementParameterValueFromComponentProperties(INode iNode,IElementParameter param){
  if (iNode != null) {
    ComponentProperties iNodeComponentProperties=iNode.getComponentProperties();
    if (iNodeComponentProperties != null && param instanceof GenericElementParameter) {
      Properties paramProperties=ComponentsUtils.getCurrentProperties(iNodeComponentProperties,param.getName());
      if (paramProperties != null) {
        Property property=iNodeComponentProperties.getValuedProperty(param.getName());
        if (property != null) {
          if (property.getTaggedValue(IGenericConstants.REPOSITORY_VALUE) != null) {
            param.setRepositoryValue(param.getName());
            param.setRepositoryValueUsed(true);
          }
        }
 else {
          Properties currentProperties=((GenericElementParameter)param).getProperties();
          if (currentProperties != null) {
            boolean isRepostory=false;
            for (            NamedThing thing : currentProperties.getProperties()) {
              if (thing instanceof Property) {
                if (((Property)thing).getTaggedValue(IGenericConstants.REPOSITORY_VALUE) != null) {
                  isRepostory=true;
                }
              }
            }
            if (isRepostory) {
              param.setRepositoryValue(param.getName());
              param.setRepositoryValueUsed(true);
            }
          }
        }
        Object value=ComponentsUtils.getGenericPropertyValue(iNodeComponentProperties,param.getName());
        if (value == null && EParameterFieldType.TABLE.equals(param.getFieldType())) {
          value=GenericTableUtils.getTableValues(iNodeComponentProperties.getProperties(param.getName()),param);
        }
        return value;
      }
    }
  }
  return null;
}
Program: 117870
Project: 117870
Buggy source:
private String getParamNameForOldJDBC(IElementParameter param){
  String paramName=param.getName();
  if (elem instanceof Node) {
    Node node=(Node)elem;
    if (connection instanceof DatabaseConnection) {
      String databaseType=((DatabaseConnection)connection).getDatabaseType();
      if ("String_Node_Str".equals(databaseType)) {
        IComponent component=node.getComponent();
        if (!ComponentCategory.CATEGORY_4_DI.getName().equals(component.getComponentType()) && component.getName().startsWith("String_Node_Str")) {
          if (EParameterName.URL.getName().equals(paramName)) {
            return "String_Node_Str";
          }
 else           if (EParameterName.DRIVER_JAR.getName().equals(paramName)) {
            return "String_Node_Str";
          }
 else           if (EParameterName.DRIVER_CLASS.getName().equals(paramName)) {
            return "String_Node_Str";
          }
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private String getParamNameForOldJDBC(IElementParameter param){
  String paramName=param.getName();
  if (elem instanceof Node) {
    Node node=(Node)elem;
    if (connection instanceof DatabaseConnection) {
      String databaseType=((DatabaseConnection)connection).getDatabaseType();
      if ("String_Node_Str".equals(databaseType)) {
        IComponent component=node.getComponent();
        if (!ComponentCategory.CATEGORY_4_DI.getName().equals(component.getPaletteType()) && component.getName().startsWith("String_Node_Str")) {
          if (EParameterName.URL.getName().equals(paramName)) {
            return "String_Node_Str";
          }
 else           if (EParameterName.DRIVER_JAR.getName().equals(paramName)) {
            return "String_Node_Str";
          }
 else           if (EParameterName.DRIVER_CLASS.getName().equals(paramName)) {
            return "String_Node_Str";
          }
        }
      }
    }
  }
  return null;
}