nus-yam/ex-repair huggingface dataset:
Program: 96460
Project: 96460
Buggy source:
public StartServerAction(String launchMode){
  this.launchMode=launchMode;
  if (launchMode == ILaunchManager.RUN_MODE) {
    setToolTipText(Messages.actionStartToolTip);
    setText(Messages.actionStart);
    setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START));
    setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START));
    setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START));
  }
 else   if (launchMode == ILaunchManager.DEBUG_MODE) {
    setToolTipText(Messages.actionDebugToolTip);
    setText(Messages.actionDebug);
    setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_DEBUG));
    setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_DEBUG));
    setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_DEBUG));
  }
}

Fixed version (ground truth):
public StartServerAction(String launchMode){
  this.launchMode=launchMode;
  if (ILaunchManager.RUN_MODE.equals(launchMode)) {
    setToolTipText(Messages.actionStartToolTip);
    setText(Messages.actionStart);
    setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START));
    setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START));
    setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START));
  }
 else   if (ILaunchManager.DEBUG_MODE.equals(launchMode)) {
    setToolTipText(Messages.actionDebugToolTip);
    setText(Messages.actionDebug);
    setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_DEBUG));
    setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_DEBUG));
    setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_DEBUG));
  }
}
Program: 96464
Project: 96464
Buggy source:
@SuppressWarnings("String_Node_Str") public void selectionChanged(SelectionChangedEvent event){
  for (  BundleDependency dep : selectedDependencies) {
    viewer.unReveal(dep);
  }
  selectedDependencies=new HashSet<BundleDependency>();
  Set<Object> newSelection=new HashSet<Object>();
  Iterator<Object> iterator=((IStructuredSelection)event.getSelection()).iterator();
  while (iterator.hasNext()) {
    Object selectedObject=iterator.next();
    if (selectedObject instanceof IBundle) {
      newSelection.add(selectedObject);
      if (dependenciesByBundle.containsKey(selectedObject)) {
        for (        BundleDependency dep : dependenciesByBundle.get(selectedObject)) {
          selectedDependencies.add(dep);
          newSelection.add(dep.getExportingBundle());
        }
      }
    }
 else     if (selectedObject instanceof BundleDependency) {
      BundleDependency dep=(BundleDependency)selectedObject;
      selectedDependencies.add(dep);
      newSelection.add(dep.getExportingBundle());
      newSelection.add(dep.getImportingBundle());
    }
  }
  for (  Object node : viewer.getNodeElements()) {
    viewer.update(node,null);
  }
  for (  Object connection : viewer.getConnectionElements()) {
    viewer.update(connection,null);
  }
  for (  BundleDependency dep : selectedDependencies) {
    viewer.reveal(dep);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void selectionChanged(SelectionChangedEvent event){
  for (  BundleDependency dep : selectedDependencies) {
    viewer.unReveal(dep);
  }
  selectedDependencies=new HashSet<BundleDependency>();
  Iterator<Object> iterator=((IStructuredSelection)event.getSelection()).iterator();
  while (iterator.hasNext()) {
    Object selectedObject=iterator.next();
    if (selectedObject instanceof IBundle) {
      if (dependenciesByBundle.containsKey(selectedObject)) {
        for (        BundleDependency dep : dependenciesByBundle.get(selectedObject)) {
          selectedDependencies.add(dep);
        }
      }
    }
 else     if (selectedObject instanceof BundleDependency) {
      BundleDependency dep=(BundleDependency)selectedObject;
      selectedDependencies.add(dep);
    }
  }
  for (  Object node : viewer.getNodeElements()) {
    viewer.update(node,null);
  }
  for (  Object connection : viewer.getConnectionElements()) {
    viewer.update(connection,null);
  }
  for (  BundleDependency dep : selectedDependencies) {
    viewer.reveal(dep);
  }
}
Program: 96467
Project: 96467
Buggy source:
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
}

Fixed version (ground truth):
public void inputChanged(Viewer theViewer,Object oldInput,Object newInput){
}
Program: 96469
Project: 96469
Buggy source:
protected void scheduleExportJob(){
  FeatureExportInfo info=new FeatureExportInfo();
  info.toDirectory=exportPage.doExportToDirectory();
  info.exportSource=false;
  info.exportSourceBundle=false;
  info.allowBinaryCycles=false;
  info.exportMetadata=false;
  info.destinationDirectory=exportPage.getDestination();
  info.zipFileName=exportPage.getFileName();
  info.items=getPluginModels();
  String rootDirectory="String_Node_Str";
  WARProductExportOperation job=new WARProductExportOperation(info,PDEUIMessages.ProductExportJob_name,product,rootDirectory);
  job.setUser(true);
  job.setRule(ResourcesPlugin.getWorkspace().getRoot());
  job.schedule();
  job.setProperty(IProgressConstants.ICON_PROPERTY,PDEPluginImages.DESC_FEATURE_OBJ);
}

Fixed version (ground truth):
protected void scheduleExportJob(){
  FeatureExportInfo info=new FeatureExportInfo();
  info.toDirectory=exportPage.doExportToDirectory();
  info.exportSource=false;
  info.exportSourceBundle=false;
  info.allowBinaryCycles=false;
  info.exportMetadata=false;
  info.destinationDirectory=exportPage.getDestination();
  info.zipFileName=exportPage.getFileName();
  info.items=getPluginModels();
  String rootDirectory="String_Node_Str";
  WARProductExportOperation job=new WARProductExportOperation(info,PDEUIMessages.ProductExportJob_name,product,rootDirectory);
  job.setUser(true);
  job.setRule(ResourcesPlugin.getWorkspace().getRoot());
  job.schedule();
  job.setProperty(IProgressConstants.ICON_PROPERTY,PDEPluginImages.DESC_FEATURE_OBJ);
  final Display d=getShell().getDisplay();
  job.addJobChangeListener(new JobChangeAdapter(){
    public void done(    IJobChangeEvent event){
      final IStatus result=event.getResult();
      if (result.isOK())       return;
      d.asyncExec(new Runnable(){
        public void run(){
          MessageDialog.openError(getShell(),PDEUIMessages.ProductExportWizard_error,PDEUIMessages.ProductExportWizard_corrupt + "String_Node_Str" + result.getMessage());
        }
      }
);
    }
  }
);
}
Program: 96470
Project: 96470
Buggy source:
private ResolverError[] validateErrors(final ResolverError[] errors){
  List validErrors=new ArrayList();
  for (int i=0; i < errors.length; i++) {
    ResolverError error=errors[i];
    VersionConstraint constraint=error.getUnsatisfiedConstraint();
    if (constraint != null) {
      String unresolvedBundleId=constraint.getName();
      if (!isBanned(unresolvedBundleId) && !unresolvedBundleId.equals(Validator.SERVLET_BRIDGE_ID)) {
        validErrors.add(error);
      }
    }
  }
  ResolverError[] result=new ResolverError[validErrors.size()];
  validErrors.toArray(result);
  return result;
}

Fixed version (ground truth):
private ResolverError[] validateErrors(final ResolverError[] errors){
  List validErrors=new ArrayList();
  for (int i=0; i < errors.length; i++) {
    ResolverError error=errors[i];
    VersionConstraint constraint=error.getUnsatisfiedConstraint();
    if (constraint != null) {
      String unresolvedBundleId=constraint.getName();
      if (unresolvedBundleId == null) {
        continue;
      }
      if (!isBanned(unresolvedBundleId) && !unresolvedBundleId.equals(Validator.SERVLET_BRIDGE_ID)) {
        validErrors.add(error);
      }
    }
  }
  ResolverError[] result=new ResolverError[validErrors.size()];
  validErrors.toArray(result);
  return result;
}
Program: 96471
Project: 96471
Buggy source:
public String getVersion(){
  IFacetedProject facetedProject=null;
  try {
    facetedProject=ProjectFacetsManager.create(component.getProject());
    if (facetedProject != null && ProjectFacetsManager.isProjectFacetDefined("String_Node_Str")) {
      IProjectFacet projectFacet=ProjectFacetsManager.getProjectFacet("String_Node_Str");
      return facetedProject.getInstalledVersion(projectFacet).getVersionString();
    }
  }
 catch (  Exception e) {
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getVersion(){
  IFacetedProject facetedProject=null;
  try {
    facetedProject=ProjectFacetsManager.create(virtualComponent.getProject());
    if (facetedProject != null && ProjectFacetsManager.isProjectFacetDefined("String_Node_Str")) {
      IProjectFacet projectFacet=ProjectFacetsManager.getProjectFacet("String_Node_Str");
      return facetedProject.getInstalledVersion(projectFacet).getVersionString();
    }
  }
 catch (  Exception e) {
  }
  return "String_Node_Str";
}
Program: 96472
Project: 96472
Buggy source:
public OsgiModuleDeployable(IProject project,IVirtualComponent component){
  super(project);
  this.component=component;
}

Fixed version (ground truth):
public OsgiModuleDeployable(IProject project,IVirtualComponent component){
  super(project);
  this.virtualComponent=component;
}
Program: 96474
Project: 96474
Buggy source:
public String getServerModules(List modules,String prefix,String spacer){
  StringBuilder builder=new StringBuilder();
  for (  Object object : modules) {
    IModule[] moduleArr=(IModule[])object;
    for (    IModule module : moduleArr) {
      if (builder.length() > 0)       builder.append(spacer);
      IPluginModelBase[] models=PluginRegistry.getActiveModels();
      IPath publishFolder=getPublishFolder();
      for (      IPluginModelBase iPluginModelBase : models) {
        if (iPluginModelBase.getBundleDescription().getName().equalsIgnoreCase(module.getName())) {
          if (builder.indexOf(iPluginModelBase.getPluginBase().getId() + "String_Node_Str" + iPluginModelBase.getPluginBase().getVersion()+ "String_Node_Str") < 0) {
            builder.append(prefix + publishFolder.append(iPluginModelBase.getPluginBase().getId() + "String_Node_Str" + iPluginModelBase.getPluginBase().getVersion()+ "String_Node_Str").toOSString());
            break;
          }
        }
      }
    }
  }
  return builder.toString();
}

Fixed version (ground truth):
public String getServerModules(List<IModule[]> modules,String prefix,String spacer){
  StringBuilder builder=new StringBuilder();
  for (  IModule[] moduleArr : modules) {
    for (    IModule module : moduleArr) {
      if (builder.length() > 0)       builder.append(spacer);
      IPluginModelBase[] models=PluginRegistry.getActiveModels();
      IPath publishFolder=getPublishFolder();
      for (      IPluginModelBase iPluginModelBase : models) {
        if (iPluginModelBase.getBundleDescription().getName().equalsIgnoreCase(module.getName())) {
          if (builder.indexOf(iPluginModelBase.getPluginBase().getId() + "String_Node_Str" + iPluginModelBase.getPluginBase().getVersion()+ "String_Node_Str") < 0) {
            builder.append(prefix + publishFolder.append(iPluginModelBase.getPluginBase().getId() + "String_Node_Str" + iPluginModelBase.getPluginBase().getVersion()+ "String_Node_Str").toOSString());
            break;
          }
        }
      }
    }
  }
  return builder.toString();
}
Program: 96476
Project: 96476
Buggy source:
@Override public void done(IJobChangeEvent event){
  if (event.getResult().isOK()) {
    try {
      if (tmpLocation != null) {
        File sourceFiles=tmpLocation.append("String_Node_Str").toFile();
        for (        File jars : sourceFiles.listFiles()) {
          File destFile=location.append(jars.getName()).toFile();
          if (!destFile.exists()) {
            destFile.createNewFile();
          }
          FileChannel source=null;
          FileChannel destination=null;
          try {
            source=new FileInputStream(jars).getChannel();
            destination=new FileOutputStream(destFile).getChannel();
            destination.transferFrom(source,0,source.size());
          }
  finally {
            if (source != null) {
              source.close();
            }
            if (destination != null) {
              destination.close();
            }
          }
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void done(IJobChangeEvent event){
  if (event.getResult().isOK()) {
    try {
      if (tmpLocation != null) {
        File sourceFiles=tmpLocation.append("String_Node_Str").toFile();
        File[] fileList=sourceFiles.listFiles();
        if (fileList != null)         for (        File jars : fileList) {
          File destFile=location.append(jars.getName()).toFile();
          if (!destFile.exists()) {
            if (!destFile.createNewFile()) {
              throw new IOException("String_Node_Str" + destFile);
            }
          }
          FileInputStream fIn=null;
          FileOutputStream fOut=null;
          FileChannel source=null;
          FileChannel destination=null;
          try {
            source=(fIn=new FileInputStream(jars)).getChannel();
            destination=(fOut=new FileOutputStream(destFile)).getChannel();
            destination.transferFrom(source,0,source.size());
          }
  finally {
            if (fIn != null) {
              try {
                fIn.close();
              }
 catch (              IOException x) {
                x.printStackTrace();
              }
            }
            if (fOut != null) {
              try {
                fOut.close();
              }
 catch (              IOException x) {
                x.printStackTrace();
              }
            }
          }
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 96477
Project: 96477
Buggy source:
private boolean hasBuildProperties(IPluginModelBase model){
  File file=new File(model.getInstallLocation(),"String_Node_Str");
  return file.exists();
}

Fixed version (ground truth):
private static boolean hasBuildProperties(IPluginModelBase model){
  File file=new File(model.getInstallLocation(),"String_Node_Str");
  return file.exists();
}
Program: 96478
Project: 96478
Buggy source:
@Override public int hashCode(){
  int hashCode=17;
  hashCode=31 * hashCode + clazzes.hashCode();
  hashCode=31 * hashCode + type.hashCode();
  return hashCode;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hashCode=17;
  hashCode=31 * hashCode + Arrays.hashCode(clazzes);
  hashCode=31 * hashCode + type.hashCode();
  return hashCode;
}
Program: 96480
Project: 96480
Buggy source:
private void executeCommand(String cmdLine){
  clearStatus();
  IOSGiFrameworkConsole console=(IOSGiFrameworkConsole)getServer().getOriginal().loadAdapter(IOSGiFrameworkConsole.class,null);
  if (console == null) {
    IStatus status=EditorUIPlugin.newErrorStatus("String_Node_Str");
    EditorUIPlugin.log(status);
    setStatus(status);
  }
  try {
    String result=console.executeCommand(cmdLine);
    manifestText.append("String_Node_Str" + cmdLine + "String_Node_Str");
    manifestText.append(result + "String_Node_Str");
    forwardAction.setEnabled(history.canForward());
    backAction.setEnabled(history.canBack());
    toolBarManager.update(true);
    manifestText.setTopIndex(manifestText.getLineCount() - 1);
  }
 catch (  CoreException e) {
    EditorUIPlugin.log(e);
    setStatus(EditorUIPlugin.newErrorStatus("String_Node_Str"));
  }
  commandText.setText("String_Node_Str");
}

Fixed version (ground truth):
void executeCommand(String cmdLine){
  clearStatus();
  IOSGiFrameworkConsole console=(IOSGiFrameworkConsole)getServer().getOriginal().loadAdapter(IOSGiFrameworkConsole.class,null);
  if (console == null) {
    IStatus status=EditorUIPlugin.newErrorStatus("String_Node_Str");
    EditorUIPlugin.log(status);
    setStatus(status);
    return;
  }
  try {
    String result=console.executeCommand(cmdLine);
    manifestText.append("String_Node_Str" + cmdLine + "String_Node_Str");
    manifestText.append(result + "String_Node_Str");
    forwardAction.setEnabled(history.canForward());
    backAction.setEnabled(history.canBack());
    toolBarManager.update(true);
    manifestText.setTopIndex(manifestText.getLineCount() - 1);
  }
 catch (  CoreException e) {
    EditorUIPlugin.log(e);
    setStatus(EditorUIPlugin.newErrorStatus("String_Node_Str"));
  }
  commandText.setText("String_Node_Str");
}
Program: 96481
Project: 96481
Buggy source:
public IDetailsPage getPage(Object key){
  if (key.equals(IBundle.class)) {
    return BundleInformationMasterDetailsBlock.this.detailsPart;
  }
  return null;
}

Fixed version (ground truth):
public IDetailsPage getPage(Object key){
  if (key.equals(IBundle.class)) {
    return BundleInformationMasterDetailsBlock.this.bundleDetailsPart;
  }
  return null;
}
Program: 96482
Project: 96482
Buggy source:
public void clear(){
  masterPart.clear();
}

Fixed version (ground truth):
public void clear(){
  bundleMasterPart.clear();
}
Program: 96483
Project: 96483
Buggy source:
public void refresh(){
  masterPart.updateButtonState();
}

Fixed version (ground truth):
public void refresh(){
  bundleMasterPart.updateButtonState();
}
Program: 96484
Project: 96484
Buggy source:
@Override protected void registerPages(DetailsPart detailsPart){
  this.detailsPart=new BundleInformationDetailsPart(this);
  detailsPart.setPageProvider(new IDetailsPageProvider(){
    public Object getPageKey(    Object object){
      if (object instanceof IBundle) {
        return IBundle.class;
      }
      return object.getClass();
    }
    public IDetailsPage getPage(    Object key){
      if (key.equals(IBundle.class)) {
        return BundleInformationMasterDetailsBlock.this.detailsPart;
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
@Override protected void registerPages(DetailsPart targetDetailsPart){
  this.bundleDetailsPart=new BundleInformationDetailsPart(this);
  targetDetailsPart.setPageProvider(new IDetailsPageProvider(){
    public Object getPageKey(    Object object){
      if (object instanceof IBundle) {
        return IBundle.class;
      }
      return object.getClass();
    }
    public IDetailsPage getPage(    Object key){
      if (key.equals(IBundle.class)) {
        return BundleInformationMasterDetailsBlock.this.bundleDetailsPart;
      }
      return null;
    }
  }
);
}
Program: 96485
Project: 96485
Buggy source:
private void onSashPaint(Event e){
  Sash sash=(Sash)e.widget;
  IManagedForm form=(IManagedForm)sash.getParent().getData("String_Node_Str");
  FormColors colors=form.getToolkit().getColors();
  boolean vertical=(sash.getStyle() & SWT.VERTICAL) != 0;
  GC gc=e.gc;
  Boolean hover=(Boolean)sash.getData("String_Node_Str");
  gc.setBackground(colors.getColor(IFormColors.TB_BG));
  gc.setForeground(colors.getColor(IFormColors.TB_BORDER));
  Point size=sash.getSize();
  if (vertical) {
    if (hover != null) {
      gc.fillRectangle(0,0,size.x,size.y);
    }
  }
 else {
    if (hover != null) {
      gc.fillRectangle(0,0,size.x,size.y);
    }
  }
}

Fixed version (ground truth):
void onSashPaint(Event e){
  Sash sash=(Sash)e.widget;
  IManagedForm form=(IManagedForm)sash.getParent().getData("String_Node_Str");
  FormColors colors=form.getToolkit().getColors();
  boolean vertical=(sash.getStyle() & SWT.VERTICAL) != 0;
  GC gc=e.gc;
  Boolean hover=(Boolean)sash.getData("String_Node_Str");
  gc.setBackground(colors.getColor(IFormColors.TB_BG));
  gc.setForeground(colors.getColor(IFormColors.TB_BORDER));
  Point size=sash.getSize();
  if (vertical) {
    if (hover != null) {
      gc.fillRectangle(0,0,size.x,size.y);
    }
  }
 else {
    if (hover != null) {
      gc.fillRectangle(0,0,size.x,size.y);
    }
  }
}
Program: 96486
Project: 96486
Buggy source:
@Override protected void createMasterPart(final IManagedForm managedForm,Composite parent){
  masterPart=new BundleInformationMasterPart(parent,managedForm.getToolkit(),ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR| Section.DESCRIPTION| ExpandableComposite.FOCUS_TITLE,this);
  managedForm.addPart(masterPart);
  masterPart.createContents();
}

Fixed version (ground truth):
@Override protected void createMasterPart(final IManagedForm managedForm,Composite parent){
  bundleMasterPart=new BundleInformationMasterPart(parent,managedForm.getToolkit(),ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR| Section.DESCRIPTION| ExpandableComposite.FOCUS_TITLE,this);
  managedForm.addPart(bundleMasterPart);
  bundleMasterPart.createContents();
}
Program: 96487
Project: 96487
Buggy source:
private void hookSashListeners(){
  purgeSashes();
  Control[] children=getChildren();
  for (  Control element : children) {
    if (element instanceof Sash) {
      Sash sash=(Sash)element;
      if (sashes.contains(sash)) {
        continue;
      }
      sash.addListener(SWT.Paint,listener);
      sash.addListener(SWT.MouseEnter,listener);
      sash.addListener(SWT.MouseExit,listener);
      sashes.add(sash);
    }
  }
}

Fixed version (ground truth):
void hookSashListeners(){
  purgeSashes();
  Control[] children=getChildren();
  for (  Control element : children) {
    if (element instanceof Sash) {
      Sash sash=(Sash)element;
      if (sashes.contains(sash)) {
        continue;
      }
      sash.addListener(SWT.Paint,listener);
      sash.addListener(SWT.MouseEnter,listener);
      sash.addListener(SWT.MouseExit,listener);
      sashes.add(sash);
    }
  }
}
Program: 96488
Project: 96488
Buggy source:
public void setSelectedBundle(IBundle bundle){
  masterPart.setSelectedBundle(bundle);
}

Fixed version (ground truth):
public void setSelectedBundle(IBundle bundle){
  bundleMasterPart.setSelectedBundle(bundle);
}
Program: 96489
Project: 96489
Buggy source:
public OSGiBundleFacetUninstallConfig(){
  Realm realm=OSGiBundleFacetRealm.getRealm();
  strategyValue=new SelectObservableValue<OSGiBundleFacetUninstallStrategy>(realm,OSGiBundleFacetUninstallStrategy.class);
  final OSGiBundleFacetUninstallStrategy[] values=OSGiBundleFacetUninstallStrategy.values();
  optionValues=new ArrayList<WritableValue<Boolean>>(values.length);
  for (int i=0; i < values.length; i++) {
    final WritableValue<Boolean> wv=new WritableValue<Boolean>(realm,null,Boolean.class);
    optionValues.set(i,wv);
    strategyValue.addOption(OSGiBundleFacetUninstallStrategy.values()[i],wv);
  }
  strategyValue.setValue(OSGiBundleFacetUninstallStrategy.defaultStrategy());
}

Fixed version (ground truth):
public OSGiBundleFacetUninstallConfig(){
  Realm realm=OSGiBundleFacetRealm.getRealm();
  strategyValue=new SelectObservableValue<OSGiBundleFacetUninstallStrategy>(realm,OSGiBundleFacetUninstallStrategy.class);
  final OSGiBundleFacetUninstallStrategy[] values=OSGiBundleFacetUninstallStrategy.values();
  optionValues=new ArrayList<WritableValue<Boolean>>(values == null ? 0 : values.length);
  if (values != null)   for (  final OSGiBundleFacetUninstallStrategy val : values) {
    final WritableValue<Boolean> wv=new WritableValue<Boolean>(realm,null,Boolean.class);
    optionValues.add(wv);
    strategyValue.addOption(val,wv);
  }
  strategyValue.setValue(OSGiBundleFacetUninstallStrategy.defaultStrategy());
}
Program: 96490
Project: 96490
Buggy source:
private void createBuildPropertiesFile(final String featureLocation,final String[][] configurations) throws IOException {
  File file=new File(featureLocation);
  if (!file.exists() || !file.isDirectory()) {
    file.mkdirs();
  }
  Properties properties=new Properties();
  handleRootFiles(configurations,properties);
  handleJREInfo(configurations,properties);
  handleExportSource(properties);
  File fileToSave=new File(file,ICoreConstants.BUILD_FILENAME_DESCRIPTOR);
  save(fileToSave,properties,"String_Node_Str");
}

Fixed version (ground truth):
private void createBuildPropertiesFile(final String featureLocation,final String[][] configurations) throws IOException {
  File file=new File(featureLocation);
  if (!file.exists() || !file.isDirectory()) {
    if (!file.mkdirs()) {
      throw new IOException(Messages.creatorCouldntCopy + "String_Node_Str" + file);
    }
  }
  Properties properties=new Properties();
  handleRootFiles(configurations,properties);
  handleJREInfo(configurations,properties);
  handleExportSource(properties);
  File fileToSave=new File(file,ICoreConstants.BUILD_FILENAME_DESCRIPTOR);
  save(fileToSave,properties,"String_Node_Str");
}
Program: 96491
Project: 96491
Buggy source:
private void addExtensionbundleToConfigIni(String configIni){
  try {
    File file=new File(configIni);
    if (file.exists()) {
      BufferedReader reader=new BufferedReader(new FileReader(file));
      String line="String_Node_Str";
      String oldtext="String_Node_Str";
      while ((line=reader.readLine()) != null) {
        oldtext+=line + "String_Node_Str";
      }
      reader.close();
      String newtext=oldtext.replaceAll("String_Node_Str","String_Node_Str" + "String_Node_Str");
      FileWriter writer=new FileWriter(configIni);
      writer.write(newtext);
      writer.close();
    }
  }
 catch (  IOException e) {
    throw new IllegalStateException(e);
  }
}

Fixed version (ground truth):
private void addExtensionbundleToConfigIni(String configIni){
  try {
    File file=new File(configIni);
    if (file.exists()) {
      BufferedReader reader=new BufferedReader(new FileReader(file));
      String line="String_Node_Str";
      StringBuilder oldtext=new StringBuilder();
      while ((line=reader.readLine()) != null) {
        oldtext.append(line);
        oldtext.append("String_Node_Str");
      }
      reader.close();
      String newtext=oldtext.toString().replaceAll("String_Node_Str","String_Node_Str" + "String_Node_Str");
      FileWriter writer=new FileWriter(configIni);
      writer.write(newtext);
      writer.close();
    }
  }
 catch (  IOException e) {
    throw new IllegalStateException(e);
  }
}
Program: 96492
Project: 96492
Buggy source:
private String createLibDir(){
  String location=featureLocation;
  File dir=new File(location,"String_Node_Str");
  dir.mkdirs();
  return dir.getAbsolutePath();
}

Fixed version (ground truth):
private String createLibDir() throws IOException {
  String location=featureLocation;
  File dir=new File(location,"String_Node_Str");
  if (!dir.mkdirs()) {
    throw new IOException(Messages.creatorCouldntCopy + "String_Node_Str" + dir);
  }
  return dir.getAbsolutePath();
}
Program: 96493
Project: 96493
Buggy source:
protected IBaseModel createModel(final IEditorInput input) throws CoreException {
  IProductModel model=null;
  if (input instanceof IStorageEditorInput) {
    try {
      if (input instanceof IFileEditorInput) {
        IFile file=((IFileEditorInput)input).getFile();
        model=new WARWorkspaceProductModel(file,true);
        model.load();
      }
 else       if (input instanceof IStorageEditorInput) {
        IStorageEditorInput storageInput=(IStorageEditorInput)input;
        InputStream contents=storageInput.getStorage().getContents();
        InputStream is=new BufferedInputStream(contents);
        model=new WARProductModel();
        model.load(is,false);
      }
    }
 catch (    final CoreException e) {
      PDEPlugin.logException(e);
      model=null;
    }
  }
 else   if (input instanceof IURIEditorInput) {
    IFileStore store=EFS.getStore(((IURIEditorInput)input).getURI());
    InputStream is=store.openInputStream(EFS.CACHE,new NullProgressMonitor());
    model=new WARProductModel();
    model.load(is,false);
  }
  return model;
}

Fixed version (ground truth):
protected IBaseModel createModel(final IEditorInput input) throws CoreException {
  IProductModel model=null;
  if (input instanceof IStorageEditorInput) {
    try {
      if (input instanceof IFileEditorInput) {
        IFile file=((IFileEditorInput)input).getFile();
        model=new WARWorkspaceProductModel(file,true);
        model.load();
      }
 else {
        IStorageEditorInput storageInput=(IStorageEditorInput)input;
        InputStream contents=storageInput.getStorage().getContents();
        InputStream is=new BufferedInputStream(contents);
        model=new WARProductModel();
        model.load(is,false);
      }
    }
 catch (    final CoreException e) {
      PDEPlugin.logException(e);
      model=null;
    }
  }
 else   if (input instanceof IURIEditorInput) {
    IFileStore store=EFS.getStore(((IURIEditorInput)input).getURI());
    InputStream is=store.openInputStream(EFS.CACHE,new NullProgressMonitor());
    model=new WARProductModel();
    model.load(is,false);
  }
  return model;
}
Program: 96494
Project: 96494
Buggy source:
protected boolean confirmDelete(){
  boolean result=true;
  if (!exportPage.doExportToDirectory()) {
    File zipFile=new File(exportPage.getDestination(),exportPage.getFileName());
    if (zipFile.exists()) {
      String bind=NLS.bind(PDEUIMessages.BaseExportWizard_confirmReplace_desc,zipFile.getAbsolutePath());
      String confirmReplaceTitle=PDEUIMessages.BaseExportWizard_confirmReplace_title;
      boolean openQuestion=MessageDialog.openQuestion(getContainer().getShell(),confirmReplaceTitle,bind);
      if (!openQuestion) {
        result=false;
      }
 else {
        zipFile.delete();
      }
    }
  }
  return result;
}

Fixed version (ground truth):
protected boolean confirmDelete(){
  boolean result=true;
  if (!exportPage.doExportToDirectory()) {
    File zipFile=new File(exportPage.getDestination(),exportPage.getFileName());
    if (zipFile.exists()) {
      String bind=NLS.bind(PDEUIMessages.BaseExportWizard_confirmReplace_desc,zipFile.getAbsolutePath());
      String confirmReplaceTitle=PDEUIMessages.BaseExportWizard_confirmReplace_title;
      boolean openQuestion=MessageDialog.openQuestion(getContainer().getShell(),confirmReplaceTitle,bind);
      if (!openQuestion) {
        result=false;
      }
 else {
        if (!zipFile.delete()) {
          MessageDialog.openError(getContainer().getShell(),Messages.NewWARDeleteFailed_title,Messages.NewWARDeleteFailed_desc + "String_Node_Str" + zipFile);
          result=false;
        }
      }
    }
  }
  return result;
}
Program: 96495
Project: 96495
Buggy source:
private void hookSelectionListener(final TreeViewer viewer){
  viewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    final SelectionChangedEvent event){
      TreeSelection selection=(TreeSelection)event.getSelection();
      Object firstElement=selection.getFirstElement();
      ExportWARProductWizard wizard=(ExportWARProductWizard)getWizard();
      if (firstElement != null && firstElement instanceof IFile) {
        IFile file=(IFile)firstElement;
        String fileExtension=file.getFileExtension();
        if (fileExtension.equals(WARProductConstants.FILE_EXTENSION)) {
          warProductFile=file;
          wizard.loadProductFromFile(file);
        }
      }
 else {
        warProductFile=null;
        wizard.resetProduct();
      }
      wizard.getContainer().updateButtons();
    }
  }
);
}

Fixed version (ground truth):
private void hookSelectionListener(final TreeViewer viewer){
  viewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    final SelectionChangedEvent event){
      TreeSelection selection=(TreeSelection)event.getSelection();
      Object firstElement=selection.getFirstElement();
      ExportWARProductWizard wizard=(ExportWARProductWizard)getWizard();
      if (firstElement != null && firstElement instanceof IFile) {
        IFile file=(IFile)firstElement;
        String fileExtension=file.getFileExtension();
        if (WARProductConstants.FILE_EXTENSION.equals(fileExtension)) {
          warProductFile=file;
          wizard.loadProductFromFile(file);
        }
      }
 else {
        warProductFile=null;
        wizard.resetProduct();
      }
      wizard.getContainer().updateButtons();
    }
  }
);
}
Program: 96496
Project: 96496
Buggy source:
public void selectionChanged(final SelectionChangedEvent event){
  TreeSelection selection=(TreeSelection)event.getSelection();
  Object firstElement=selection.getFirstElement();
  ExportWARProductWizard wizard=(ExportWARProductWizard)getWizard();
  if (firstElement != null && firstElement instanceof IFile) {
    IFile file=(IFile)firstElement;
    String fileExtension=file.getFileExtension();
    if (fileExtension.equals(WARProductConstants.FILE_EXTENSION)) {
      warProductFile=file;
      wizard.loadProductFromFile(file);
    }
  }
 else {
    warProductFile=null;
    wizard.resetProduct();
  }
  wizard.getContainer().updateButtons();
}

Fixed version (ground truth):
public void selectionChanged(final SelectionChangedEvent event){
  TreeSelection selection=(TreeSelection)event.getSelection();
  Object firstElement=selection.getFirstElement();
  ExportWARProductWizard wizard=(ExportWARProductWizard)getWizard();
  if (firstElement != null && firstElement instanceof IFile) {
    IFile file=(IFile)firstElement;
    String fileExtension=file.getFileExtension();
    if (WARProductConstants.FILE_EXTENSION.equals(fileExtension)) {
      warProductFile=file;
      wizard.loadProductFromFile(file);
    }
  }
 else {
    warProductFile=null;
    wizard.resetProduct();
  }
  wizard.getContainer().updateButtons();
}
Program: 96497
Project: 96497
Buggy source:
private void updateHeaders(){
  try {
    IFile manifest=null;
    IProject project=getProject();
    if (project != null) {
      manifest=getManifestFile(project);
    }
    if (manifest != null && manifest.exists()) {
      Map<String,String> manifestHeaders=ManifestElement.parseBundleManifest(manifest.getContents(),null);
      for (      String key : manifestHeaders.keySet()) {
        headers.put(key,manifestHeaders.get(key));
      }
    }
  }
 catch (  Exception e) {
    LibraFacetPlugin.logError(e);
  }
}

Fixed version (ground truth):
private void updateHeaders(){
  try {
    IFile manifest=null;
    IProject project=getProject();
    if (project != null) {
      manifest=getManifestFile(project);
    }
    if (manifest != null && manifest.exists()) {
      Map<String,String> manifestHeaders=ManifestElement.parseBundleManifest(manifest.getContents(),null);
      for (      Map.Entry<String,String> entry : manifestHeaders.entrySet()) {
        headers.put(entry.getKey(),entry.getValue());
      }
    }
  }
 catch (  Exception e) {
    LibraFacetPlugin.logError(e);
  }
}
Program: 96498
Project: 96498
Buggy source:
public String[] getFrameworkProgramArguments(IPath configPath,boolean debug,boolean starting){
  return new String[]{"String_Node_Str" + configPath.append("String_Node_Str").makeAbsolute().toOSString()};
}

Fixed version (ground truth):
public String[] getFrameworkProgramArguments(IPath configPath,boolean debug,boolean starting){
  return new String[]{configPath.append("String_Node_Str").makeAbsolute().toPortableString()};
}
Program: 96499
Project: 96499
Buggy source:
public String[] getFrameworkVMArguments(IPath installPath,IPath configPath,IPath deployPath,boolean isTestEnv){
  String configPathStr=deployPath.makeAbsolute().toOSString();
  String vmArgs="String_Node_Str" + configPathStr + "String_Node_Str";
  return new String[]{vmArgs};
}

Fixed version (ground truth):
public String[] getFrameworkVMArguments(IPath installPath,IPath configPath,IPath deployPath,boolean isTestEnv){
  String configPathStr=deployPath.makeAbsolute().append("String_Node_Str").toPortableString();
  String vmArgs="String_Node_Str" + configPathStr;
  return new String[]{vmArgs};
}
Program: 96500
Project: 96500
Buggy source:
private IBundleClasspathEntry[] getBundleClasspath(IBundleProjectDescription bundleProjectDescription) throws CoreException {
  IProject project=bundleProjectDescription.getProject();
  IBundleClasspathEntry[] bundleClasspath=bundleProjectDescription.getBundleClasspath();
  IJavaProject javaProject=JavaCore.create(project);
  if (bundleClasspath == null) {
    IBundleProjectService bundleProjectService=LibraFacetPlugin.getDefault().getBundleProjectService();
    IPath source=getRelativePath(project,getJavaSourceFolderPaths(javaProject)[0]);
    IPath binary=getRelativePath(project,javaProject.getOutputLocation());
    IPath library=(isWebProject(project)) ? new Path(WEB_INF_CLASSES) : null;
    IBundleClasspathEntry classpath=bundleProjectService.newBundleClasspathEntry(source,binary,library);
    bundleClasspath=new IBundleClasspathEntry[]{classpath};
  }
 else {
  }
  return bundleClasspath;
}

Fixed version (ground truth):
private IBundleClasspathEntry[] getBundleClasspath(IBundleProjectDescription bundleProjectDescription) throws CoreException {
  IProject project=bundleProjectDescription.getProject();
  IBundleClasspathEntry[] bundleClasspath=bundleProjectDescription.getBundleClasspath();
  IJavaProject javaProject=JavaCore.create(project);
  if (bundleClasspath == null) {
    IPath[] javaSourceFolderPaths=getJavaSourceFolderPaths(javaProject);
    if (javaSourceFolderPaths != null && javaSourceFolderPaths.length > 0) {
      IBundleProjectService bundleProjectService=LibraFacetPlugin.getDefault().getBundleProjectService();
      List<IBundleClasspathEntry> bundleClasspathList=new ArrayList<IBundleClasspathEntry>();
      IPath binary=getRelativePath(project,javaProject.getOutputLocation());
      IPath library=(isWebProject(project)) ? new Path(WEB_INF_CLASSES) : null;
      for (      IPath iPath : javaSourceFolderPaths) {
        bundleClasspathList.add(bundleProjectService.newBundleClasspathEntry(getRelativePath(project,iPath),binary,library));
      }
      bundleClasspath=bundleClasspathList.toArray(new IBundleClasspathEntry[]{});
      ;
    }
  }
 else {
  }
  return bundleClasspath;
}
Program: 96501
Project: 96501
Buggy source:
public ConvertProjectsToBundlesOperation(IProject[] projects){
  this.fProjects=projects;
}

Fixed version (ground truth):
public ConvertProjectsToBundlesOperation(IProject[] projects){
  this.fProjects=projects.clone();
}
Program: 96502
Project: 96502
Buggy source:
public ConvertProjectsToBundlesWizard(IProject[] unconverted,IProject[] selected){
  this.fUnconverted=unconverted;
  this.fSelected=selected;
  setWindowTitle(Messages.ConvertProjectsToBundlesWizard_Title);
  setNeedsProgressMonitor(true);
}

Fixed version (ground truth):
public ConvertProjectsToBundlesWizard(IProject[] unconverted,IProject[] selected){
  this.fUnconverted=unconverted.clone();
  this.fSelected=selected.clone();
  setWindowTitle(Messages.ConvertProjectsToBundlesWizard_Title);
  setNeedsProgressMonitor(true);
}
Program: 96504
Project: 96504
Buggy source:
public WritableValue[] getOptionValues(){
  return optionValues;
}

Fixed version (ground truth):
public WritableValue[] getOptionValues(){
  return optionValues.clone();
}
Program: 96505
Project: 96505
Buggy source:
public List<Label> createLabel(SubmitRecord record,HashMap<String,AccountInfo> value,String status){
  List<Label> list=new ArrayList<Label>();
  for (  Map.Entry<String,AccountInfo> info : value.entrySet()) {
    Label label=new Label();
    label.setLabel(info.getKey());
    label.setStatus(status);
    label.setAppliedBy(info.getValue().getId());
    list.add(label);
  }
  return list;
}

Fixed version (ground truth):
public List<Label> createLabel(SubmitRecord record,HashMap<String,AccountInfo> value,String status){
  List<Label> list=new ArrayList<Label>();
  if (value != null) {
    for (    Map.Entry<String,AccountInfo> info : value.entrySet()) {
      Label label=new Label();
      label.setLabel(info.getKey());
      label.setStatus(status);
      if (info.getValue().getId() != null) {
        label.setAppliedBy(info.getValue().getId());
      }
      list.add(label);
    }
  }
  return list;
}
Program: 96506
Project: 96506
Buggy source:
public void init(String refSpec,PrivilegeLevel privilegeLevel) throws Exception {
  provider.open();
  assertThat(getRepository().getReviews().size(),is(0));
  pushFileToReview(testIdent,refSpec,privilegeLevel);
  listener=new TestRemoteObserver<IRepository,IReview,String,Date>(provider.getReviewFactory());
  consumer=provider.getReviewFactory().getConsumerForRemoteKey(getRepository(),shortId);
  consumer.addObserver(listener);
  consumer.retrieve(false);
  listener.waitForResponse();
  assertThat(getRepository().getReviews().size(),is(1));
  IReview review=getRepository().getReviews().get(0);
  IReview reviewDirect=provider.open(shortId);
  assertThat(review,sameInstance(reviewDirect));
  assertThat(review,notNullValue());
  assertThat(review.getId(),is(shortId));
  assertThat(review.getKey(),is(changeId));
  assertThat(review.getSubject(),is("String_Node_Str" + testIdent));
  assertThat(review.getMessage(),allOf(startsWith("String_Node_Str"),endsWith("String_Node_Str")));
  assertThat(review.getOwner().getDisplayName(),is("String_Node_Str"));
  assertIsRecent(review.getCreationDate());
}

Fixed version (ground truth):
public void init(String refSpec,PrivilegeLevel privilegeLevel) throws Exception {
  provider.open();
  assertThat(getRepository().getReviews().size(),is(0));
  pushFileToReview(testIdent,refSpec,privilegeLevel);
  listener=new TestRemoteObserver<IRepository,IReview,String,Date>(provider.getReviewFactory());
  consumer=provider.getReviewFactory().getConsumerForRemoteKey(getRepository(),shortId);
  consumer.setAsynchronous(false);
  consumer.addObserver(listener);
  consumer.retrieve(false);
  listener.waitForResponse();
  assertThat(getRepository().getReviews().size(),is(1));
  IReview review=getRepository().getReviews().get(0);
  IReview reviewDirect=provider.open(shortId);
  assertThat(review,sameInstance(reviewDirect));
  assertThat(review,notNullValue());
  assertThat(review.getId(),is(shortId));
  assertThat(review.getKey(),is(changeId));
  assertThat(review.getSubject(),is("String_Node_Str" + testIdent));
  assertThat(review.getMessage(),allOf(startsWith("String_Node_Str"),endsWith("String_Node_Str")));
  assertThat(review.getOwner().getDisplayName(),is("String_Node_Str"));
  assertIsRecent(review.getCreationDate());
}
Program: 96507
Project: 96507
Buggy source:
private void makeActions(){
  doubleClickAction=new Action(){
    @Override public void run(){
      ISelection selection=fViewer.getSelection();
      if (!(selection instanceof IStructuredSelection)) {
        return;
      }
      IStructuredSelection structuredSelection=(IStructuredSelection)selection;
      if (structuredSelection.size() != 1) {
        return;
      }
      Object element=structuredSelection.getFirstElement();
      if (!(element instanceof AbstractTask)) {
        return;
      }
      AbstractTask task=(AbstractTask)element;
      AbstractRepositoryConnectorUi connectorUi=TasksUiPlugin.getConnectorUi(GerritConnector.CONNECTOR_KIND);
      IEditorInput editorInput=connectorUi.getTaskEditorInput(getTaskRepository(),task);
      if (editorInput == null) {
        editorInput=new TaskEditorInput(fTaskRepository,task);
      }
      String editorId=connectorUi.getTaskEditorId(task);
      IEditorPart editorPart=TasksUiUtil.openEditor(editorInput,editorId,null);
      if (editorPart instanceof TaskEditor) {
        TaskEditor taskEditor=(TaskEditor)editorPart;
        SynchronizeEditorAction synchAction=new SynchronizeEditorAction();
        synchAction.selectionChanged(new StructuredSelection(taskEditor));
        synchAction.run();
        if (task instanceof GerritTask) {
          fReviewTable.updateReviewItem((GerritTask)task);
          refresh();
        }
      }
    }
  }
;
}

Fixed version (ground truth):
private void makeActions(){
  doubleClickAction=new Action(){
    @Override public void run(){
      ISelection selection=fViewer.getSelection();
      if (!(selection instanceof IStructuredSelection)) {
        return;
      }
      IStructuredSelection structuredSelection=(IStructuredSelection)selection;
      if (structuredSelection.size() != 1) {
        return;
      }
      Object element=structuredSelection.getFirstElement();
      if (element instanceof ITask) {
        TasksUiUtil.openTask(fTaskRepository,((ITask)element).getTaskId());
      }
      if (element instanceof GerritTask) {
        fReviewTable.updateReviewItem((GerritTask)element);
        refresh();
      }
    }
  }
;
}
Program: 96508
Project: 96508
Buggy source:
public List<IProject> getProjectsForTaskRepository(String connectorKind,String repositoryUrl){
  List<IProject> projects=new ArrayList<IProject>();
  for (  IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
    TaskRepository repo=TasksUiPlugin.getDefault().getRepositoryForResource(project);
    if (connectorKind.equals(repo.getConnectorKind()) && repositoryUrl.equals(repo.getRepositoryUrl())) {
      projects.add(project);
    }
  }
  return projects;
}

Fixed version (ground truth):
public List<IProject> getProjectsForTaskRepository(String connectorKind,String repositoryUrl){
  List<IProject> projects=new ArrayList<IProject>();
  for (  IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
    TaskRepository repo=TasksUiPlugin.getDefault().getRepositoryForResource(project);
    if (repo != null && connectorKind.equals(repo.getConnectorKind()) && repositoryUrl.equals(repo.getRepositoryUrl())) {
      projects.add(project);
    }
  }
  return projects;
}
Program: 96509
Project: 96509
Buggy source:
private List<ScmRepository> getRepositoriesFor(ITask task) throws CoreException {
  List<ScmRepository> repos=new ArrayList<ScmRepository>();
  List<IProject> projects=configuration.getProjectsForTaskRepository(task.getConnectorKind(),task.getRepositoryUrl());
  for (  IProject p : projects) {
    ScmRepository repository=getRepositoryForProject(p);
    repos.add(repository);
  }
  return repos;
}

Fixed version (ground truth):
private List<ScmRepository> getRepositoriesFor(ITask task) throws CoreException {
  Set<ScmRepository> repos=new HashSet<ScmRepository>();
  List<IProject> projects=configuration.getProjectsForTaskRepository(task.getConnectorKind(),task.getRepositoryUrl());
  for (  IProject p : projects) {
    ScmRepository repository=getRepositoryForProject(p);
    repos.add(repository);
  }
  return new ArrayList<ScmRepository>(repos);
}