nus-yam/ex-repair huggingface dataset:
Program: 7715
Project: 7715
Buggy source:
@Test public void testCheckOut() throws Exception {
  Repository repo=lookupRepository(repoFile);
  assertEquals(Constants.MASTER,repo.getBranch());
  final SWTBotTable table=getHistoryViewTable(PROJ1);
  table.getTableItem(1).select();
  final RevCommit[] commit=new RevCommit[1];
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      TableItem tableItem=table.widget.getSelection()[0];
      ensureTableItemLoaded(tableItem);
      commit[0]=(RevCommit)tableItem.getData();
    }
  }
);
  ContextMenuHelper.clickContextMenu(table,UIText.GitHistoryPage_CheckoutMenuLabel);
  TestUtil.joinJobs(JobFamilies.CHECKOUT);
  assertEquals(commit[0].getId().name(),repo.getBranch());
}

Fixed version (ground truth):
@Test public void testCheckOut() throws Exception {
  Repository repo=lookupRepository(repoFile);
  assertEquals(Constants.MASTER,repo.getBranch());
  final SWTBotTable table=getHistoryViewTable(PROJ1);
  final RevCommit[] commit=checkoutLine(table,1);
  assertEquals(commit[0].getId().name(),repo.getBranch());
}
Program: 7716
Project: 7716
Buggy source:
void initAndStartRevWalk(boolean forceNewWalk) throws IllegalStateException {
  try {
    if (trace)     GitTraceLocation.getTrace().traceEntry(GitTraceLocation.HISTORYVIEW.getLocation());
    cancelRefreshJob();
    Repository db=input.getRepository();
    AnyObjectId headId=resolveHead(db,false);
    List<String> paths=buildFilterPaths(input.getItems(),input.getFileList(),db);
    boolean pathChange=pathChange(pathFilters,paths);
    boolean headChange=!headId.equals(currentHeadId);
    boolean repoChange=false;
    if (!db.equals(currentRepo)) {
      repoChange=true;
      currentRepo=db;
    }
    if (forceNewWalk || pathChange || currentWalk == null || headChange || repoChange) {
      createNewWalk(db,headId);
      setWalkStartPoints(db,headId);
      setupFileViewer(db,paths);
      setupCommentViewer(db);
      scheduleNewGenerateHistoryJob();
    }
 else     graph.setHistoryPageInput(input);
  }
  finally {
    if (trace)     GitTraceLocation.getTrace().traceExit(GitTraceLocation.HISTORYVIEW.getLocation());
  }
}

Fixed version (ground truth):
void initAndStartRevWalk(boolean forceNewWalk) throws IllegalStateException {
  try {
    if (trace)     GitTraceLocation.getTrace().traceEntry(GitTraceLocation.HISTORYVIEW.getLocation());
    cancelRefreshJob();
    Repository db=input.getRepository();
    AnyObjectId headId=resolveHead(db,false);
    List<String> paths=buildFilterPaths(input.getItems(),input.getFileList(),db);
    if (forceNewWalk || shouldRedraw(db,headId,paths)) {
      createNewWalk(db,headId);
      setWalkStartPoints(db,headId);
      setupFileViewer(db,paths);
      setupCommentViewer(db);
      scheduleNewGenerateHistoryJob();
    }
 else     graph.setHistoryPageInput(input);
  }
  finally {
    if (trace)     GitTraceLocation.getTrace().traceExit(GitTraceLocation.HISTORYVIEW.getLocation());
  }
}
Program: 7718
Project: 7718
Buggy source:
/** 
 * Executes this directly, without showing a confirmation dialog
 * @param monitor
 * @return the result of the operation
 * @throws CoreException
 */
public PushOperationResult execute(IProgressMonitor monitor) throws CoreException {
  if (spec == null) {
    spec=new PushOperationSpecification();
    List<URIish> urisToPush=new ArrayList<URIish>();
    for (    URIish uri : config.getPushURIs())     urisToPush.add(uri);
    if (urisToPush.isEmpty() && !config.getURIs().isEmpty())     urisToPush.add(config.getURIs().get(0));
    List<RefSpec> pushRefSpecs=new ArrayList<RefSpec>();
    pushRefSpecs.addAll(config.getPushRefSpecs());
    if (pushRefSpecs.isEmpty())     pushRefSpecs.add(DEFAULT_PUSH_REF_SPEC);
    for (    URIish uri : urisToPush) {
      try {
        spec.addURIRefUpdates(uri,Transport.open(repository,uri).findRemoteRefUpdatesFor(pushRefSpecs));
      }
 catch (      NotSupportedException e) {
        throw new CoreException(Activator.createErrorStatus(e.getCause().getMessage(),e.getCause()));
      }
catch (      IOException e) {
        throw new CoreException(Activator.createErrorStatus(e.getCause().getMessage(),e.getCause()));
      }
    }
  }
  op=new PushOperation(repository,spec,dryRun,timeout);
  if (credentialsProvider != null)   op.setCredentialsProvider(credentialsProvider);
  try {
    op.run(monitor);
    return op.getOperationResult();
  }
 catch (  InvocationTargetException e) {
    throw new CoreException(Activator.createErrorStatus(e.getCause().getMessage(),e.getCause()));
  }
}

Fixed version (ground truth):
/** 
 * Executes this directly, without showing a confirmation dialog
 * @param monitor
 * @return the result of the operation
 * @throws CoreException
 */
public PushOperationResult execute(IProgressMonitor monitor) throws CoreException {
  if (spec == null) {
    spec=new PushOperationSpecification();
    List<URIish> urisToPush=new ArrayList<URIish>();
    for (    URIish uri : config.getPushURIs())     urisToPush.add(uri);
    if (urisToPush.isEmpty() && !config.getURIs().isEmpty())     urisToPush.add(config.getURIs().get(0));
    List<RefSpec> pushRefSpecs=new ArrayList<RefSpec>();
    pushRefSpecs.addAll(config.getPushRefSpecs());
    if (pushRefSpecs.isEmpty())     pushRefSpecs.add(DEFAULT_PUSH_REF_SPEC);
    for (    URIish uri : urisToPush) {
      try {
        spec.addURIRefUpdates(uri,Transport.open(repository,uri).findRemoteRefUpdatesFor(pushRefSpecs));
      }
 catch (      NotSupportedException e) {
        throw new CoreException(Activator.createErrorStatus(e.getMessage(),e));
      }
catch (      IOException e) {
        throw new CoreException(Activator.createErrorStatus(e.getMessage(),e));
      }
    }
  }
  op=new PushOperation(repository,spec,dryRun,timeout);
  if (credentialsProvider != null)   op.setCredentialsProvider(credentialsProvider);
  try {
    op.run(monitor);
    return op.getOperationResult();
  }
 catch (  InvocationTargetException e) {
    throw new CoreException(Activator.createErrorStatus(e.getCause().getMessage(),e.getCause()));
  }
}
Program: 7719
Project: 7719
Buggy source:
/** 
 * Executes this directly, without showing a confirmation dialog
 * @param monitor
 * @return the result of the operation
 * @throws CoreException
 */
public PushOperationResult execute(IProgressMonitor monitor) throws CoreException {
  if (spec == null) {
    spec=new PushOperationSpecification();
    List<URIish> urisToPush=new ArrayList<URIish>();
    for (    URIish uri : config.getPushURIs())     urisToPush.add(uri);
    if (urisToPush.isEmpty() && !config.getURIs().isEmpty())     urisToPush.add(config.getURIs().get(0));
    List<RefSpec> pushRefSpecs=new ArrayList<RefSpec>();
    pushRefSpecs.addAll(config.getPushRefSpecs());
    if (pushRefSpecs.isEmpty())     pushRefSpecs.add(DEFAULT_PUSH_REF_SPEC);
    for (    URIish uri : urisToPush) {
      try {
        spec.addURIRefUpdates(uri,Transport.open(repository,uri).findRemoteRefUpdatesFor(pushRefSpecs));
      }
 catch (      NotSupportedException e) {
        throw new CoreException(Activator.createErrorStatus(e.getCause().getMessage(),e.getCause()));
      }
catch (      IOException e) {
        throw new CoreException(Activator.createErrorStatus(e.getCause().getMessage(),e.getCause()));
      }
    }
  }
  op=new PushOperation(repository,spec,dryRun,timeout);
  if (credentialsProvider != null)   op.setCredentialsProvider(credentialsProvider);
  try {
    op.run(monitor);
    return op.getOperationResult();
  }
 catch (  InvocationTargetException e) {
    throw new CoreException(Activator.createErrorStatus(e.getCause().getMessage(),e.getCause()));
  }
}

Fixed version (ground truth):
/** 
 * Executes this directly, without showing a confirmation dialog
 * @param monitor
 * @return the result of the operation
 * @throws CoreException
 */
public PushOperationResult execute(IProgressMonitor monitor) throws CoreException {
  if (spec == null) {
    spec=new PushOperationSpecification();
    List<URIish> urisToPush=new ArrayList<URIish>();
    for (    URIish uri : config.getPushURIs())     urisToPush.add(uri);
    if (urisToPush.isEmpty() && !config.getURIs().isEmpty())     urisToPush.add(config.getURIs().get(0));
    List<RefSpec> pushRefSpecs=new ArrayList<RefSpec>();
    pushRefSpecs.addAll(config.getPushRefSpecs());
    if (pushRefSpecs.isEmpty())     pushRefSpecs.add(DEFAULT_PUSH_REF_SPEC);
    for (    URIish uri : urisToPush) {
      try {
        spec.addURIRefUpdates(uri,Transport.open(repository,uri).findRemoteRefUpdatesFor(pushRefSpecs));
      }
 catch (      NotSupportedException e) {
        throw new CoreException(Activator.createErrorStatus(e.getMessage(),e));
      }
catch (      IOException e) {
        throw new CoreException(Activator.createErrorStatus(e.getMessage(),e));
      }
    }
  }
  op=new PushOperation(repository,spec,dryRun,timeout);
  if (credentialsProvider != null)   op.setCredentialsProvider(credentialsProvider);
  try {
    op.run(monitor);
    return op.getOperationResult();
  }
 catch (  InvocationTargetException e) {
    throw new CoreException(Activator.createErrorStatus(e.getCause().getMessage(),e.getCause()));
  }
}
Program: 7721
Project: 7721
Buggy source:
/** 
 * @param parent
 * @param baseCommit
 * @param fileFactory
 * @throws IOException
 */
protected GitModelCache(GitModelObject parent,RevCommit baseCommit,FileModelFactory fileFactory) throws IOException {
  super(parent,baseCommit,RIGHT);
  this.fileFactory=fileFactory;
  cacheTreeMap=new HashMap<IPath,GitModelCacheTree>();
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param baseCommit
 * @param fileFactory
 * @throws IOException
 */
protected GitModelCache(GitModelObject parent,RevCommit baseCommit,FileModelFactory fileFactory) throws IOException {
  super(parent,baseCommit,RIGHT);
  this.fileFactory=fileFactory;
  cacheTreeMap=new HashMap<String,GitModelCacheTree>();
  location=new Path(getRepository().getWorkTree().toString());
}
Program: 7722
Project: 7722
Buggy source:
@Override public IPath getLocation(){
  return new Path(getRepository().getWorkTree().toString());
}

Fixed version (ground truth):
@Override public IPath getLocation(){
  return location;
}
Program: 7723
Project: 7723
Buggy source:
private GitModelObject extractFromCache(TreeWalk tw) throws IOException {
  DirCacheIterator cacheIterator=tw.getTree(dirCacheIteratorNth,DirCacheIterator.class);
  if (cacheIterator == null)   return null;
  DirCacheEntry cacheEntry=cacheIterator.getDirCacheEntry();
  if (cacheEntry == null)   return null;
  if (shouldIncludeEntry(tw)) {
    IPath path=getLocation().append(tw.getPathString());
    ObjectId repoId=tw.getObjectId(BASE_NTH);
    ObjectId cacheId=tw.getObjectId(REMOTE_NTH);
    if (path.getFileExtension() == null)     return handleCacheTree(repoId,cacheId,path);
    return fileFactory.createFileModel(this,baseCommit,repoId,cacheId,path);
  }
  return null;
}

Fixed version (ground truth):
private GitModelObject extractFromCache(TreeWalk tw) throws IOException {
  DirCacheIterator cacheIterator=tw.getTree(dirCacheIteratorNth,DirCacheIterator.class);
  if (cacheIterator == null)   return null;
  DirCacheEntry cacheEntry=cacheIterator.getDirCacheEntry();
  if (cacheEntry == null)   return null;
  if (shouldIncludeEntry(tw)) {
    String path=tw.getPathString();
    ObjectId repoId=tw.getObjectId(BASE_NTH);
    ObjectId cacheId=tw.getObjectId(REMOTE_NTH);
    if (path.contains("String_Node_Str"))     return handleCacheTree(repoId,cacheId,path);
    return fileFactory.createFileModel(this,baseCommit,repoId,cacheId,getLocation().append(path));
  }
  return null;
}
Program: 7724
Project: 7724
Buggy source:
private GitModelObject handleCacheTree(ObjectId repoId,ObjectId cacheId,IPath path) throws IOException {
  GitModelCacheTree cacheTree=cacheTreeMap.get(path);
  if (cacheTree == null) {
    cacheTree=new GitModelCacheTree(this,baseCommit,repoId,cacheId,path,fileFactory);
    cacheTreeMap.put(path,cacheTree);
  }
  cacheTree.addChild(repoId,cacheId,path);
  return cacheTree;
}

Fixed version (ground truth):
private GitModelObject handleCacheTree(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  int firstSlash=path.indexOf("String_Node_Str");
  String pathKey=path.substring(0,firstSlash);
  GitModelCacheTree cacheTree=cacheTreeMap.get(pathKey);
  if (cacheTree == null) {
    cacheTree=new GitModelCacheTree(this,baseCommit,repoId,cacheId,getLocation().append(pathKey),fileFactory);
    cacheTreeMap.put(pathKey,cacheTree);
  }
  cacheTree.addChild(repoId,cacheId,path.substring(firstSlash + 1));
  return cacheTree;
}
Program: 7725
Project: 7725
Buggy source:
/** 
 * @param parent parent object
 * @param commit last  {@link RevCommit} in repository
 * @param repoId {@link ObjectId} of blob in repository
 * @param cacheId {@link ObjectId} of blob in cache
 * @param location resource location
 * @param factory
 * @throws IOException
 */
public GitModelCacheTree(GitModelObjectContainer parent,RevCommit commit,ObjectId repoId,ObjectId cacheId,IPath location,FileModelFactory factory) throws IOException {
  super(parent,commit,null,repoId,repoId,cacheId,location);
  this.factory=factory;
  cacheTreeMap=new HashMap<IPath,GitModelObject>();
}

Fixed version (ground truth):
/** 
 * @param parent parent object
 * @param commit last  {@link RevCommit} in repository
 * @param repoId {@link ObjectId} of blob in repository
 * @param cacheId {@link ObjectId} of blob in cache
 * @param location resource location
 * @param factory
 * @throws IOException
 */
public GitModelCacheTree(GitModelObjectContainer parent,RevCommit commit,ObjectId repoId,ObjectId cacheId,IPath location,FileModelFactory factory) throws IOException {
  super(parent,commit,null,repoId,repoId,cacheId,location);
  this.factory=factory;
  cacheTreeMap=new HashMap<String,GitModelObject>();
}
Program: 7726
Project: 7726
Buggy source:
void addChild(ObjectId repoId,ObjectId cacheId,IPath path) throws IOException {
  if (path.getFileExtension() == null) {
    GitModelCacheTree cacheEntry=(GitModelCacheTree)cacheTreeMap.get(path);
    if (cacheEntry == null) {
      cacheEntry=new GitModelCacheTree(this,baseCommit,repoId,cacheId,path,factory);
      cacheTreeMap.put(path,cacheEntry);
    }
    cacheEntry.addChild(repoId,cacheId,path);
  }
 else   cacheTreeMap.put(path,factory.createFileModel(this,baseCommit,repoId,cacheId,path));
}

Fixed version (ground truth):
void addChild(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String pathKey;
  int firstSlash=path.indexOf("String_Node_Str");
  if (firstSlash > -1)   pathKey=path.substring(0,firstSlash);
 else   pathKey=path;
  IPath fullPath=getLocation().append(pathKey);
  if (path.contains("String_Node_Str")) {
    GitModelCacheTree cacheEntry=(GitModelCacheTree)cacheTreeMap.get(pathKey);
    if (cacheEntry == null) {
      cacheEntry=new GitModelCacheTree(this,baseCommit,repoId,cacheId,fullPath,factory);
      cacheTreeMap.put(pathKey,cacheEntry);
    }
    cacheEntry.addChild(repoId,cacheId,path.substring(firstSlash + 1));
  }
 else   cacheTreeMap.put(pathKey,factory.createFileModel(this,baseCommit,repoId,cacheId,fullPath));
}
Program: 7727
Project: 7727
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: 7728
Project: 7728
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: 7729
Project: 7729
Buggy source:
private void createCompareInput(){
  if (compareInput == null) {
    ComparisonDataSource baseData=new ComparisonDataSource(baseCommit,baseId);
    ComparisonDataSource remoteData=new ComparisonDataSource(remoteCommit,remoteId);
    ComparisonDataSource ancestorData=new ComparisonDataSource(getAncestorCommit(),ancestorId);
    compareInput=getCompareInput(baseData,remoteData,ancestorData);
  }
}

Fixed version (ground truth):
private void createCompareInput(){
  if (compareInput == null) {
    ComparisonDataSource baseData=new ComparisonDataSource(baseCommit,baseId);
    ComparisonDataSource remoteData=new ComparisonDataSource(remoteCommit,remoteId);
    ComparisonDataSource ancestorData=new ComparisonDataSource(ancestorCommit,ancestorId);
    compareInput=getCompareInput(baseData,remoteData,ancestorData);
  }
}
Program: 7730
Project: 7730
Buggy source:
/** 
 * @param parent parent of this object
 * @param commit remote commit
 * @param ancestorId common ancestor id
 * @param baseId id of base object variant
 * @param remoteId id of remote object variants
 * @param name human readable blob name (file name)
 * @throws IOException
 */
public GitModelBlob(GitModelObjectContainer parent,RevCommit commit,ObjectId ancestorId,ObjectId baseId,ObjectId remoteId,String name) throws IOException {
  super(parent,commit,parent.getKind() & (LEFT | RIGHT));
  this.name=name;
  this.baseId=baseId;
  this.remoteId=remoteId;
  this.ancestorId=ancestorId;
  location=getParent().getLocation().append(name);
  gitPath=Repository.stripWorkDir(getRepository().getWorkTree(),getLocation().toFile());
}

Fixed version (ground truth):
/** 
 * @param parent parent of this object
 * @param commit remote commit
 * @param ancestorCommit TODO
 * @param ancestorId common ancestor id
 * @param baseId id of base object variant
 * @param remoteId id of remote object variants
 * @param name human readable blob name (file name)
 * @throws IOException
 */
public GitModelBlob(GitModelObjectContainer parent,RevCommit commit,RevCommit ancestorCommit,ObjectId ancestorId,ObjectId baseId,ObjectId remoteId,String name) throws IOException {
  super(parent,commit,ancestorCommit,parent.getKind() & (LEFT | RIGHT));
  this.name=name;
  this.baseId=baseId;
  this.remoteId=remoteId;
  this.ancestorId=ancestorId;
  location=getParent().getLocation().append(name);
  gitPath=Repository.stripWorkDir(getRepository().getWorkTree(),getLocation().toFile());
}
Program: 7731
Project: 7731
Buggy source:
public GitModelCacheFile(GitModelObjectContainer parent,RevCommit commit,ObjectId repoId,ObjectId cacheId,String name) throws IOException {
  super(parent,commit,repoId,repoId,cacheId,name);
}

Fixed version (ground truth):
public GitModelCacheFile(GitModelObjectContainer parent,RevCommit commit,ObjectId repoId,ObjectId cacheId,String name) throws IOException {
  super(parent,commit,null,repoId,repoId,cacheId,name);
}
Program: 7732
Project: 7732
Buggy source:
/** 
 * @param parent parent object
 * @param commit last  {@link RevCommit} in repository
 * @param repoId {@link ObjectId} of blob in repository
 * @param cacheId {@link ObjectId} of blob in cache
 * @param name name of tree
 * @param factory
 * @throws IOException
 */
public GitModelCacheTree(GitModelObjectContainer parent,RevCommit commit,ObjectId repoId,ObjectId cacheId,String name,FileModelFactory factory) throws IOException {
  super(parent,commit,repoId,repoId,cacheId,name);
  this.factory=factory;
  cacheTreeMap=new HashMap<String,GitModelObject>();
}

Fixed version (ground truth):
/** 
 * @param parent parent object
 * @param commit last  {@link RevCommit} in repository
 * @param repoId {@link ObjectId} of blob in repository
 * @param cacheId {@link ObjectId} of blob in cache
 * @param name name of tree
 * @param factory
 * @throws IOException
 */
public GitModelCacheTree(GitModelObjectContainer parent,RevCommit commit,ObjectId repoId,ObjectId cacheId,String name,FileModelFactory factory) throws IOException {
  super(parent,commit,null,repoId,repoId,cacheId,name);
  this.factory=factory;
  cacheTreeMap=new HashMap<String,GitModelObject>();
}
Program: 7733
Project: 7733
Buggy source:
/** 
 * Constructor for child classes.
 * @param parent instance of repository model object that is parent for this commit
 * @param commit instance of commit that will be associated with this model object
 * @param direction use  {@link Differencer#LEFT} and {@link Differencer#RIGHT} todeterminate commit direction (is it incoming or outgoing)
 * @throws IOException
 */
protected GitModelCommit(GitModelObject parent,RevCommit commit,int direction) throws IOException {
  super(parent,commit,direction);
}

Fixed version (ground truth):
/** 
 * Constructor for child classes.
 * @param parent instance of repository model object that is parent for this commit
 * @param commit instance of commit that will be associated with this model object
 * @param ancestorCommit common ancestor commit for object that is wrapped
 * @param direction use  {@link Differencer#LEFT} and {@link Differencer#RIGHT} todeterminate commit direction (is it incoming or outgoing)
 * @throws IOException
 */
protected GitModelCommit(GitModelObject parent,RevCommit commit,RevCommit ancestorCommit,int direction) throws IOException {
  super(parent,commit,direction);
  this.ancestorCommit=ancestorCommit;
}
Program: 7734
Project: 7734
Buggy source:
@Override protected GitModelObject[] getChildrenImpl(){
  TreeWalk tw=createTreeWalk();
  List<GitModelObject> result=new ArrayList<GitModelObject>();
  try {
    RevTree actualTree=baseCommit.getTree();
    int actualNth=tw.addTree(actualTree);
    int baseNth=-1;
    if (remoteCommit != null)     baseNth=tw.addTree(remoteCommit.getTree());
    int ancestorNth=tw.addTree(ancestorCommit.getTree());
    while (tw.next()) {
      GitModelObject obj=getModelObject(tw,ancestorNth,baseNth,actualNth);
      if (obj != null)       result.add(obj);
    }
  }
 catch (  IOException e) {
    Activator.logError(e.getMessage(),e);
  }
  return result.toArray(new GitModelObject[result.size()]);
}

Fixed version (ground truth):
@Override protected GitModelObject[] getChildrenImpl(){
  TreeWalk tw=createTreeWalk();
  List<GitModelObject> result=new ArrayList<GitModelObject>();
  try {
    RevTree actualTree=baseCommit.getTree();
    int actualNth=tw.addTree(actualTree);
    int baseNth=-1;
    if (remoteCommit != null)     baseNth=tw.addTree(remoteCommit.getTree());
    int ancestorNth=tw.addTree(ancestorCommit.getTree());
    while (tw.next()) {
      GitModelObject obj=getModelObject(tw,ancestorCommit,ancestorNth,baseNth,actualNth);
      if (obj != null)       result.add(obj);
    }
  }
 catch (  IOException e) {
    Activator.logError(e.getMessage(),e);
  }
  return result.toArray(new GitModelObject[result.size()]);
}
Program: 7735
Project: 7735
Buggy source:
/** 
 * @param tw instance of {@link TreeWalk} that should be used
 * @param ancestorNth
 * @param baseNth
 * @param actualNth
 * @return {@link GitModelObject} instance of given parameters
 * @throws IOException
 */
protected GitModelObject getModelObject(TreeWalk tw,int ancestorNth,int baseNth,int actualNth) throws IOException {
  String objName=tw.getNameString();
  ObjectId objBaseId;
  if (baseNth > -1)   objBaseId=tw.getObjectId(baseNth);
 else   objBaseId=ObjectId.zeroId();
  ObjectId objRemoteId=tw.getObjectId(actualNth);
  ObjectId objAncestorId;
  if (ancestorNth > -1)   objAncestorId=tw.getObjectId(ancestorNth);
 else   objAncestorId=ObjectId.zeroId();
  int objectType=tw.getFileMode(actualNth).getObjectType();
  if (objectType == Constants.OBJ_BLOB)   return new GitModelBlob(this,getBaseCommit(),objAncestorId,objBaseId,objRemoteId,objName);
 else   if (objectType == Constants.OBJ_TREE)   return new GitModelTree(this,getBaseCommit(),objAncestorId,objBaseId,objRemoteId,objName);
  return null;
}

Fixed version (ground truth):
/** 
 * @param tw instance of {@link TreeWalk} that should be used
 * @param ancestorCommit TODO
 * @param ancestorNth
 * @param baseNth
 * @param actualNth
 * @return {@link GitModelObject} instance of given parameters
 * @throws IOException
 */
protected GitModelObject getModelObject(TreeWalk tw,RevCommit ancestorCommit,int ancestorNth,int baseNth,int actualNth) throws IOException {
  String objName=tw.getNameString();
  ObjectId objBaseId;
  if (baseNth > -1)   objBaseId=tw.getObjectId(baseNth);
 else   objBaseId=ObjectId.zeroId();
  ObjectId objRemoteId=tw.getObjectId(actualNth);
  ObjectId objAncestorId;
  if (ancestorNth > -1)   objAncestorId=tw.getObjectId(ancestorNth);
 else   objAncestorId=ObjectId.zeroId();
  int objectType=tw.getFileMode(actualNth).getObjectType();
  if (objectType == Constants.OBJ_BLOB)   return new GitModelBlob(this,getBaseCommit(),ancestorCommit,objAncestorId,objBaseId,objRemoteId,objName);
 else   if (objectType == Constants.OBJ_TREE)   return new GitModelTree(this,getBaseCommit(),ancestorCommit,objAncestorId,objBaseId,objRemoteId,objName);
  return null;
}
Program: 7736
Project: 7736
Buggy source:
/** 
 * @param parent parent of this tree
 * @param commit commit associated with this tree
 * @param ancestorId id of common ancestor tree for this on
 * @param baseId id of base tree
 * @param remoteId this tree id
 * @param name name resource associated with this tree
 * @throws IOException
 */
public GitModelTree(GitModelObjectContainer parent,RevCommit commit,ObjectId ancestorId,ObjectId baseId,ObjectId remoteId,String name) throws IOException {
  super(parent,commit,parent.getKind() & (LEFT | RIGHT));
  this.name=name;
  this.baseId=baseId;
  this.remoteId=remoteId;
  this.ancestorId=ancestorId;
}

Fixed version (ground truth):
/** 
 * @param parent parent of this tree
 * @param commit commit associated with this tree
 * @param ancestorCommit common ancestor commit associated with this tree
 * @param ancestorId id of common ancestor tree for this on
 * @param baseId id of base tree
 * @param remoteId this tree id
 * @param name name resource associated with this tree
 * @throws IOException
 */
public GitModelTree(GitModelObjectContainer parent,RevCommit commit,RevCommit ancestorCommit,ObjectId ancestorId,ObjectId baseId,ObjectId remoteId,String name) throws IOException {
  super(parent,commit,ancestorCommit,parent.getKind() & (LEFT | RIGHT));
  this.name=name;
  this.baseId=baseId;
  this.remoteId=remoteId;
  this.ancestorId=ancestorId;
}
Program: 7737
Project: 7737
Buggy source:
protected GitModelObject[] getChildrenImpl(){
  TreeWalk tw=createTreeWalk();
  List<GitModelObject> result=new ArrayList<GitModelObject>();
  try {
    int remoteNth=tw.addTree(remoteId);
    int baseNth=-1;
    if (!baseId.equals(zeroId()))     baseNth=tw.addTree(baseId);
    int ancestorNth=-1;
    if (!ancestorId.equals(zeroId()))     ancestorNth=tw.addTree(ancestorId);
    while (tw.next()) {
      GitModelObject obj=getModelObject(tw,ancestorNth,baseNth,remoteNth);
      if (obj != null)       result.add(obj);
    }
  }
 catch (  IOException e) {
    Activator.logError(e.getMessage(),e);
  }
  return result.toArray(new GitModelObject[result.size()]);
}

Fixed version (ground truth):
protected GitModelObject[] getChildrenImpl(){
  TreeWalk tw=createTreeWalk();
  List<GitModelObject> result=new ArrayList<GitModelObject>();
  try {
    int remoteNth=tw.addTree(remoteId);
    int baseNth=-1;
    if (!baseId.equals(zeroId()))     baseNth=tw.addTree(baseId);
    int ancestorNth=-1;
    if (!ancestorId.equals(zeroId()))     ancestorNth=tw.addTree(ancestorId);
    while (tw.next()) {
      GitModelObject obj=getModelObject(tw,ancestorCommit,ancestorNth,baseNth,remoteNth);
      if (obj != null)       result.add(obj);
    }
  }
 catch (  IOException e) {
    Activator.logError(e.getMessage(),e);
  }
  return result.toArray(new GitModelObject[result.size()]);
}
Program: 7738
Project: 7738
Buggy source:
public GitModelWorkingFile(GitModelObjectContainer parent,RevCommit commit,ObjectId repoId,String name) throws IOException {
  super(parent,commit,repoId,repoId,null,name);
}

Fixed version (ground truth):
public GitModelWorkingFile(GitModelObjectContainer parent,RevCommit commit,ObjectId repoId,String name) throws IOException {
  super(parent,commit,null,repoId,repoId,null,name);
}
Program: 7741
Project: 7741
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: 7742
Project: 7742
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: 7743
Project: 7743
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: 7744
Project: 7744
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: 7745
Project: 7745
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: 7746
Project: 7746
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: 7747
Project: 7747
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: 7748
Project: 7748
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: 7750
Project: 7750
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: 7751
Project: 7751
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: 7752
Project: 7752
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: 7753
Project: 7753
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);
}