nus-yam/ex-repair huggingface dataset:
Program: 2719
Project: 2719
Buggy source:
private boolean replaceRemoteSourcesFromLocal(IProject project,final String remoteGitRepo,final CredentialsProvider credProvider) throws InvalidRemoteException {
  InitCommand initCmd=Git.init();
  File repoDir=new File(project.getLocation().toOSString());
  initCmd.setDirectory(repoDir);
  initCmd.call();
  try {
    Git localRepo=Git.open(repoDir);
    AddCommand addCmd=localRepo.add();
    addCmd.addFilepattern("String_Node_Str");
    addCmd.call();
    CommitCommand commitCmd=localRepo.commit();
    commitCmd.setAll(true);
    commitCmd.setMessage("String_Node_Str");
    commitCmd.call();
    StoredConfig repoCfg=localRepo.getRepository().getConfig();
    repoCfg.setString("String_Node_Str","String_Node_Str","String_Node_Str",remoteGitRepo);
    repoCfg.setString("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    repoCfg.save();
    PushCommand pushCmd=localRepo.push();
    pushCmd.setForce(true);
    pushCmd.setCredentialsProvider(credProvider);
    pushCmd.call();
    return true;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  NoFilepatternException e) {
    e.printStackTrace();
  }
catch (  NoHeadException e) {
    e.printStackTrace();
  }
catch (  NoMessageException e) {
    e.printStackTrace();
  }
catch (  ConcurrentRefUpdateException e) {
    e.printStackTrace();
  }
catch (  JGitInternalException e) {
    e.printStackTrace();
  }
catch (  WrongRepositoryStateException e) {
    e.printStackTrace();
  }
  return false;
}

Fixed version (ground truth):
private boolean replaceRemoteSourcesFromLocal(IProject project,final String remoteGitRepo,final CredentialsProvider credProvider) throws InvalidRemoteException {
  InitCommand initCmd=Git.init();
  File repoDir=new File(project.getLocation().toOSString());
  initCmd.setDirectory(repoDir);
  initCmd.call();
  try {
    Git localRepo=Git.open(repoDir);
    AddCommand addCmd=localRepo.add();
    addCmd.addFilepattern("String_Node_Str");
    addCmd.call();
    CommitCommand commitCmd=localRepo.commit();
    commitCmd.setAll(true);
    commitCmd.setMessage("String_Node_Str");
    commitCmd.call();
    StoredConfig repoCfg=localRepo.getRepository().getConfig();
    repoCfg.setString("String_Node_Str","String_Node_Str","String_Node_Str",remoteGitRepo);
    repoCfg.setString("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    repoCfg.save();
    PushCommand pushCmd=localRepo.push();
    pushCmd.setForce(true);
    pushCmd.setCredentialsProvider(credProvider);
    pushCmd.call();
    return true;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  NoFilepatternException e) {
    e.printStackTrace();
  }
catch (  NoHeadException e) {
    e.printStackTrace();
  }
catch (  NoMessageException e) {
    e.printStackTrace();
  }
catch (  ConcurrentRefUpdateException e) {
    e.printStackTrace();
  }
catch (  JGitInternalException e) {
    DialogUtils.error("String_Node_Str",e.toString());
    e.printStackTrace();
  }
catch (  WrongRepositoryStateException e) {
    e.printStackTrace();
  }
  return false;
}
Program: 2720
Project: 2720
Buggy source:
/** 
 * @throws ProjectNotFoundExtension The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(IProgressMonitor monitor) throws CoreException, ProjectNotFoundException {
  try {
    monitor.beginTask("String_Node_Str",1);
    if (m_pageLink.isNewProject()) {
      if (RhoHub.getInstance(m_setting).createRemoteAppFromLocalSources(m_selectedProject,new GitCredentialsProvider()) == null) {
        DialogUtils.error("String_Node_Str","String_Node_Str");
        IRhoHubSettingSetter setter=(IRhoHubSettingSetter)m_setting;
        setter.unsetLinking();
        OSHelper.deleteFolder(new File(m_selectedProject.getLocation().toOSString() + File.separator + "String_Node_Str"));
        return;
      }
    }
 else {
      if (DialogUtils.quetsion("String_Node_Str","String_Node_Str")) {
        RhoHub.getInstance(m_setting).updateRemoteAppFromLocalSources(m_selectedProject,m_pageLink.getSelectedProjectUrl(),new GitCredentialsProvider());
      }
 else {
        return;
      }
    }
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",UiConstants.rhodesPerspectiveId);
    job.schedule();
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @throws ProjectNotFoundExtension The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(IProgressMonitor monitor) throws CoreException, ProjectNotFoundException {
  try {
    monitor.beginTask("String_Node_Str",1);
    IRhoHubSettingSetter setter=(IRhoHubSettingSetter)m_setting;
    if (m_pageLink.isNewProject()) {
      if (RhoHub.getInstance(m_setting).createRemoteAppFromLocalSources(m_selectedProject,new GitCredentialsProvider()) == null) {
        DialogUtils.error("String_Node_Str","String_Node_Str");
        setter.unsetLinking();
        OSHelper.deleteFolder(new File(m_selectedProject.getLocation().toOSString() + File.separator + "String_Node_Str"));
        return;
      }
    }
 else {
      if (DialogUtils.quetsion("String_Node_Str","String_Node_Str")) {
        RhoHub.getInstance(m_setting).updateRemoteAppFromLocalSources(m_selectedProject,m_pageLink.getSelectedProjectUrl(),new GitCredentialsProvider());
      }
 else {
        return;
      }
    }
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",UiConstants.rhodesPerspectiveId);
    job.schedule();
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2721
Project: 2721
Buggy source:
void encodeVersionCombo(String selVersion){
  try {
    String selPlatform=m_configuration.getAttribute(ConfigurationConstants.platforrmCfgAttribute,"String_Node_Str");
    PlatformType type=PlatformType.fromId(selPlatform);
    if (type == PlatformType.eAndroid) {
      m_configuration.setAttribute(ConfigurationConstants.androidVersionAttribute,selVersion);
      m_ymlFile.setAndroidVer(selVersion);
      m_ymlFile.save();
    }
 else     if (type == PlatformType.eBb) {
      m_configuration.setAttribute(ConfigurationConstants.blackberryVersionAttribute,selVersion);
      m_ymlFile.setBbVer(selVersion);
      m_ymlFile.save();
      showBbEmuName();
    }
 else     if (type == PlatformType.eIPhone) {
      m_configuration.setAttribute(ConfigurationConstants.iphoneVersionAttribute,selVersion);
      m_ymlFile.setIphoneVer(selVersion);
      m_ymlFile.save();
    }
 else     if (type == PlatformType.eWm) {
      m_configuration.setAttribute(ConfigurationConstants.wmVersionAttribute,selVersion);
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
catch (  FileNotFoundException e) {
    MessageDialog.openError(getShell(),"String_Node_Str","String_Node_Str" + getSelectProject().getName());
    e.printStackTrace();
  }
}

Fixed version (ground truth):
void encodeVersionCombo(String selVersion){
  try {
    String selPlatform=m_configuration.getAttribute(ConfigurationConstants.platforrmCfgAttribute,"String_Node_Str");
    PlatformType type=PlatformType.fromId(selPlatform);
    if (type == PlatformType.eAndroid) {
      m_configuration.setAttribute(ConfigurationConstants.androidVersionAttribute,selVersion);
      m_ymlFile.setAndroidVer(selVersion);
      m_ymlFile.save();
    }
 else     if (type == PlatformType.eBb) {
      m_configuration.setAttribute(ConfigurationConstants.blackberryVersionAttribute,selVersion);
      m_ymlFile.setBbVer(selVersion);
      m_ymlFile.save();
      showBbEmuName();
    }
 else     if (type == PlatformType.eIPhone) {
      m_configuration.setAttribute(ConfigurationConstants.iphoneVersionAttribute,selVersion);
      m_ymlFile.setIphoneVer(selVersion);
      m_ymlFile.save();
    }
 else     if (type == PlatformType.eWm) {
      m_configuration.setAttribute(ConfigurationConstants.wmVersionAttribute,selVersion);
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
}
Program: 2722
Project: 2722
Buggy source:
public void showBbEmuName(){
  try {
    String sdkPath=m_ymlFile.getSdkConfigPath();
    String bbVer=m_ymlFile.getBlackberryVer();
    SdkYmlFile sdkFile=new SdkYmlFile(sdkPath);
    if (sdkFile != null && sdkFile.getBbSimPort(bbVer) != null)     m_adroidEmuNameText.setText(sdkFile.getBbSimPort(bbVer));
 else     m_adroidEmuNameText.setText("String_Node_Str");
    m_androidEmuNameLabel.setText("String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void showBbEmuName(){
  try {
    String sdkPath=m_ymlFile.getSdkConfigPath();
    String bbVer=m_ymlFile.getBlackberryVer();
    SdkYmlFile sdkFile=new SdkYmlFile(sdkPath);
    if (sdkFile.getBbSimPort(bbVer) != null)     m_adroidEmuNameText.setText(sdkFile.getBbSimPort(bbVer));
 else     m_adroidEmuNameText.setText("String_Node_Str");
    m_androidEmuNameLabel.setText("String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}
Program: 2723
Project: 2723
Buggy source:
private void encodeEmuNameText(String emuName){
  if (m_configuration != null && m_ymlFile != null) {
    try {
      String selProjectPlatform=m_configuration.getAttribute(ConfigurationConstants.platforrmCfgAttribute,"String_Node_Str");
      if (selProjectPlatform.equals(PlatformType.eAndroid.id)) {
        m_configuration.setAttribute(ConfigurationConstants.androidEmuNameAttribute,emuName);
        if (!emuName.equals("String_Node_Str")) {
          m_ymlFile.setAndroidEmuName(emuName);
        }
 else {
          if (emuName == null || !emuName.equals("String_Node_Str")) {
            m_ymlFile.removeAndroidEmuName();
          }
        }
        m_ymlFile.save();
        showApplyButton();
      }
 else       if (selProjectPlatform.equals(PlatformType.eBb.id)) {
        String sdkPath=m_ymlFile.getSdkConfigPath();
        String bbVer=m_ymlFile.getBlackberryVer();
        Integer simVer=new Integer(emuName);
        SdkYmlFile sdkFile=new SdkYmlFile(sdkPath);
        sdkFile.setBbSimPort(bbVer,simVer);
        sdkFile.save();
        showApplyButton();
      }
    }
 catch (    NumberFormatException e) {
      e.printStackTrace();
    }
catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void encodeEmuNameText(String emuName){
  if (m_configuration != null && m_ymlFile != null) {
    try {
      String selProjectPlatform=m_configuration.getAttribute(ConfigurationConstants.platforrmCfgAttribute,"String_Node_Str");
      if (selProjectPlatform.equals(PlatformType.eAndroid.id)) {
        m_configuration.setAttribute(ConfigurationConstants.androidEmuNameAttribute,emuName);
        if (!emuName.equals("String_Node_Str")) {
          m_ymlFile.setAndroidEmuName(emuName);
        }
 else {
          m_ymlFile.removeAndroidEmuName();
        }
        m_ymlFile.save();
        showApplyButton();
      }
 else       if (selProjectPlatform.equals(PlatformType.eBb.id)) {
        String sdkPath=m_ymlFile.getSdkConfigPath();
        String bbVer=m_ymlFile.getBlackberryVer();
        Integer simVer=new Integer(emuName);
        SdkYmlFile sdkFile=new SdkYmlFile(sdkPath);
        sdkFile.setBbSimPort(bbVer,simVer);
        sdkFile.save();
        showApplyButton();
      }
    }
 catch (    NumberFormatException e) {
      e.printStackTrace();
    }
catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}
Program: 2724
Project: 2724
Buggy source:
/** 
 * The action has been activated. The argument of the method represents the 'real' action sitting in the workbench UI.
 * @see IWorkbenchWindowActionDelegate#run
 */
@Override public void run(IAction action){
  IProject project=ProjectFactory.getInstance().getSelectedProject();
  if (project == null) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    return;
  }
  if (!RhodesProject.checkNature(project) && !RhoelementsProject.checkNature(project)) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    return;
  }
  IRhoHubSetting setting=RhoHubBundleSetting.createGetter(project);
  if (setting.getToken().isEmpty() || setting.getServerUrl().isEmpty()) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    return;
  }
  if (!checkProjectProperties(project)) {
    if (DialogUtils.confirm("String_Node_Str","String_Node_Str" + project.getName() + "String_Node_Str")) {
      LinkWizard linkWizard=new LinkWizard(project);
      if (createWizardDialog(linkWizard) == Window.CANCEL)       return;
    }
 else {
      return;
    }
  }
  BuildWizard buildWizard=new BuildWizard(project);
  createWizardDialog(buildWizard);
}

Fixed version (ground truth):
/** 
 * The action has been activated. The argument of the method represents the 'real' action sitting in the workbench UI.
 * @see IWorkbenchWindowActionDelegate#run
 */
@Override public void run(IAction action){
  IProject project=ProjectFactory.getInstance().getSelectedProject();
  if (project == null) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    return;
  }
  if (!RhodesProject.checkNature(project) && !RhoelementsProject.checkNature(project)) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    return;
  }
  IRhoHubSetting setting=RhoHubBundleSetting.createGetter(project);
  if (setting.getToken().isEmpty() || setting.getServerUrl().isEmpty()) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    return;
  }
  if (!checkProjectProperties(project)) {
    if (DialogUtils.confirm("String_Node_Str","String_Node_Str" + project.getName() + "String_Node_Str")) {
      LinkWizard linkWizard=new LinkWizard(project);
      if (createWizardDialog(linkWizard) == Window.CANCEL)       return;
    }
 else {
      return;
    }
  }
  if (setting.isLinking()) {
    BuildWizard buildWizard=new BuildWizard(project);
    createWizardDialog(buildWizard);
  }
}
Program: 2725
Project: 2725
Buggy source:
private JSONArray getAppList() throws CoreException, JSONException, InterruptedException {
  if (rhohubConfiguration == null)   return null;
  AppListTask task=new AppListTask(rhohubConfiguration);
  task.runAndWaitJob("String_Node_Str");
  if (!task.isOk())   return null;
  return task.getOutputAsJSON();
}

Fixed version (ground truth):
private JSONArray getAppList() throws CoreException, JSONException, InterruptedException {
  if (rhohubConfiguration == null)   return null;
  AppListTask task=new AppListTask(rhohubConfiguration);
  task.run();
  String s=task.getError();
  if (!task.isOk())   return null;
  return task.getOutputAsJSON();
}
Program: 2726
Project: 2726
Buggy source:
private void initialize(){
  setDescription("String_Node_Str");
  try {
    JSONList<RemoteProjectDesc> remoteProjects=RhoHub.getInstance(m_setting).getProjectsList();
    if (remoteProjects.size() == 0) {
      DialogUtils.error("String_Node_Str","String_Node_Str");
      this.getShell().close();
      return;
    }
 else {
      for (      RemoteProjectDesc project : remoteProjects) {
        TableItem item=new TableItem(m_remoteProjectsList,SWT.NONE);
        item.setText(nameColIdx,project.getName());
        item.setText(urlColIdx,project.getGitLink());
      }
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
catch (  JSONException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void initialize(){
  setDescription("String_Node_Str");
  try {
    JSONList<RemoteProjectDesc> remoteProjects=RhoHub.getInstance(m_setting).getProjectsList();
    for (    RemoteProjectDesc project : remoteProjects) {
      TableItem item=new TableItem(m_remoteProjectsList,SWT.NONE);
      item.setText(nameColIdx,project.getName());
      item.setText(urlColIdx,project.getGitLink());
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
catch (  JSONException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 2727
Project: 2727
Buggy source:
/** 
 * @throws ProjectNotFoundExtension The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(IProgressMonitor monitor) throws CoreException, ProjectNotFoundException {
  try {
    monitor.beginTask("String_Node_Str",1);
    if (m_pageLink.isNewProject()) {
      RhoHub.getInstance(m_setting).createRemoteAppFromLocalSources(m_selectedProject,new GitCredentialsProvider());
    }
 else {
      if (DialogUtils.quetsion("String_Node_Str","String_Node_Str")) {
        RhoHub.getInstance(m_setting).updateRemoteAppFromLocalSources(m_selectedProject,m_pageLink.getSelectedProjectUrl(),new GitCredentialsProvider());
      }
 else {
        return;
      }
    }
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",UiConstants.rhodesPerspectiveId);
    job.schedule();
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @throws ProjectNotFoundExtension The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(IProgressMonitor monitor) throws CoreException, ProjectNotFoundException {
  try {
    monitor.beginTask("String_Node_Str",1);
    if (m_pageLink.isNewProject()) {
      if (RhoHub.getInstance(m_setting).createRemoteAppFromLocalSources(m_selectedProject,new GitCredentialsProvider()) == null) {
        DialogUtils.error("String_Node_Str","String_Node_Str");
        IRhoHubSettingSetter setter=(IRhoHubSettingSetter)m_setting;
        setter.unsetLinking();
        return;
      }
    }
 else {
      if (DialogUtils.quetsion("String_Node_Str","String_Node_Str")) {
        RhoHub.getInstance(m_setting).updateRemoteAppFromLocalSources(m_selectedProject,m_pageLink.getSelectedProjectUrl(),new GitCredentialsProvider());
      }
 else {
        return;
      }
    }
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",UiConstants.rhodesPerspectiveId);
    job.schedule();
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2728
Project: 2728
Buggy source:
/** 
 * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException {
      try {
        doFinish(monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
catch (      ProjectNotFoundException e) {
        e.printStackTrace();
      }
 finally {
        monitor.done();
      }
    }
  }
;
  try {
    getContainer().run(true,true,op);
  }
 catch (  InterruptedException e) {
    return false;
  }
catch (  InvocationTargetException e) {
    Throwable realException=e.getTargetException();
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException {
      try {
        doFinish(monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
catch (      ProjectNotFoundException e) {
        e.printStackTrace();
      }
 finally {
        monitor.done();
      }
    }
  }
;
  try {
    getContainer().run(true,true,op);
  }
 catch (  InterruptedException e) {
    return false;
  }
catch (  InvocationTargetException e) {
    return false;
  }
  return true;
}
Program: 2729
Project: 2729
Buggy source:
@Override public boolean get(URIish arg0,CredentialItem... arg1) throws UnsupportedCredentialItem {
  InputDialog dlg=new InputDialog(Display.getCurrent().getActiveShell(),"String_Node_Str","String_Node_Str","String_Node_Str",null){
    @Override protected int getInputTextStyle(){
      return SWT.SINGLE | SWT.BORDER;
    }
  }
;
  dlg.open();
  CredentialItem.StringType pwdCred=(CredentialItem.StringType)arg1[0];
  pwdCred.setValue(dlg.getValue());
  return true;
}

Fixed version (ground truth):
@Override public boolean get(URIish arg0,final CredentialItem... arg1) throws UnsupportedCredentialItem {
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      try {
        InputDialog dlg=new InputDialog(Display.getCurrent().getActiveShell(),"String_Node_Str","String_Node_Str","String_Node_Str",null){
          @Override protected int getInputTextStyle(){
            return SWT.SINGLE | SWT.BORDER;
          }
        }
;
        dlg.open();
        CredentialItem.StringType pwdCred=(CredentialItem.StringType)arg1[0];
        pwdCred.setValue(dlg.getValue());
      }
 catch (      Exception ex) {
        ex.printStackTrace();
      }
    }
  }
);
  return true;
}
Program: 2730
Project: 2730
Buggy source:
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  try {
    updateStatus("String_Node_Str");
    m_remotePlatforms=m_getPlatfomListFuture.get(waitTimeOutRhoHubServer,TimeUnit.MINUTES);
    initializePlatformsCombo();
    m_remoteProjectBuilds=m_getProjectBuildsFuture.get(waitTimeOutRhoHubServer,TimeUnit.MINUTES);
    initializeProjectBuildsTable();
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  ExecutionException e) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    e.printStackTrace();
  }
catch (  TimeoutException e) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    e.printStackTrace();
  }
catch (  JSONException e) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    e.printStackTrace();
  }
catch (  MalformedURLException e) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    e.printStackTrace();
  }
  enableControls(true);
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  try {
    updateStatus("String_Node_Str");
    m_remotePlatforms=m_getPlatfomListFuture.get(waitTimeOutRhoHubServer,TimeUnit.MINUTES);
    initializePlatformsCombo();
    m_remoteProjectBuilds=m_getProjectBuildsFuture.get(waitTimeOutRhoHubServer,TimeUnit.MINUTES);
    initializeProjectBuildsTable();
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    return;
  }
catch (  ExecutionException e) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    e.printStackTrace();
    return;
  }
catch (  TimeoutException e) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    e.printStackTrace();
    return;
  }
catch (  JSONException e) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    e.printStackTrace();
    return;
  }
catch (  MalformedURLException e) {
    DialogUtils.error("String_Node_Str","String_Node_Str");
    e.printStackTrace();
    return;
  }
  enableControls(true);
}
Program: 2731
Project: 2731
Buggy source:
void enableControls(boolean enable){
  m_comboPlatforms.setEnabled(enable);
  m_comboPlatformVersions.setEnabled(enable);
  m_textAppBranch.setEnabled(enable);
  m_textRhodesBranch.setEnabled(enable);
  m_remoteBuildsList.setEnabled(enable);
}

Fixed version (ground truth):
void enableControls(boolean enable){
  m_comboPlatforms.setEnabled(enable);
  m_comboPlatformVersions.setEnabled(enable);
  m_textAppBranch.setEnabled(enable);
  m_textRhodesBranch.setEnabled(enable);
  m_remoteBuildsList.setEnabled(enable);
  m_comboPlatforms.setEnabled(enable);
  m_comboPlatformVersions.setEnabled(enable);
}
Program: 2732
Project: 2732
Buggy source:
public void createAppSettingBarControls(Composite composite){
  GridLayout layout=new GridLayout(1,false);
  layout.verticalSpacing=9;
  composite.setLayout(layout);
  GridData tableAligment=new GridData(SWT.FILL,SWT.FILL,true,true);
  tableAligment.heightHint=200;
  GridData checkBoxAligment=new GridData();
  checkBoxAligment.horizontalAlignment=GridData.FILL;
  checkBoxAligment.horizontalSpan=3;
  m_newAppCheckBox=new Button(composite,SWT.CHECK);
  m_newAppCheckBox.setText("String_Node_Str");
  m_newAppCheckBox.setSelection(m_isNewProject);
  m_newAppCheckBox.setLayoutData(checkBoxAligment);
  m_newAppCheckBox.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      dialogChanged();
    }
  }
);
  Label label=new Label(composite,SWT.NULL);
  label.setText("String_Node_Str");
  m_remoteProjectsList=new Table(composite,SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
  m_remoteProjectsList.setLayoutData(tableAligment);
  m_remoteProjectsList.setEnabled(true);
  m_remoteProjectsList.setHeaderVisible(true);
  m_remoteProjectsList.setLinesVisible(true);
  TableColumn colName=new TableColumn(m_remoteProjectsList,SWT.LEFT);
  colName.setText("String_Node_Str");
  colName.setWidth(350);
  TableColumn colUrl=new TableColumn(m_remoteProjectsList,SWT.LEFT);
  colUrl.setText("String_Node_Str");
  colUrl.setWidth(400);
}

Fixed version (ground truth):
public void createAppSettingBarControls(Composite composite){
  GridLayout layout=new GridLayout(1,false);
  layout.verticalSpacing=9;
  composite.setLayout(layout);
  GridData tableAligment=new GridData(SWT.FILL,SWT.FILL,true,true);
  tableAligment.heightHint=200;
  GridData checkBoxAligment=new GridData();
  checkBoxAligment.horizontalAlignment=GridData.FILL;
  checkBoxAligment.horizontalSpan=3;
  m_newAppCheckBox=new Button(composite,SWT.CHECK);
  m_newAppCheckBox.setText("String_Node_Str");
  m_newAppCheckBox.setSelection(m_isNewProject);
  m_newAppCheckBox.setLayoutData(checkBoxAligment);
  m_newAppCheckBox.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      dialogChanged();
    }
  }
);
  Label label=new Label(composite,SWT.NULL);
  label.setText("String_Node_Str");
  m_remoteProjectsList=new Table(composite,SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
  m_remoteProjectsList.setLayoutData(tableAligment);
  m_remoteProjectsList.setEnabled(true);
  m_remoteProjectsList.setHeaderVisible(true);
  m_remoteProjectsList.setLinesVisible(true);
  m_remoteProjectsList.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      dialogChanged();
    }
  }
);
  TableColumn colName=new TableColumn(m_remoteProjectsList,SWT.LEFT);
  colName.setText("String_Node_Str");
  colName.setWidth(350);
  TableColumn colUrl=new TableColumn(m_remoteProjectsList,SWT.LEFT);
  colUrl.setText("String_Node_Str");
  colUrl.setWidth(400);
}
Program: 2733
Project: 2733
Buggy source:
/** 
 * Ensures that both text fields are set.
 */
private void dialogChanged(){
  m_remoteProjectsList.setEnabled(!m_newAppCheckBox.getSelection());
  m_isNewProject=m_newAppCheckBox.getSelection();
  updateStatus("String_Node_Str");
  updateStatus(null);
}

Fixed version (ground truth):
/** 
 * Ensures that both text fields are set.
 */
private void dialogChanged(){
  m_remoteProjectsList.setEnabled(!m_newAppCheckBox.getSelection());
  if (m_remoteProjectsList.getColumnCount() == 0 || m_remoteProjectsList.getItemCount() == 0 || m_remoteProjectsList.getSelection().length == 0)   return;
  TableItem[] selItem=m_remoteProjectsList.getSelection();
  m_isNewProject=m_newAppCheckBox.getSelection();
  m_selectedUrl=selItem[0].getText(urlColIdx);
  updateStatus("String_Node_Str");
  updateStatus(null);
}
Program: 2734
Project: 2734
Buggy source:
public String getSelectedProjectUrl(){
  return m_remoteProjectsList.getSelection()[urlColIdx].toString();
}

Fixed version (ground truth):
public String getSelectedProjectUrl(){
  return m_selectedUrl;
}
Program: 2735
Project: 2735
Buggy source:
/** 
 * @throws ProjectNotFoundExtension The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(IProgressMonitor monitor) throws CoreException, ProjectNotFoundException {
  try {
    monitor.beginTask("String_Node_Str",1);
    if (m_pageLink.isNewProject()) {
      RhoHub.getInstance(m_setting).createRemoteAppFromLocalSources(m_selectedProject,new GitCredentialsProvider());
    }
 else {
      if (DialogUtils.quetsion("String_Node_Str","String_Node_Str")) {
        RhoHub.getInstance(m_setting).updateRemoteAppFromLocalSources(m_selectedProject,m_pageLink.getSelectedProjectUrl(),new GitCredentialsProvider());
      }
    }
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",UiConstants.rhodesPerspectiveId);
    job.schedule();
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @throws ProjectNotFoundExtension The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(IProgressMonitor monitor) throws CoreException, ProjectNotFoundException {
  try {
    monitor.beginTask("String_Node_Str",1);
    if (m_pageLink.isNewProject()) {
      RhoHub.getInstance(m_setting).createRemoteAppFromLocalSources(m_selectedProject,new GitCredentialsProvider());
    }
 else {
      if (DialogUtils.quetsion("String_Node_Str","String_Node_Str")) {
        RhoHub.getInstance(m_setting).updateRemoteAppFromLocalSources(m_selectedProject,m_pageLink.getSelectedProjectUrl(),new GitCredentialsProvider());
      }
 else {
        return;
      }
    }
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",UiConstants.rhodesPerspectiveId);
    job.schedule();
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2736
Project: 2736
Buggy source:
/** 
 * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException {
      try {
        doFinish(monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
catch (      ProjectNotFoundException e) {
        e.printStackTrace();
      }
 finally {
        monitor.done();
      }
    }
  }
;
  try {
    getContainer().run(true,true,op);
  }
 catch (  InterruptedException e) {
    return false;
  }
catch (  InvocationTargetException e) {
    Throwable realException=e.getTargetException();
    MessageDialog.openError(getShell(),"String_Node_Str",realException.getMessage());
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException {
      try {
        doFinish(monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
catch (      ProjectNotFoundException e) {
        e.printStackTrace();
      }
 finally {
        monitor.done();
      }
    }
  }
;
  try {
    getContainer().run(true,true,op);
  }
 catch (  InterruptedException e) {
    return false;
  }
catch (  InvocationTargetException e) {
    Throwable realException=e.getTargetException();
    return false;
  }
  return true;
}
Program: 2737
Project: 2737
Buggy source:
public int runCommand(List<String> commandLine) throws IOException, InterruptedException {
  if (m_cmdOutput != null) {
    m_cmdOutput.delete(0,m_cmdOutput.length());
  }
  Process process=runCommandHelper(decorateCommandLine(commandLine));
  process.getOutputStream().close();
  startOutputAndErrorReadThreads(process.getInputStream(),process.getErrorStream());
  try {
    return process.waitFor();
  }
  finally {
    notifyOutputAndErrorReadThreadsToStopReading();
  }
}

Fixed version (ground truth):
public int runCommand(List<String> commandLine) throws IOException, InterruptedException {
  Process process=startCommand(commandLine);
  try {
    return process.waitFor();
  }
  finally {
    notifyOutputAndErrorReadThreadsToStopReading();
  }
}
Program: 2738
Project: 2738
Buggy source:
@Override protected void exec(){
  m_console.show();
  m_console.getStream().print(showCommand());
  String[] commandLine=m_cmdLine.toArray(new String[0]);
  Process process;
  try {
    process=DebugPlugin.exec(commandLine,new File(m_workDir));
  }
 catch (  CoreException e) {
    return;
  }
  m_debugProcess=DebugPlugin.newProcess(m_launch,process,m_appName);
  if (m_debugProcess != null) {
    attachConsole(m_debugProcess,m_console);
  }
}

Fixed version (ground truth):
@Override protected void exec(){
  m_console.show();
  m_console.getStream().print(showCommand());
  SysCommandExecutor executor=new SysCommandExecutor();
  executor.setOutputLogDevice(getLogDevice(m_console.getOutputStream()));
  executor.setErrorLogDevice(getLogDevice(m_console.getErrorStream()));
  executor.setWorkingDirectory(m_workDir);
  Process process;
  try {
    process=executor.startCommand(m_cmdLine);
  }
 catch (  IOException e) {
    Activator.logError(e);
    return;
  }
  m_debugProcess=DebugPlugin.newProcess(m_launch,process,m_appName);
  if (m_debugProcess != null) {
    attachConsole(m_debugProcess,m_console);
  }
}
Program: 2739
Project: 2739
Buggy source:
public RubyCodeExecTask(String... codeLines){
  super(null,"String_Node_Str",getArgs(codeLines));
  disableConsole();
}

Fixed version (ground truth):
public RubyCodeExecTask(String... codeLines){
  super("String_Node_Str","String_Node_Str",getArgs(codeLines));
  disableConsole();
}
Program: 2740
Project: 2740
Buggy source:
private static String[] getArgs(String[] codeLines){
  List<String> args=new ArrayList<String>();
  for (  String codeLine : codeLines) {
    args.add("String_Node_Str");
    args.add(codeLine);
  }
  return args.toArray(new String[0]);
}

Fixed version (ground truth):
private static String[] getArgs(String[] codeLines){
  List<String> args=new ArrayList<String>();
  for (  String codeLine : codeLines) {
    codeLine=codeLine.replaceAll("String_Node_Str","String_Node_Str");
    args.add("String_Node_Str");
    args.add("String_Node_Str" + codeLine + "String_Node_Str");
  }
  return args.toArray(new String[0]);
}
Program: 2742
Project: 2742
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  GridLayout layout=new GridLayout();
  container.setLayout(layout);
  layout.numColumns=1;
  layout.verticalSpacing=9;
  Label label=new Label(container,SWT.NULL);
  label.setText(m_errorText);
  setControl(container);
  getShell().setSize(ZeroPage.zeroPageWidth,ZeroPage.zeroPageHeight);
  setErrorMessage("String_Node_Str");
  setPageComplete(true);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  GridLayout layout=new GridLayout();
  container.setLayout(layout);
  layout.numColumns=1;
  layout.verticalSpacing=9;
  Label label=new Label(container,SWT.NULL);
  label.setText(m_errorText);
  setControl(container);
  getShell().setSize(ZeroPage.zeroPageWidth,ZeroPage.zeroPageHeight);
  setErrorMessage(null);
  setPageComplete(true);
}
Program: 2743
Project: 2743
Buggy source:
@Override public String getResName(){
  return calcResName(getBp().getResourcePath().toOSString(),"String_Node_Str");
}

Fixed version (ground truth):
@Override public String getResName(){
  final String token="String_Node_Str";
  return token + calcResName(getBp().getResourcePath().toOSString(),token);
}
Program: 2744
Project: 2744
Buggy source:
public String calcResName(String resName,String token){
  resName=resName.replace('\\','/');
  String[] segments=resName.split(token);
  if (segments.length > 1)   return segments[1];
  return segments[0];
}

Fixed version (ground truth):
public String calcResName(String resName,String token){
  resName=resName.replace('\\','/');
  String[] segments=resName.split(token);
  if (segments.length > 1)   return segments[1];
 else   return null;
}
Program: 2746
Project: 2746
Buggy source:
public static File concat(String... paths){
  File file=new File("String_Node_Str");
  for (int i=0; i < paths.length; i++) {
    file=new File(file,paths[i]);
  }
  return file;
}

Fixed version (ground truth):
public static File concat(String... paths){
  File file=new File((paths.length <= 0) ? "String_Node_Str" : paths[0]);
  for (int i=1; i < paths.length; i++) {
    file=new File(file,paths[i]);
  }
  return file;
}
Program: 2747
Project: 2747
Buggy source:
private void notifyOutputAndErrorReadThreadsToStopReading() throws InterruptedException {
  m_cmdOutputThread.stopReading();
  m_cmdErrorThread.stopReading();
}

Fixed version (ground truth):
private void notifyOutputAndErrorReadThreadsToStopReading() throws InterruptedException {
  m_cmdOutputThread.join(1000);
  if (m_cmdOutputThread.isAlive()) {
    m_cmdOutputThread.stopReading();
  }
  m_cmdErrorThread.join(1000);
  if (m_cmdErrorThread.isAlive()) {
    m_cmdErrorThread.stopReading();
  }
}
Program: 2748
Project: 2748
Buggy source:
private void notifyOutputAndErrorReadThreadsToStopReading(){
  m_cmdOutputThread.stopReading();
  m_cmdErrorThread.stopReading();
}

Fixed version (ground truth):
private void notifyOutputAndErrorReadThreadsToStopReading() throws InterruptedException {
  m_cmdOutputThread.join();
  m_cmdErrorThread.join();
}
Program: 2749
Project: 2749
Buggy source:
private void readFile() throws IOException, InterruptedException {
  BufferedReader bufOut=new BufferedReader(new InputStreamReader(m_inputStream));
  String line=null;
  while (m_stopFlag == false) {
    if (bufOut.ready()) {
      line=bufOut.readLine();
      m_buffer.append(line + fNewLine);
      printToDisplayDevice(line);
    }
 else {
      int timeCounter=0;
      while (timeCounter < maxWaitingTimeForReadFile) {
        Thread.sleep(waitingTimePortion);
        timeCounter+=waitingTimePortion;
      }
    }
  }
  bufOut.close();
  printToConsole("String_Node_Str" + m_threadId);
}

Fixed version (ground truth):
private void readFile() throws IOException, InterruptedException {
  BufferedReader bufOut=new BufferedReader(new InputStreamReader(m_inputStream));
  String line=null;
  while (m_stopFlag == false) {
    if (bufOut.ready()) {
      line=bufOut.readLine();
      m_buffer.append(line + fNewLine);
      printToDisplayDevice(line);
    }
 else {
      int timeCounter=0;
      while (timeCounter < maxWaitingTimeForReadFile) {
        Thread.sleep(waitingTimePortion);
        timeCounter+=waitingTimePortion;
        if (m_stopFlag)         break;
      }
    }
  }
  bufOut.close();
  printToConsole("String_Node_Str" + m_threadId);
}
Program: 2750
Project: 2750
Buggy source:
public Map<String,?> runTask(Class<?> id,Map<String,Object> params){
  IRunTask task=m_holdTasks.get(id);
  if (task != null) {
    task.setData(params);
    task.run();
    return task.getResult();
  }
  throw new IndexOutOfBoundsException();
}

Fixed version (ground truth):
public Map<String,?> runTask(Class<? extends IRunTask> id,Map<String,Object> params){
  IRunTask task=m_holdTasks.get(id);
  if (task != null) {
    task.setData(params);
    task.run();
    return task.getResult();
  }
  throw new IndexOutOfBoundsException();
}
Program: 2751
Project: 2751
Buggy source:
public RhoTaskHolder(){
  m_holdTasks=new HashMap<Class<?>,IRunTask>();
  m_holdTasks.put(GenerateRhodesAppTask.class,new GenerateRhodesAppTask());
  m_holdTasks.put(GenerateRhodesModelTask.class,new GenerateRhodesModelTask());
  m_holdTasks.put(RunReleaseRhodesAppTask.class,new RunReleaseRhodesAppTask());
  m_holdTasks.put(RunDebugRhodesAppTask.class,new RunDebugRhodesAppTask());
  m_holdTasks.put(GenerateRhoconnectAppTask.class,new GenerateRhoconnectAppTask());
  m_holdTasks.put(GenerateRhoconnectAdapterTask.class,new GenerateRhoconnectAdapterTask());
  m_holdTasks.put(RunDebugRhoconnectAppTask.class,new RunDebugRhoconnectAppTask());
  m_holdTasks.put(RunReleaseRhoconnectAppTask.class,new RunReleaseRhoconnectAppTask());
  m_holdTasks.put(CleanPlatformTask.class,new CleanPlatformTask());
  m_holdTasks.put(CleanAllPlatfromTask.class,new CleanAllPlatfromTask());
  m_holdTasks.put(CompileRubyPartTask.class,new CompileRubyPartTask());
  m_holdTasks.put(BuildPlatformTask.class,new BuildPlatformTask());
  m_holdTasks.put(GenerateRhodesSpecTask.class,new GenerateRhodesSpecTask());
  m_holdTasks.put(GenerateRhodesExtensionTask.class,new GenerateRhodesExtensionTask());
}

Fixed version (ground truth):
public RhoTaskHolder(){
  m_holdTasks=new HashMap<Class<? extends IRunTask>,IRunTask>();
  m_holdTasks.put(GenerateRhodesAppTask.class,new GenerateRhodesAppTask());
  m_holdTasks.put(GenerateRhodesModelTask.class,new GenerateRhodesModelTask());
  m_holdTasks.put(RunReleaseRhodesAppTask.class,new RunReleaseRhodesAppTask());
  m_holdTasks.put(RunDebugRhodesAppTask.class,new RunDebugRhodesAppTask());
  m_holdTasks.put(GenerateRhoconnectAppTask.class,new GenerateRhoconnectAppTask());
  m_holdTasks.put(GenerateRhoconnectAdapterTask.class,new GenerateRhoconnectAdapterTask());
  m_holdTasks.put(RunDebugRhoconnectAppTask.class,new RunDebugRhoconnectAppTask());
  m_holdTasks.put(RunReleaseRhoconnectAppTask.class,new RunReleaseRhoconnectAppTask());
  m_holdTasks.put(CleanPlatformTask.class,new CleanPlatformTask());
  m_holdTasks.put(CleanAllPlatfromTask.class,new CleanAllPlatfromTask());
  m_holdTasks.put(CompileRubyPartTask.class,new CompileRubyPartTask());
  m_holdTasks.put(BuildPlatformTask.class,new BuildPlatformTask());
  m_holdTasks.put(GenerateRhodesSpecTask.class,new GenerateRhodesSpecTask());
  m_holdTasks.put(GenerateRhodesExtensionTask.class,new GenerateRhodesExtensionTask());
}
Program: 2752
Project: 2752
Buggy source:
/** 
 * Just do the basics: create a basic project.
 * @param location
 * @param projectName
 * @throws AlredyCreatedException 
 * @throws CoreException 
 */
private IProject createBaseProject(BuildInfoHolder projectInfo) throws AlredyCreatedException, CoreException {
  IProject newProject=ResourcesPlugin.getWorkspace().getRoot().getProject(projectInfo.appName);
  if (!newProject.exists()) {
    URI projectLocation=projectInfo.getProjectLocation();
    String path=URIUtil.toPath(projectLocation).toOSString();
    if (!projectInfo.existCreate) {
      path=path + File.separatorChar + projectInfo.appName;
    }
    IProjectDescription desc=newProject.getWorkspace().newProjectDescription(newProject.getName());
    if (isProjectLocationInWorkspace(path))     projectInfo.isInDefaultWs=true;
    if (!projectInfo.isInDefaultWs) {
      desc.setLocationURI(URIUtil.toURI(path));
    }
    newProject.create(desc,null);
    if (!newProject.isOpen()) {
      newProject.open(null);
    }
  }
 else {
    throw new AlredyCreatedException(newProject);
  }
  return newProject;
}

Fixed version (ground truth):
/** 
 * Just do the basics: create a basic project.
 * @param location
 * @param projectName
 * @throws AlredyCreatedException 
 * @throws CoreException 
 */
private IProject createBaseProject(BuildInfoHolder projectInfo) throws AlredyCreatedException, CoreException {
  IProject newProject=ResourcesPlugin.getWorkspace().getRoot().getProject(projectInfo.appName);
  if (!newProject.exists()) {
    URI projectLocation=projectInfo.getProjectLocation();
    String path=URIUtil.toPath(projectLocation).toOSString();
    if (!projectInfo.existCreate) {
      path=path + File.separatorChar + projectInfo.appName;
    }
    IProjectDescription desc=newProject.getWorkspace().newProjectDescription(newProject.getName());
    if (isProjectLocationInWorkspace(path))     projectInfo.isInDefaultWs=true;
    if (!projectInfo.isInDefaultWs) {
      desc.setLocation(new Path(path));
    }
    newProject.create(desc,new NullProgressMonitor());
    if (!newProject.isOpen()) {
      newProject.open(new NullProgressMonitor());
    }
  }
 else {
    throw new AlredyCreatedException(newProject);
  }
  return newProject;
}
Program: 2753
Project: 2753
Buggy source:
public boolean isProjectLocationInWorkspace(final String projectPath){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  IWorkspaceRoot root=workspace.getRoot();
  String wsPath=root.getLocation().toOSString();
  return projectPath.contains(wsPath);
}

Fixed version (ground truth):
public boolean isProjectLocationInWorkspace(final String projectPath){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  IWorkspaceRoot root=workspace.getRoot();
  String wsPath=root.getLocation().toOSString();
  return projectPath.toLowerCase().equals(wsPath.toLowerCase());
}
Program: 2754
Project: 2754
Buggy source:
public void stopSyncApp() throws Exception {
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
  String prevRunningRhoconnectApp=store.getString(ConfigurationConstants.lastSyncRunApp);
  if (prevRunningRhoconnectApp == null || prevRunningRhoconnectApp.length() == 0)   return;
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(prevRunningRhoconnectApp);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
  sb=new StringBuilder();
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(prevRunningRhoconnectApp);
  cmdLine.clear();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
}

Fixed version (ground truth):
public void stopSyncApp() throws Exception {
  if (Activator.getDefault() == null)   return;
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
  if (store == null)   return;
  String prevRunningRhoconnectApp=store.getString(ConfigurationConstants.lastSyncRunApp);
  if (prevRunningRhoconnectApp == null || prevRunningRhoconnectApp.length() == 0)   return;
  File appFolder=new File(prevRunningRhoconnectApp);
  if (!appFolder.exists())   return;
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(prevRunningRhoconnectApp);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
  sb=new StringBuilder();
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(prevRunningRhoconnectApp);
  cmdLine.clear();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
}
Program: 2755
Project: 2755
Buggy source:
public void configure() throws CoreException {
  IProjectDescription desc=project.getDescription();
  ICommand[] commands=desc.getBuildSpec();
  for (int i=0; i < commands.length; ++i) {
    if (commands[i].getBuilderName().equals(Builder.BUILDER_ID)) {
      return;
    }
  }
  ICommand[] newCommands=new ICommand[commands.length + 1];
  System.arraycopy(commands,0,newCommands,0,commands.length);
  ICommand command=desc.newCommand();
  command.setBuilderName(Builder.BUILDER_ID);
  newCommands[newCommands.length - 1]=command;
  desc.setBuildSpec(newCommands);
  project.setDescription(desc,null);
}

Fixed version (ground truth):
public void configure() throws CoreException {
  IProjectDescription desc=project.getDescription();
  ICommand[] commands=desc.getBuildSpec();
  for (int i=0; i < commands.length; ++i) {
    if (commands[i].getBuilderName().equals(Builder.BUILDER_ID)) {
      return;
    }
  }
  ICommand[] newCommands=new ICommand[commands.length + 1];
  System.arraycopy(commands,0,newCommands,0,commands.length);
  ICommand command=desc.newCommand();
  command.setBuilderName(Builder.BUILDER_ID);
  command.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD,true);
  command.setBuilding(IncrementalProjectBuilder.FULL_BUILD,true);
  command.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD,true);
  newCommands[newCommands.length - 1]=command;
  desc.setBuildSpec(newCommands);
  project.setDescription(desc,null);
}