nus-yam/ex-repair huggingface dataset:
Program: 91478
Project: 91478
Buggy source:
private String getProjectRelativePath(Repository db,String repoPath){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  IWorkspaceRoot root=workspace.getRoot();
  IPath absolutePath=new Path(db.getWorkTree().getAbsolutePath()).append(repoPath);
  IResource resource=root.getFileForLocation(absolutePath);
  return resource.getProjectRelativePath().toString();
}

Fixed version (ground truth):
private String getProjectRelativePath(Repository db,String repoPath){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  IWorkspaceRoot root=workspace.getRoot();
  IPath absolutePath=new Path(db.getWorkTree().getAbsolutePath()).append(repoPath);
  IResource resource=root.getFileForLocation(absolutePath);
  if (resource == null)   return null;
  return resource.getProjectRelativePath().toString();
}
Program: 91479
Project: 91479
Buggy source:
/** 
 * Get the repository mapping for a path if it exists.
 * @param path
 * @return the RepositoryMapping for this path,or null for non GitProvider.
 */
public static RepositoryMapping getMapping(IPath path){
  IProject[] projects=ResourcesPlugin.getWorkspace().getRoot().getProjects();
  for (  IProject project : projects) {
    if (isNonWorkspace(project))     continue;
    RepositoryMapping mapping=getMapping(project);
    if (mapping == null)     continue;
    Path workingTree=new Path(mapping.getWorkTree().toString());
    IPath relative=path.makeRelativeTo(workingTree);
    String firstSegment=relative.segment(0);
    if (firstSegment == null || !"String_Node_Str".equals(firstSegment))     return mapping;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get the repository mapping for a path if it exists.
 * @param path
 * @return the RepositoryMapping for this path,or null for non GitProvider.
 */
public static RepositoryMapping getMapping(IPath path){
  IProject[] projects=ResourcesPlugin.getWorkspace().getRoot().getProjects();
  for (  IProject project : projects) {
    if (isNonWorkspace(project))     continue;
    RepositoryMapping mapping=getMapping(project);
    if (mapping == null)     continue;
    IPath workingTree=new Path(mapping.getWorkTree().toString());
    if (workingTree.isPrefixOf(path))     return mapping;
  }
  return null;
}
Program: 91480
Project: 91480
Buggy source:
/** 
 * @param parent parent object
 * @param repo repository associated with this object
 * @param cache list of changes associated with this object
 * @param fileFactory leaf instance factory
 */
protected GitModelCache(GitModelRepository parent,Repository repo,Map<String,Change> cache,FileModelFactory fileFactory){
  super(parent);
  this.repo=repo;
  this.cache=cache;
  this.fileFactory=fileFactory;
  cacheTreeMap=new HashMap<String,GitModelCacheTree>();
  location=new Path(repo.getWorkTree().toString());
}

Fixed version (ground truth):
/** 
 * @param parent parent object
 * @param repo repository associated with this object
 * @param changes list of changes associated with this object
 * @param fileFactory leaf instance factory
 */
protected GitModelCache(GitModelRepository parent,final Repository repo,Map<String,Change> changes,final FileModelFactory fileFactory){
  super(parent);
  this.repo=repo;
  this.location=new Path(repo.getWorkTree().toString());
  this.children=TreeBuilder.build(this,repo,changes,fileFactory,new TreeModelFactory(){
    public GitModelTree createTreeModel(    GitModelObjectContainer parentObject,    IPath fullPath,    int kind){
      return new GitModelCacheTree(parentObject,repo,fullPath,fileFactory);
    }
  }
);
}
Program: 91481
Project: 91481
Buggy source:
@Override public GitModelObject[] getChildren(){
  List<GitModelObject> result=new ArrayList<GitModelObject>();
  for (  Entry<String,Change> cacheEntry : cache.entrySet()) {
    GitModelObject entry=extractFromCache(cacheEntry.getValue(),cacheEntry.getKey());
    if (entry == null)     continue;
    result.add(entry);
  }
  return result.toArray(new GitModelObject[result.size()]);
}

Fixed version (ground truth):
@Override public GitModelObject[] getChildren(){
  return children;
}
Program: 91482
Project: 91482
Buggy source:
@Override public void dispose(){
  for (  GitModelTree modelTree : cacheTreeMap.values())   modelTree.dispose();
  cache.clear();
  cacheTreeMap.clear();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (children != null) {
    for (    GitModelObject object : children)     object.dispose();
    children=null;
  }
}
Program: 91483
Project: 91483
Buggy source:
/** 
 * @param parent parent object
 * @param repo repository associated with this object parent object
 * @param fullPath absolute path of object
 * @param factory
 */
public GitModelCacheTree(GitModelObjectContainer parent,Repository repo,IPath fullPath,FileModelFactory factory){
  super(parent,fullPath,RIGHT | CHANGE);
  this.repo=repo;
  this.factory=factory;
  cacheTreeMap=new HashMap<String,GitModelObject>();
}

Fixed version (ground truth):
/** 
 * @param parent parent object
 * @param repo repository associated with this object parent object
 * @param fullPath absolute path of object
 * @param factory
 */
public GitModelCacheTree(GitModelObjectContainer parent,Repository repo,IPath fullPath,FileModelFactory factory){
  super(parent,fullPath,RIGHT | CHANGE);
  this.factory=factory;
}
Program: 91484
Project: 91484
Buggy source:
/** 
 * @param shell
 * @param repo
 * @param result
 */
public PullResultDialog(Shell shell,Repository repo,PullResult result){
  super(shell);
  setShellStyle(getShellStyle() & ~SWT.APPLICATION_MODAL | SWT.SHELL_TRIM);
  setBlockOnOpen(false);
  this.repo=repo;
  this.result=result;
  hasUpdates=hasFetchResults() || hasMergeResults() || hasRebaseResults();
}

Fixed version (ground truth):
/** 
 * @param shell
 * @param repo
 * @param result
 */
public PullResultDialog(Shell shell,Repository repo,PullResult result){
  super(shell);
  setShellStyle(getShellStyle() & ~SWT.APPLICATION_MODAL | SWT.SHELL_TRIM);
  setBlockOnOpen(false);
  this.repo=repo;
  this.result=result;
  persistSize=hasFetchResults() || hasMergeResults();
}
Program: 91486
Project: 91486
Buggy source:
@Override protected int getDialogBoundsStrategy(){
  return hasUpdates ? DIALOG_PERSISTLOCATION | DIALOG_PERSISTSIZE : DIALOG_PERSISTLOCATION;
}

Fixed version (ground truth):
@Override protected int getDialogBoundsStrategy(){
  int strategy=DIALOG_PERSISTLOCATION;
  if (persistSize)   strategy|=DIALOG_PERSISTSIZE;
  return strategy;
}
Program: 91487
Project: 91487
Buggy source:
@Override protected IStatus run(IProgressMonitor monitor){
  waitForWorkspaceLock();
  if (monitor.isCanceled())   return Status.CANCEL_STATUS;
  lock.lock();
  try {
    long startTime=System.currentTimeMillis();
    IndexDiffData result=calcIndexDiffData(monitor,getName(),filesToUpdate,resourcesToUpdate);
    if (monitor.isCanceled())     return Status.CANCEL_STATUS;
    indexDiffData=result;
    if (GitTraceLocation.INDEXDIFFCACHE.isActive()) {
      long time=System.currentTimeMillis() - startTime;
      StringBuilder message=new StringBuilder(NLS.bind("String_Node_Str",Integer.valueOf(resourcesToUpdate.size()),Long.valueOf(time)));
      GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),message.append(indexDiffData.toString()).toString());
    }
    notifyListeners();
    return Status.OK_STATUS;
  }
 catch (  RuntimeException e) {
    if (GitTraceLocation.INDEXDIFFCACHE.isActive())     GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),"String_Node_Str",e);
    scheduleReloadJob("String_Node_Str");
    return Status.OK_STATUS;
  }
 finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  waitForWorkspaceLock(monitor);
  if (monitor.isCanceled())   return Status.CANCEL_STATUS;
  lock.lock();
  try {
    long startTime=System.currentTimeMillis();
    IndexDiffData result=calcIndexDiffData(monitor,getName(),filesToUpdate,resourcesToUpdate);
    if (monitor.isCanceled())     return Status.CANCEL_STATUS;
    indexDiffData=result;
    if (GitTraceLocation.INDEXDIFFCACHE.isActive()) {
      long time=System.currentTimeMillis() - startTime;
      StringBuilder message=new StringBuilder(NLS.bind("String_Node_Str",Integer.valueOf(resourcesToUpdate.size()),Long.valueOf(time)));
      GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),message.append(indexDiffData.toString()).toString());
    }
    notifyListeners();
    return Status.OK_STATUS;
  }
 catch (  RuntimeException e) {
    if (GitTraceLocation.INDEXDIFFCACHE.isActive())     GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),"String_Node_Str",e);
    scheduleReloadJob("String_Node_Str");
    return Status.OK_STATUS;
  }
 finally {
    lock.unlock();
  }
}
Program: 91490
Project: 91490
Buggy source:
private void waitForWorkspaceLock(){
  try {
    ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable(){
      public void run(      IProgressMonitor monitor) throws CoreException {
      }
    }
,new NullProgressMonitor());
  }
 catch (  CoreException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void waitForWorkspaceLock(IProgressMonitor monitor){
  try {
    ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable(){
      public void run(      IProgressMonitor innerMonitor) throws CoreException {
      }
    }
,monitor);
  }
 catch (  OperationCanceledException e) {
    return;
  }
catch (  CoreException e) {
    throw new RuntimeException(e);
  }
}
Program: 91491
Project: 91491
Buggy source:
@Override protected IStatus run(IProgressMonitor monitor){
  waitForWorkspaceLock();
  if (monitor.isCanceled())   return Status.CANCEL_STATUS;
  lock.lock();
  try {
    long startTime=System.currentTimeMillis();
    IndexDiffData result=calcIndexDiffData(monitor,getName(),filesToUpdate,resourcesToUpdate);
    if (monitor.isCanceled())     return Status.CANCEL_STATUS;
    indexDiffData=result;
    if (GitTraceLocation.INDEXDIFFCACHE.isActive()) {
      long time=System.currentTimeMillis() - startTime;
      StringBuilder message=new StringBuilder(NLS.bind("String_Node_Str",Integer.valueOf(resourcesToUpdate.size()),Long.valueOf(time)));
      GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),message.append(indexDiffData.toString()).toString());
    }
    notifyListeners();
    return Status.OK_STATUS;
  }
 catch (  RuntimeException e) {
    if (GitTraceLocation.INDEXDIFFCACHE.isActive())     GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),"String_Node_Str",e);
    scheduleReloadJob("String_Node_Str");
    return Status.OK_STATUS;
  }
 finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  waitForWorkspaceLock(monitor);
  if (monitor.isCanceled())   return Status.CANCEL_STATUS;
  lock.lock();
  try {
    long startTime=System.currentTimeMillis();
    IndexDiffData result=calcIndexDiffData(monitor,getName(),filesToUpdate,resourcesToUpdate);
    if (monitor.isCanceled())     return Status.CANCEL_STATUS;
    indexDiffData=result;
    if (GitTraceLocation.INDEXDIFFCACHE.isActive()) {
      long time=System.currentTimeMillis() - startTime;
      StringBuilder message=new StringBuilder(NLS.bind("String_Node_Str",Integer.valueOf(resourcesToUpdate.size()),Long.valueOf(time)));
      GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),message.append(indexDiffData.toString()).toString());
    }
    notifyListeners();
    return Status.OK_STATUS;
  }
 catch (  RuntimeException e) {
    if (GitTraceLocation.INDEXDIFFCACHE.isActive())     GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),"String_Node_Str",e);
    scheduleReloadJob("String_Node_Str");
    return Status.OK_STATUS;
  }
 finally {
    lock.unlock();
  }
}
Program: 91494
Project: 91494
Buggy source:
private void waitForWorkspaceLock(){
  try {
    ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable(){
      public void run(      IProgressMonitor monitor) throws CoreException {
      }
    }
,new NullProgressMonitor());
  }
 catch (  CoreException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void waitForWorkspaceLock(IProgressMonitor monitor){
  try {
    ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable(){
      public void run(      IProgressMonitor innerMonitor) throws CoreException {
      }
    }
,monitor);
  }
 catch (  OperationCanceledException e) {
    return;
  }
catch (  CoreException e) {
    throw new RuntimeException(e);
  }
}
Program: 91495
Project: 91495
Buggy source:
@BeforeClass public static void disableSecureStoragePasswordProviders(){
  List availableModules=PasswordProviderSelector.getInstance().findAvailableModules(null);
  StringBuffer tmp=new StringBuffer();
  for (  Object module : availableModules) {
    ExtStorageModule storageModule=(ExtStorageModule)module;
    tmp.append(storageModule.moduleID).append("String_Node_Str");
  }
  IEclipsePreferences node=ConfigurationScope.INSTANCE.getNode("String_Node_Str");
  node.put(IStorageConstants.DISABLED_PROVIDERS_KEY,tmp.toString());
}

Fixed version (ground truth):
@BeforeClass public static void disableSecureStoragePasswordProviders(){
  List availableModules=PasswordProviderSelector.getInstance().findAvailableModules(null);
  StringBuffer tmp=new StringBuffer();
  for (  Object module : availableModules) {
    ExtStorageModule storageModule=(ExtStorageModule)module;
    tmp.append(storageModule.moduleID).append("String_Node_Str");
  }
  IEclipsePreferences node=new ConfigurationScope().getNode("String_Node_Str");
  node.put(IStorageConstants.DISABLED_PROVIDERS_KEY,tmp.toString());
}
Program: 91501
Project: 91501
Buggy source:
/** 
 * Creates a wizard which is used to export the changes introduced by a commit.
 * @param commit
 * @param db
 */
public GitCreatePatchWizard(RevCommit commit,Repository db){
  this.commit=commit;
  this.db=db;
  setDialogSettings(DialogSettings.getOrCreateSection(Activator.getDefault().getDialogSettings(),"String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Creates a wizard which is used to export the changes introduced by a commit.
 * @param commit
 * @param db
 */
public GitCreatePatchWizard(RevCommit commit,Repository db){
  this.commit=commit;
  this.db=db;
  setDialogSettings(getOrCreateSection(Activator.getDefault().getDialogSettings(),"String_Node_Str"));
}
Program: 91502
Project: 91502
Buggy source:
private void reactOnSelection(ISelection selection){
  if (selection instanceof StructuredSelection) {
    StructuredSelection ssel=(StructuredSelection)selection;
    if (ssel.size() != 1)     return;
    if (ssel.getFirstElement() instanceof IResource)     showResource((IResource)ssel.getFirstElement());
    if (ssel.getFirstElement() instanceof IAdaptable) {
      IResource adapted=(IResource)((IAdaptable)ssel.getFirstElement()).getAdapter(IResource.class);
      if (adapted != null)       showResource(adapted);
    }
 else     if (ssel.getFirstElement() instanceof RepositoryTreeNode) {
      RepositoryTreeNode repoNode=(RepositoryTreeNode)ssel.getFirstElement();
      reload(repoNode.getRepository());
    }
  }
}

Fixed version (ground truth):
private void reactOnSelection(ISelection selection){
  if (selection instanceof StructuredSelection) {
    StructuredSelection ssel=(StructuredSelection)selection;
    if (ssel.size() != 1)     return;
    Object firstElement=ssel.getFirstElement();
    if (firstElement instanceof IResource)     showResource((IResource)firstElement);
 else     if (firstElement instanceof RepositoryTreeNode) {
      RepositoryTreeNode repoNode=(RepositoryTreeNode)firstElement;
      reload(repoNode.getRepository());
    }
 else     if (firstElement instanceof IAdaptable) {
      IResource adapted=(IResource)((IAdaptable)firstElement).getAdapter(IResource.class);
      if (adapted != null)       showResource(adapted);
    }
  }
}
Program: 91503
Project: 91503
Buggy source:
GitFileHistory(final IResource rsrc,final int flags,final IProgressMonitor monitor){
  resource=rsrc;
  final RepositoryMapping rm=RepositoryMapping.getMapping(resource);
  if (rm == null) {
    Activator.logError(NLS.bind(CoreText.GitFileHistory_gitNotAttached,resource.getProject().getName()),null);
    db=null;
    walk=null;
  }
 else {
    db=rm.getRepository();
    walk=new KidWalk(db);
    gitPath=rm.getRepoRelativePath(resource);
    walk.setTreeFilter(AndTreeFilter.create(PathFilterGroup.createFromStrings(Collections.singleton(gitPath)),TreeFilter.ANY_DIFF));
  }
  revisions=buildRevisions(monitor,flags);
}

Fixed version (ground truth):
GitFileHistory(final IResource rsrc,final int flags,final IProgressMonitor monitor){
  resource=rsrc;
  final RepositoryMapping rm=RepositoryMapping.getMapping(resource);
  if (rm == null) {
    Activator.logError(NLS.bind(CoreText.GitFileHistory_gitNotAttached,resource.getProject().getName()),null);
    db=null;
    walk=null;
  }
 else {
    db=rm.getRepository();
    walk=new KidWalk(db);
    gitPath=rm.getRepoRelativePath(resource);
    if (gitPath == null || gitPath.isEmpty()) {
      walk.setTreeFilter(TreeFilter.ANY_DIFF);
    }
 else {
      walk.setTreeFilter(AndTreeFilter.create(PathFilterGroup.createFromStrings(Collections.singleton(gitPath)),TreeFilter.ANY_DIFF));
    }
  }
  revisions=buildRevisions(monitor,flags);
}
Program: 91505
Project: 91505
Buggy source:
public boolean moveFolder(final IResourceTree tree,final IFolder srcf,final IFolder dstf,final int updateFlags,final IProgressMonitor monitor){
  final boolean force=(updateFlags & IResource.FORCE) == IResource.FORCE;
  if (!force && !tree.isSynchronized(srcf,IResource.DEPTH_ZERO))   return false;
  final RepositoryMapping srcm=RepositoryMapping.getMapping(srcf);
  if (srcm == null)   return false;
  final RepositoryMapping dstm=RepositoryMapping.getMapping(dstf);
  try {
    final String sPath=srcm.getRepoRelativePath(srcf);
    if (dstm != null && dstm.getRepository() == srcm.getRepository()) {
      final String dPath=srcm.getRepoRelativePath(dstf) + "String_Node_Str";
      MoveResult result=moveIndexContent(dPath,srcm,sPath);
switch (result) {
case SUCCESS:
        break;
case FAILED:
      tree.failed(new Status(IStatus.ERROR,Activator.getPluginId(),0,CoreText.MoveDeleteHook_operationError,null));
    break;
case UNTRACKED:
  return FINISH_FOR_ME;
}
tree.standardMoveFolder(srcf,dstf,updateFlags,monitor);
}
}
 catch (IOException e) {
tree.failed(new Status(IStatus.ERROR,Activator.getPluginId(),0,CoreText.MoveDeleteHook_operationError,e));
}
return true;
}

Fixed version (ground truth):
public boolean moveFolder(final IResourceTree tree,final IFolder srcf,final IFolder dstf,final int updateFlags,final IProgressMonitor monitor){
  final boolean force=(updateFlags & IResource.FORCE) == IResource.FORCE;
  if (!force && !tree.isSynchronized(srcf,IResource.DEPTH_ZERO))   return false;
  final RepositoryMapping srcm=RepositoryMapping.getMapping(srcf);
  if (srcm == null)   return false;
  final RepositoryMapping dstm=RepositoryMapping.getMapping(dstf);
  try {
    final String sPath=srcm.getRepoRelativePath(srcf);
    if (dstm != null && dstm.getRepository() == srcm.getRepository()) {
      final String dPath=srcm.getRepoRelativePath(dstf) + "String_Node_Str";
      MoveResult result=moveIndexContent(dPath,srcm,sPath);
switch (result) {
case SUCCESS:
        break;
case FAILED:
      tree.failed(new Status(IStatus.ERROR,Activator.getPluginId(),0,CoreText.MoveDeleteHook_operationError,null));
    return I_AM_DONE;
case UNTRACKED:
  return FINISH_FOR_ME;
}
}
tree.standardMoveFolder(srcf,dstf,updateFlags,monitor);
}
 catch (IOException e) {
tree.failed(new Status(IStatus.ERROR,Activator.getPluginId(),0,CoreText.MoveDeleteHook_operationError,e));
}
return true;
}
Program: 91507
Project: 91507
Buggy source:
@SuppressWarnings("String_Node_Str") ProjectReference(final String reference) throws URISyntaxException, IllegalArgumentException {
  final String[] tokens=reference.split(Pattern.quote(SEPARATOR));
  if (tokens.length != 4)   throw new IllegalArgumentException(NLS.bind(CoreText.GitProjectSetCapability_InvalidTokensCount,new Object[]{4,tokens.length,tokens}));
  this.version=tokens[0];
  this.repository=new URIish(tokens[1]);
  if (!"String_Node_Str".equals(tokens[2]))   this.branch=tokens[2];
  this.projectDir=tokens[3];
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") ProjectReference(final String reference) throws URISyntaxException, IllegalArgumentException {
  final String[] tokens=reference.split(Pattern.quote(SEPARATOR));
  if (tokens.length != 4)   throw new IllegalArgumentException(NLS.bind(CoreText.GitProjectSetCapability_InvalidTokensCount,new Object[]{4,tokens.length,tokens}));
  this.repository=new URIish(tokens[1]);
  if (!"String_Node_Str".equals(tokens[2]))   this.branch=tokens[2];
  this.projectDir=tokens[3];
}
Program: 91511
Project: 91511
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  Repository repo=getRepository(event);
  BasicConfigurationDialog.show(repo);
  RevCommit commit=(RevCommit)getSelection(getPage()).getFirstElement();
  RevCommit newHead;
  RevertCommand revert;
  Git git=new Git(repo);
  try {
    revert=git.revert().include(commit.getId());
    newHead=revert.call();
    if (newHead != null && revert.getRevertedRefs().isEmpty())     MessageDialog.openWarning(getPart(event).getSite().getShell(),UIText.RevertHandler_NoRevertTitle,UIText.RevertHandler_AlreadyRevertedMessae);
  }
 catch (  Exception e) {
    throw new ExecutionException(UIText.RevertOperation_InternalError,e);
  }
  if (newHead == null)   throw new ExecutionException(UIText.RevertOperation_Failed);
  return null;
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  Repository repo=getRepository(event);
  BasicConfigurationDialog.show(repo);
  RevCommit commit=(RevCommit)getSelection(getPage()).getFirstElement();
  RevCommit newHead;
  RevertCommand revert;
  Git git=new Git(repo);
  try {
    revert=git.revert().include(commit.getId());
    newHead=revert.call();
    if (newHead != null && revert.getRevertedRefs().isEmpty())     MessageDialog.openWarning(getPart(event).getSite().getShell(),UIText.RevertHandler_NoRevertTitle,UIText.RevertHandler_AlreadyRevertedMessae);
  }
 catch (  Exception e) {
    Activator.handleError(UIText.RevertOperation_InternalError,e,true);
    return null;
  }
  if (newHead == null)   Activator.showError(UIText.RevertOperation_Failed,null);
  return null;
}
Program: 91512
Project: 91512
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  Repository repo=getRepository(event);
  BasicConfigurationDialog.show(repo);
  RevCommit commit=(RevCommit)getSelection(getPage()).getFirstElement();
  RevCommit newHead;
  RevertCommand revert;
  Git git=new Git(repo);
  try {
    revert=git.revert().include(commit.getId());
    newHead=revert.call();
    if (newHead != null && revert.getRevertedRefs().isEmpty())     MessageDialog.openWarning(getPart(event).getSite().getShell(),UIText.RevertHandler_NoRevertTitle,UIText.RevertHandler_AlreadyRevertedMessae);
  }
 catch (  Exception e) {
    throw new ExecutionException(UIText.RevertOperation_InternalError,e);
  }
  if (newHead == null)   throw new ExecutionException(UIText.RevertOperation_Failed);
  return null;
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  Repository repo=getRepository(event);
  BasicConfigurationDialog.show(repo);
  RevCommit commit=(RevCommit)getSelection(getPage()).getFirstElement();
  RevCommit newHead;
  RevertCommand revert;
  Git git=new Git(repo);
  try {
    revert=git.revert().include(commit.getId());
    newHead=revert.call();
    if (newHead != null && revert.getRevertedRefs().isEmpty())     MessageDialog.openWarning(getPart(event).getSite().getShell(),UIText.RevertHandler_NoRevertTitle,UIText.RevertHandler_AlreadyRevertedMessae);
  }
 catch (  Exception e) {
    Activator.handleError(UIText.RevertOperation_InternalError,e,true);
    return null;
  }
  if (newHead == null)   Activator.showError(UIText.RevertOperation_Failed,null);
  return null;
}
Program: 91513
Project: 91513
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj instanceof GitModelBlob && !(obj instanceof GitModelCacheFile) && !(obj instanceof GitModelWorkingFile)) {
    GitModelBlob objBlob=(GitModelBlob)obj;
    boolean equalsRemoteId;
    ObjectId objRemoteId=objBlob.remoteId;
    if (objRemoteId != null)     equalsRemoteId=objRemoteId.equals(remoteId);
 else     equalsRemoteId=remoteId == null;
    return objBlob.baseId.equals(baseId) && equalsRemoteId && objBlob.location.equals(location);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj == null)   return false;
  if (obj.getClass() != getClass())   return false;
  GitModelBlob objBlob=(GitModelBlob)obj;
  boolean equalsRemoteId;
  ObjectId objRemoteId=objBlob.remoteId;
  if (objRemoteId != null)   equalsRemoteId=objRemoteId.equals(remoteId);
 else   equalsRemoteId=remoteId == null;
  return objBlob.baseId.equals(baseId) && equalsRemoteId && objBlob.location.equals(location);
}
Program: 91514
Project: 91514
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj instanceof GitModelCacheFile) {
    GitModelCacheFile objBlob=(GitModelCacheFile)obj;
    return objBlob.baseId.equals(baseId) && objBlob.remoteId.equals(remoteId) && objBlob.getLocation().equals(getLocation());
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj == null)   return false;
  if (obj.getClass() != getClass())   return false;
  GitModelCacheFile objBlob=(GitModelCacheFile)obj;
  return objBlob.baseId.equals(baseId) && objBlob.remoteId.equals(remoteId) && objBlob.getLocation().equals(getLocation());
}
Program: 91515
Project: 91515
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj instanceof GitModelCacheTree) {
    GitModelCacheTree objTree=(GitModelCacheTree)obj;
    return objTree.getLocation().equals(getLocation()) && objTree.getBaseId().equals(getBaseId());
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj == null)   return false;
  if (obj.getClass() != getClass())   return false;
  GitModelCacheTree objTree=(GitModelCacheTree)obj;
  return objTree.getLocation().equals(getLocation()) && objTree.getBaseId().equals(getBaseId());
}
Program: 91516
Project: 91516
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj instanceof GitModelCommit && !(obj instanceof GitModelTree) && !(obj instanceof GitModelBlob)) {
    GitModelCommit objCommit=(GitModelCommit)obj;
    return objCommit.getBaseCommit().equals(baseCommit) && objCommit.getParent().equals(getParent());
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj == null)   return false;
  if (obj.getClass() != getClass())   return false;
  GitModelCommit objCommit=(GitModelCommit)obj;
  return objCommit.getBaseCommit().equals(baseCommit) && objCommit.getParent().equals(getParent());
}
Program: 91517
Project: 91517
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj instanceof GitModelTree && !(obj instanceof GitModelCacheTree)) {
    GitModelTree objTree=(GitModelTree)obj;
    return objTree.location.equals(location) && objTree.baseCommit.equals(baseCommit);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj == null)   return false;
  if (obj.getClass() != getClass())   return false;
  GitModelTree objTree=(GitModelTree)obj;
  return objTree.location.equals(location) && objTree.baseCommit.equals(baseCommit);
}
Program: 91518
Project: 91518
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj instanceof GitModelWorkingFile)   return ((GitModelWorkingFile)obj).getLocation().equals(getLocation());
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj == null)   return false;
  if (obj.getClass() != getClass())   return false;
  return ((GitModelWorkingFile)obj).getLocation().equals(getLocation());
}
Program: 91519
Project: 91519
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj instanceof GitModelWorkingTree) {
    GitModelCache left=(GitModelCache)obj;
    return left.getParent().equals(getParent());
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == this)   return true;
  if (obj == null)   return false;
  if (obj.getClass() != getClass())   return false;
  GitModelCache left=(GitModelCache)obj;
  return left.getParent().equals(getParent());
}
Program: 91521
Project: 91521
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  RevCommit commit=(RevCommit)getSelection(getPage()).getFirstElement();
  RevCommit newHead;
  Repository repo=getRepository(event);
  CherryPickResult cherryPickResult;
  Git git=new Git(repo);
  Shell parent=getPart(event).getSite().getShell();
  try {
    cherryPickResult=git.cherryPick().include(commit.getId()).call();
    newHead=cherryPickResult.getNewHead();
    if (newHead != null && cherryPickResult.getCherryPickedRefs().isEmpty())     MessageDialog.openWarning(parent,UIText.CherryPickHandler_NoCherryPickPerformedTitle,UIText.CherryPickHandler_NoCherryPickPerformedMessage);
  }
 catch (  Exception e) {
    throw new ExecutionException(UIText.CherryPickOperation_InternalError,e);
  }
  if (newHead == null)   if (cherryPickResult.getStatus() == CherryPickStatus.CONFLICTING)   MessageDialog.openWarning(parent,UIText.CherryPickHandler_CherryPickConflictsTitle,UIText.CherryPickHandler_CherryPickConflictsMessage);
 else   throw new ExecutionException(UIText.CherryPickOperation_Failed);
  return null;
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  RevCommit commit=(RevCommit)getSelection(getPage()).getFirstElement();
  RevCommit newHead;
  Repository repo=getRepository(event);
  CherryPickResult cherryPickResult;
  Git git=new Git(repo);
  Shell parent=getPart(event).getSite().getShell();
  try {
    cherryPickResult=git.cherryPick().include(commit.getId()).call();
    newHead=cherryPickResult.getNewHead();
    if (newHead != null && cherryPickResult.getCherryPickedRefs().isEmpty())     MessageDialog.openWarning(parent,UIText.CherryPickHandler_NoCherryPickPerformedTitle,UIText.CherryPickHandler_NoCherryPickPerformedMessage);
  }
 catch (  Exception e) {
    throw new ExecutionException(UIText.CherryPickOperation_InternalError,e);
  }
  if (newHead == null) {
    CherryPickStatus status=cherryPickResult.getStatus();
switch (status) {
case CONFLICTING:
      MessageDialog.openWarning(parent,UIText.CherryPickHandler_CherryPickConflictsTitle,UIText.CherryPickHandler_CherryPickConflictsMessage);
    break;
case FAILED:
  IStatus details=getErrorList(cherryPickResult.getFailingPaths());
Activator.showErrorStatus(UIText.CherryPickHandler_CherryPickFailedMessage,details);
break;
case OK:
break;
}
}
return null;
}
Program: 91522
Project: 91522
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  RevCommit commit=(RevCommit)getSelection(getPage()).getFirstElement();
  RevCommit newHead;
  Repository repo=getRepository(event);
  CherryPickResult cherryPickResult;
  Git git=new Git(repo);
  Shell parent=getPart(event).getSite().getShell();
  try {
    cherryPickResult=git.cherryPick().include(commit.getId()).call();
    newHead=cherryPickResult.getNewHead();
    if (newHead != null && cherryPickResult.getCherryPickedRefs().isEmpty())     MessageDialog.openWarning(parent,UIText.CherryPickHandler_NoCherryPickPerformedTitle,UIText.CherryPickHandler_NoCherryPickPerformedMessage);
  }
 catch (  Exception e) {
    throw new ExecutionException(UIText.CherryPickOperation_InternalError,e);
  }
  if (newHead == null)   if (cherryPickResult.getStatus() == CherryPickStatus.CONFLICTING)   MessageDialog.openWarning(parent,UIText.CherryPickHandler_CherryPickConflictsTitle,UIText.CherryPickHandler_CherryPickConflictsMessage);
 else   throw new ExecutionException(UIText.CherryPickOperation_Failed);
  return null;
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  RevCommit commit=(RevCommit)getSelection(getPage()).getFirstElement();
  RevCommit newHead;
  Repository repo=getRepository(event);
  CherryPickResult cherryPickResult;
  Git git=new Git(repo);
  Shell parent=getPart(event).getSite().getShell();
  try {
    cherryPickResult=git.cherryPick().include(commit.getId()).call();
    newHead=cherryPickResult.getNewHead();
    if (newHead != null && cherryPickResult.getCherryPickedRefs().isEmpty())     MessageDialog.openWarning(parent,UIText.CherryPickHandler_NoCherryPickPerformedTitle,UIText.CherryPickHandler_NoCherryPickPerformedMessage);
  }
 catch (  Exception e) {
    throw new ExecutionException(UIText.CherryPickOperation_InternalError,e);
  }
  if (newHead == null) {
    CherryPickStatus status=cherryPickResult.getStatus();
switch (status) {
case CONFLICTING:
      MessageDialog.openWarning(parent,UIText.CherryPickHandler_CherryPickConflictsTitle,UIText.CherryPickHandler_CherryPickConflictsMessage);
    break;
case FAILED:
  IStatus details=getErrorList(cherryPickResult.getFailingPaths());
Activator.showErrorStatus(UIText.CherryPickHandler_CherryPickFailedMessage,details);
break;
case OK:
break;
}
}
return null;
}
Program: 91524
Project: 91524
Buggy source:
private void fillOptionsMapFromOptions(){
  Map<String,String> oldValues=new HashMap<String,String>();
  for (  Properties props : optionsMap.values())   for (  Object keyObject : props.keySet()) {
    String key=(String)keyObject;
    oldValues.put(key,props.getProperty(key));
  }
  optionsMap.clear();
  for (  PluginNode plugin : PLUGIN_LIST) {
    Properties props=new Properties();
    try {
      InputStream is=Platform.getBundle(plugin.getPlugin()).getResource("String_Node_Str").openStream();
      props.load(is);
    }
 catch (    IOException e) {
      Activator.handleError(e.getMessage(),e,true);
    }
    optionsMap.put(plugin,props);
  }
  Map<String,String> newValues=new HashMap<String,String>();
  for (  Properties props : optionsMap.values())   for (  Object keyObject : props.keySet()) {
    String key=(String)keyObject;
    oldValues.put(key,props.getProperty(key));
  }
  boolean dirty=false;
  if (oldValues.keySet().containsAll(newValues.keySet()) && newValues.keySet().containsAll(oldValues.keySet())) {
    for (    String key : oldValues.keySet()) {
      if (!oldValues.get(key).equals(newValues.get(key))) {
        dirty=true;
        break;
      }
    }
  }
 else {
    dirty=true;
  }
  if (dirty)   setDirty(true);
}

Fixed version (ground truth):
private void fillOptionsMapFromOptions(){
  Map<String,String> oldValues=new HashMap<String,String>();
  for (  Properties props : optionsMap.values())   for (  Object keyObject : props.keySet()) {
    String key=(String)keyObject;
    oldValues.put(key,props.getProperty(key));
  }
  optionsMap.clear();
  for (  PluginNode plugin : PLUGIN_LIST) {
    Properties props=new Properties();
    try {
      InputStream is=Platform.getBundle(plugin.getPlugin()).getResource("String_Node_Str").openStream();
      props.load(is);
    }
 catch (    IOException e) {
      Activator.handleError(e.getMessage(),e,true);
    }
    optionsMap.put(plugin,props);
  }
  Map<String,String> newValues=new HashMap<String,String>();
  for (  Properties props : optionsMap.values())   for (  Object keyObject : props.keySet()) {
    String key=(String)keyObject;
    oldValues.put(key,props.getProperty(key));
  }
  boolean dirty=false;
  if (oldValues.keySet().containsAll(newValues.keySet()) && newValues.keySet().containsAll(oldValues.keySet())) {
    for (    Entry<String,String> oldValueEntry : oldValues.entrySet()) {
      String key=oldValueEntry.getKey();
      String newValue=newValues.get(key);
      if (!oldValueEntry.getValue().equals(newValue)) {
        dirty=true;
        break;
      }
    }
  }
 else {
    dirty=true;
  }
  if (dirty)   setDirty(true);
}
Program: 91525
Project: 91525
Buggy source:
@Override public boolean performFinish(){
  GitSynchronizeDataSet gsdSet=new GitSynchronizeDataSet();
  Map<Repository,String> branches=page.getSelectedBranches();
  for (  Repository repo : branches.keySet())   try {
    gsdSet.add(new GitSynchronizeData(repo,Constants.HEAD,branches.get(repo),false));
  }
 catch (  IOException e) {
    Activator.logError(e.getMessage(),e);
  }
  new GitSynchronize(gsdSet);
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  GitSynchronizeDataSet gsdSet=new GitSynchronizeDataSet();
  Map<Repository,String> branches=page.getSelectedBranches();
  for (  Entry<Repository,String> branchesEntry : branches.entrySet())   try {
    gsdSet.add(new GitSynchronizeData(branchesEntry.getKey(),Constants.HEAD,branchesEntry.getValue(),false));
  }
 catch (  IOException e) {
    Activator.logError(e.getMessage(),e);
  }
  new GitSynchronize(gsdSet);
  return true;
}
Program: 91526
Project: 91526
Buggy source:
/** 
 * @return the calculated commit message
 */
private String calculateCommitMessage(){
  if (commitMessage != null) {
    return commitMessage;
  }
  String calculatedCommitMessage=null;
  Set<IResource> resources=new HashSet<IResource>();
  for (  CommitItem item : items) {
    IResource resource=item.file.getProject();
    resources.add(resource);
  }
  try {
    ICommitMessageProvider messageProvider=getCommitMessageProvider();
    if (messageProvider != null) {
      IResource[] resourcesArray=resources.toArray(new IResource[0]);
      calculatedCommitMessage=messageProvider.getMessage(resourcesArray);
    }
  }
 catch (  CoreException coreException) {
    Activator.error(coreException.getLocalizedMessage(),coreException);
  }
  return calculatedCommitMessage;
}

Fixed version (ground truth):
/** 
 * @return the calculated commit message
 */
private String calculateCommitMessage(){
  String calculatedCommitMessage=null;
  Set<IResource> resources=new HashSet<IResource>();
  for (  CommitItem item : items) {
    IResource resource=item.file.getProject();
    resources.add(resource);
  }
  try {
    ICommitMessageProvider messageProvider=getCommitMessageProvider();
    if (messageProvider != null) {
      IResource[] resourcesArray=resources.toArray(new IResource[0]);
      calculatedCommitMessage=messageProvider.getMessage(resourcesArray);
    }
  }
 catch (  CoreException coreException) {
    Activator.error(coreException.getLocalizedMessage(),coreException);
  }
  return calculatedCommitMessage;
}
Program: 91528
Project: 91528
Buggy source:
@Test public void testTagDialogShowExistingTags() throws Exception {
  SWTBotShell tagDialog=openTagDialog();
  int index=tagDialog.bot().tableWithLabel(UIText.CreateTagDialog_existingTags).indexOf("String_Node_Str");
  assertTrue("String_Node_Str",index >= 0);
}

Fixed version (ground truth):
@Test public void testTagDialogShowExistingTags() throws Exception {
  SWTBotShell tagDialog=openTagDialog();
  SWTBotTable table=tagDialog.bot().tableWithLabel(UIText.CreateTagDialog_existingTags);
  TestUtil.waitUntilTableHasRowWithText(tagDialog.bot(),table,"String_Node_Str",10000);
}
Program: 91529
Project: 91529
Buggy source:
@Test public void testCloneRepoButton() throws Exception {
  clearView();
  refreshAndWait();
  assertEmpty();
  getOrOpenView().toolbarButton(myUtil.getPluginLocalizedValue("String_Node_Str")).click();
  SWTBotShell shell=bot.shell(UIText.GitCloneWizard_title).activate();
  shell.bot().textInGroup(UIText.RepositorySelectionPage_groupLocation,0).setText(repositoryFile.getPath());
  shell.bot().button(IDialogConstants.NEXT_LABEL).click();
  waitInUI();
  shell.bot().button(IDialogConstants.NEXT_LABEL).click();
  waitInUI();
  SWTBotText pathText=shell.bot().text(0);
  pathText.setText(pathText.getText() + "String_Node_Str");
  shell.bot().button(IDialogConstants.FINISH_LABEL).click();
  waitInUI();
  refreshAndWait();
  assertHasClonedRepo();
}

Fixed version (ground truth):
@Test public void testCloneRepoButton() throws Exception {
  clearView();
  refreshAndWait();
  assertEmpty();
  getOrOpenView().toolbarButton(myUtil.getPluginLocalizedValue("String_Node_Str")).click();
  SWTBotShell shell=bot.shell(UIText.GitCloneWizard_title).activate();
  shell.bot().textInGroup(UIText.RepositorySelectionPage_groupLocation,0).setText(repositoryFile.getPath());
  shell.bot().button(IDialogConstants.NEXT_LABEL).click();
  waitInUI();
  shell.bot().button(IDialogConstants.NEXT_LABEL).click();
  waitInUI();
  SWTBotText pathText=shell.bot().text(0);
  pathText.setText(pathText.getText() + "String_Node_Str");
  shell.bot().button(IDialogConstants.FINISH_LABEL).click();
  refreshAndWait();
  assertHasClonedRepo();
}
Program: 91530
Project: 91530
Buggy source:
private void assertHasClonedRepo() throws Exception {
  final SWTBotTree tree=getOrOpenView().bot().tree();
  final SWTBotTreeItem[] items=tree.getAllItems();
  boolean found=false;
  for (  SWTBotTreeItem item : items) {
    if (item.getText().startsWith(repositoryFile.getParentFile().getName() + "String_Node_Str")) {
      found=true;
      break;
    }
  }
  assertTrue("String_Node_Str",found);
}

Fixed version (ground truth):
private void assertHasClonedRepo() throws Exception {
  final SWTBotTree tree=getOrOpenView().bot().tree();
  String text=repositoryFile.getParentFile().getName() + "String_Node_Str";
  TestUtil.waitUntilTreeHasNodeWithText(bot,tree,text,10000);
}
Program: 91531
Project: 91531
Buggy source:
@Test public void testDeleteSingleBranch() throws Exception {
  SWTBotTree tree=getOrOpenView().bot().tree();
  refreshAndWait();
  SWTBotTreeItem localBranchesItem=myRepoViewUtil.getLocalBranchesItem(tree,repositoryFile).expand();
  SWTBotTreeItem masterNode=localBranchesItem.getNode("String_Node_Str");
  masterNode.select();
  ContextMenuHelper.clickContextMenu(tree,myUtil.getPluginLocalizedValue("String_Node_Str"));
  TestUtil.joinJobs(JobFamilies.CHECKOUT);
  ContextMenuHelper.clickContextMenu(tree,myUtil.getPluginLocalizedValue("String_Node_Str"));
  SWTBotShell createBranchShell=bot.shell(UIText.CreateBranchWizard_NewBranchTitle);
  createBranchShell.bot().textWithId("String_Node_Str").setText("String_Node_Str");
  createBranchShell.bot().checkBox().deselect();
  createBranchShell.bot().button(IDialogConstants.FINISH_LABEL).click();
  refreshAndWait();
  localBranchesItem.getNode("String_Node_Str").select();
  ContextMenuHelper.clickContextMenu(tree,myUtil.getPluginLocalizedValue("String_Node_Str"));
  refreshAndWait();
  SWTBotTreeItem[] items=myRepoViewUtil.getLocalBranchesItem(tree,repositoryFile).getItems();
  assertEquals("String_Node_Str",2,items.length);
  assertEquals("String_Node_Str",items[0].getText());
  assertEquals("String_Node_Str",items[1].getText());
}

Fixed version (ground truth):
@Test public void testDeleteSingleBranch() throws Exception {
  SWTBotTree tree=getOrOpenView().bot().tree();
  refreshAndWait();
  SWTBotTreeItem localBranchesItem=myRepoViewUtil.getLocalBranchesItem(tree,repositoryFile).expand();
  SWTBotTreeItem masterNode=localBranchesItem.getNode("String_Node_Str");
  masterNode.select();
  ContextMenuHelper.clickContextMenu(tree,myUtil.getPluginLocalizedValue("String_Node_Str"));
  TestUtil.joinJobs(JobFamilies.CHECKOUT);
  ContextMenuHelper.clickContextMenu(tree,myUtil.getPluginLocalizedValue("String_Node_Str"));
  SWTBotShell createBranchShell=bot.shell(UIText.CreateBranchWizard_NewBranchTitle);
  createBranchShell.bot().textWithId("String_Node_Str").setText("String_Node_Str");
  createBranchShell.bot().checkBox().deselect();
  createBranchShell.bot().button(IDialogConstants.FINISH_LABEL).click();
  refreshAndWait();
  localBranchesItem=myRepoViewUtil.getLocalBranchesItem(tree,repositoryFile).expand();
  localBranchesItem.getNode("String_Node_Str").select();
  ContextMenuHelper.clickContextMenu(tree,myUtil.getPluginLocalizedValue("String_Node_Str"));
  refreshAndWait();
  SWTBotTreeItem[] items=myRepoViewUtil.getLocalBranchesItem(tree,repositoryFile).getItems();
  assertEquals("String_Node_Str",2,items.length);
  assertEquals("String_Node_Str",items[0].getText());
  assertEquals("String_Node_Str",items[1].getText());
}
Program: 91533
Project: 91533
Buggy source:
@Test public void shouldReturnListOfChanges() throws Exception {
  resetRepository(PROJ1);
  changeFilesInProject();
  showDialog(PROJ1,"String_Node_Str","String_Node_Str");
  bot.shell("String_Node_Str" + REPO1 + File.separator+ "String_Node_Str").activate();
  bot.comboBox(0).setSelection(UIText.SynchronizeWithAction_localRepoName);
  bot.comboBox(1).setSelection(HEAD);
  bot.comboBox(2).setSelection(UIText.SynchronizeWithAction_localRepoName);
  bot.comboBox(3).setSelection(MASTER);
  bot.checkBox("String_Node_Str").click();
  bot.button(IDialogConstants.OK_LABEL).click();
  bot.sleep(1000);
  SWTBotTree syncViewTree=bot.viewByTitle("String_Node_Str").bot().tree();
  assertEquals(1,syncViewTree.getAllItems().length);
  SWTBotTreeItem[] syncItems=syncViewTree.getAllItems();
  assertEquals(UIText.GitModelWorkingTree_workingTree,syncItems[0].getText());
}

Fixed version (ground truth):
@Test public void shouldReturnListOfChanges() throws Exception {
  resetRepository(PROJ1);
  changeFilesInProject();
  showDialog(PROJ1,"String_Node_Str","String_Node_Str");
  bot.shell("String_Node_Str" + REPO1 + File.separator+ "String_Node_Str").activate();
  bot.comboBox(0).setSelection(UIText.SynchronizeWithAction_localRepoName);
  bot.comboBox(1).setSelection(HEAD);
  bot.comboBox(2).setSelection(UIText.SynchronizeWithAction_localRepoName);
  bot.comboBox(3).setSelection(MASTER);
  bot.checkBox("String_Node_Str").click();
  bot.button(IDialogConstants.OK_LABEL).click();
  bot.sleep(1000);
  SWTBotTree syncViewTree=bot.viewByTitle("String_Node_Str").bot().tree();
  bot.waitUntil(Conditions.treeHasRows(syncViewTree,1),10000);
  SWTBotTreeItem[] syncItems=syncViewTree.getAllItems();
  assertEquals(UIText.GitModelWorkingTree_workingTree,syncItems[0].getText());
}
Program: 91534
Project: 91534
Buggy source:
private void saveOriginalChangeId(){
  int changeIdOffset=findOffsetOfChangeIdLine(previousCommitMessage);
  if (changeIdOffset > 0) {
    int endOfChangeId=findNextEOL(changeIdOffset,previousCommitMessage);
    int sha1Offset=changeIdOffset + "String_Node_Str".length();
    try {
      originalChangeId=ObjectId.fromString(previousCommitMessage.substring(sha1Offset,endOfChangeId));
    }
 catch (    IllegalArgumentException e) {
      originalChangeId=null;
    }
  }
 else   originalChangeId=null;
}

Fixed version (ground truth):
private void saveOriginalChangeId(){
  int changeIdOffset=findOffsetOfChangeIdLine(previousCommitMessage);
  if (changeIdOffset > 0) {
    int endOfChangeId=findNextEOL(changeIdOffset,previousCommitMessage);
    if (endOfChangeId < 0)     endOfChangeId=previousCommitMessage.length() - 1;
    int sha1Offset=changeIdOffset + "String_Node_Str".length();
    try {
      originalChangeId=ObjectId.fromString(previousCommitMessage.substring(sha1Offset,endOfChangeId));
    }
 catch (    IllegalArgumentException e) {
      originalChangeId=null;
    }
  }
 else   originalChangeId=null;
}
Program: 91535
Project: 91535
Buggy source:
@Test public void testTagDialogShowExistingTags() throws Exception {
  SWTBotShell tagDialog=openTagDialog();
  int index=tagDialog.bot().tableWithLabel(UIText.CreateTagDialog_existingTags).indexOf("String_Node_Str");
  assertTrue("String_Node_Str",index >= 0);
}

Fixed version (ground truth):
@Test public void testTagDialogShowExistingTags() throws Exception {
  SWTBotShell tagDialog=openTagDialog();
  SWTBotTable table=tagDialog.bot().tableWithLabel(UIText.CreateTagDialog_existingTags);
  TestUtil.waitUntilTableHasRowWithText(tagDialog.bot(),table,"String_Node_Str",10000);
}