nus-yam/ex-repair huggingface dataset:
Program: 7754
Project: 7754
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: 7756
Project: 7756
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: 7757
Project: 7757
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: 7762
Project: 7762
Buggy source:
/** 
 * Check internal state for page completion status.
 */
private void checkPage(){
  final String dstpath=directoryText.getText();
  if (dstpath.length() == 0) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_fieldRequired,UIText.CloneDestinationPage_promptDirectory));
    setPageComplete(false);
    return;
  }
  final File absoluteFile=new File(dstpath).getAbsoluteFile();
  if (!isEmptyDir(absoluteFile)) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_errorNotEmptyDir,absoluteFile.getPath()));
    setPageComplete(false);
    return;
  }
  if (!canCreateSubdir(absoluteFile.getParentFile())) {
    setErrorMessage(NLS.bind(UIText.GitCloneWizard_errorCannotCreate,absoluteFile.getPath()));
    setPageComplete(false);
    return;
  }
  if (!availableRefs.isEmpty() && initialBranch.getSelectionIndex() < 0) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_fieldRequired,UIText.CloneDestinationPage_promptInitialBranch));
    setPageComplete(false);
    return;
  }
  if (remoteText.getText().length() == 0) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_fieldRequired,UIText.CloneDestinationPage_promptRemoteName));
    setPageComplete(false);
    return;
  }
  setErrorMessage(null);
  setPageComplete(true);
}

Fixed version (ground truth):
/** 
 * Check internal state for page completion status.
 */
private void checkPage(){
  final String dstpath=directoryText.getText();
  if (dstpath.length() == 0) {
    setErrorMessage(UIText.CloneDestinationPage_errorDirectoryRequired);
    setPageComplete(false);
    return;
  }
  final File absoluteFile=new File(dstpath).getAbsoluteFile();
  if (!isEmptyDir(absoluteFile)) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_errorNotEmptyDir,absoluteFile.getPath()));
    setPageComplete(false);
    return;
  }
  if (!canCreateSubdir(absoluteFile.getParentFile())) {
    setErrorMessage(NLS.bind(UIText.GitCloneWizard_errorCannotCreate,absoluteFile.getPath()));
    setPageComplete(false);
    return;
  }
  if (!availableRefs.isEmpty() && initialBranch.getSelectionIndex() < 0) {
    setErrorMessage(UIText.CloneDestinationPage_errorInitialBranchRequired);
    setPageComplete(false);
    return;
  }
  if (remoteText.getText().length() == 0) {
    setErrorMessage(UIText.CloneDestinationPage_errorRemoteNameRequired);
    setPageComplete(false);
    return;
  }
  setErrorMessage(null);
  setPageComplete(true);
}
Program: 7763
Project: 7763
Buggy source:
/** 
 * Check internal state for page completion status.
 */
private void checkPage(){
  final String dstpath=directoryText.getText();
  if (dstpath.length() == 0) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_fieldRequired,UIText.CloneDestinationPage_promptDirectory));
    setPageComplete(false);
    return;
  }
  final File absoluteFile=new File(dstpath).getAbsoluteFile();
  if (!isEmptyDir(absoluteFile)) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_errorNotEmptyDir,absoluteFile.getPath()));
    setPageComplete(false);
    return;
  }
  if (!canCreateSubdir(absoluteFile.getParentFile())) {
    setErrorMessage(NLS.bind(UIText.GitCloneWizard_errorCannotCreate,absoluteFile.getPath()));
    setPageComplete(false);
    return;
  }
  if (!availableRefs.isEmpty() && initialBranch.getSelectionIndex() < 0) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_fieldRequired,UIText.CloneDestinationPage_promptInitialBranch));
    setPageComplete(false);
    return;
  }
  if (remoteText.getText().length() == 0) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_fieldRequired,UIText.CloneDestinationPage_promptRemoteName));
    setPageComplete(false);
    return;
  }
  setErrorMessage(null);
  setPageComplete(true);
}

Fixed version (ground truth):
/** 
 * Check internal state for page completion status.
 */
private void checkPage(){
  final String dstpath=directoryText.getText();
  if (dstpath.length() == 0) {
    setErrorMessage(UIText.CloneDestinationPage_errorDirectoryRequired);
    setPageComplete(false);
    return;
  }
  final File absoluteFile=new File(dstpath).getAbsoluteFile();
  if (!isEmptyDir(absoluteFile)) {
    setErrorMessage(NLS.bind(UIText.CloneDestinationPage_errorNotEmptyDir,absoluteFile.getPath()));
    setPageComplete(false);
    return;
  }
  if (!canCreateSubdir(absoluteFile.getParentFile())) {
    setErrorMessage(NLS.bind(UIText.GitCloneWizard_errorCannotCreate,absoluteFile.getPath()));
    setPageComplete(false);
    return;
  }
  if (!availableRefs.isEmpty() && initialBranch.getSelectionIndex() < 0) {
    setErrorMessage(UIText.CloneDestinationPage_errorInitialBranchRequired);
    setPageComplete(false);
    return;
  }
  if (remoteText.getText().length() == 0) {
    setErrorMessage(UIText.CloneDestinationPage_errorRemoteNameRequired);
    setPageComplete(false);
    return;
  }
  setErrorMessage(null);
  setPageComplete(true);
}
Program: 7764
Project: 7764
Buggy source:
public final void selectionChanged(IAction action,ISelection selection){
  mySelection=selection;
  handler.setSelection(mySelection);
  action.setEnabled(isEnabled());
}

Fixed version (ground truth):
public final void selectionChanged(IAction action,ISelection selection){
  mySelection=selection;
  handler.setSelection(mySelection);
  if (action != null)   action.setEnabled(isEnabled());
}
Program: 7765
Project: 7765
Buggy source:
public final void selectionChanged(IAction action,ISelection selection){
  mySelection=selection;
  handler.setSelection(mySelection);
  action.setEnabled(isEnabled());
}

Fixed version (ground truth):
public final void selectionChanged(IAction action,ISelection selection){
  mySelection=selection;
  handler.setSelection(mySelection);
  if (action != null)   action.setEnabled(isEnabled());
}
Program: 7766
Project: 7766
Buggy source:
public ITypedElement getRight(){
  return CompareUtils.getFileRevisionTypedElement(gitPath,baseCommit,repo,baseId);
}

Fixed version (ground truth):
public ITypedElement getRight(){
  return CompareUtils.getFileRevisionTypedElement(gitPath,remoteCommit,repo,baseId);
}
Program: 7767
Project: 7767
Buggy source:
public ITypedElement getLeft(){
  return CompareUtils.getFileRevisionTypedElement(gitPath,remoteCommit,repo,remoteId);
}

Fixed version (ground truth):
public ITypedElement getLeft(){
  return CompareUtils.getFileRevisionTypedElement(gitPath,baseCommit,repo,remoteId);
}
Program: 7768
Project: 7768
Buggy source:
private String getAbbreviatedId(GitModelCommit commit){
  RevCommit remoteCommit=commit.getRemoteCommit();
  ObjectReader reader=commit.getRepository().newObjectReader();
  ObjectId commitId=remoteCommit.getId();
  AbbreviatedObjectId shortId;
  try {
    shortId=reader.abbreviate(commitId,6);
  }
 catch (  IOException e) {
    shortId=AbbreviatedObjectId.fromObjectId(ObjectId.zeroId());
    Activator.logError(e.getMessage(),e);
  }
 finally {
    reader.release();
  }
  return shortId.name();
}

Fixed version (ground truth):
private String getAbbreviatedId(GitModelCommit commit){
  RevCommit remoteCommit=commit.getBaseCommit();
  ObjectReader reader=commit.getRepository().newObjectReader();
  ObjectId commitId=remoteCommit.getId();
  AbbreviatedObjectId shortId;
  try {
    shortId=reader.abbreviate(commitId,6);
  }
 catch (  IOException e) {
    shortId=AbbreviatedObjectId.fromObjectId(ObjectId.zeroId());
    Activator.logError(e.getMessage(),e);
  }
 finally {
    reader.release();
  }
  return shortId.name();
}
Program: 7769
Project: 7769
Buggy source:
@Override public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof GitModelWorkingTree)   return -1;
  if (e2 instanceof GitModelWorkingTree)   return 1;
  if (e1 instanceof GitModelCache)   return -2;
  if (e2 instanceof GitModelCache)   return 2;
  if (e1 instanceof GitModelCommit && e2 instanceof GitModelCommit) {
    RevCommit rc1=((GitModelCommit)e1).getRemoteCommit();
    RevCommit rc2=((GitModelCommit)e2).getRemoteCommit();
    return rc2.getCommitTime() - rc1.getCommitTime();
  }
  return super.compare(viewer,e1,e2);
}

Fixed version (ground truth):
@Override public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof GitModelWorkingTree)   return -1;
  if (e2 instanceof GitModelWorkingTree)   return 1;
  if (e1 instanceof GitModelCache)   return -2;
  if (e2 instanceof GitModelCache)   return 2;
  if (e1 instanceof GitModelCommit && e2 instanceof GitModelCommit) {
    RevCommit rc1=((GitModelCommit)e1).getBaseCommit();
    RevCommit rc2=((GitModelCommit)e2).getBaseCommit();
    return rc2.getCommitTime() - rc1.getCommitTime();
  }
  return super.compare(viewer,e1,e2);
}
Program: 7770
Project: 7770
Buggy source:
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context,IProgressMonitor monitor) throws CoreException {
  Repository repo=gitRepo.getRepository();
  List<ResourceTraversal> result=new ArrayList<ResourceTraversal>();
  for (  GitModelObject obj : gitRepo.getChildren())   if (obj instanceof GitModelCommit || obj instanceof GitModelCache) {
    RevCommit revCommit;
    if (obj instanceof GitModelCommit)     revCommit=((GitModelCommit)obj).getRemoteCommit();
 else     revCommit=((GitModelCache)obj).getRemoteCommit();
    result.add(new GitTreeTraversal(repo,revCommit));
  }
  return result.toArray(new ResourceTraversal[result.size()]);
}

Fixed version (ground truth):
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context,IProgressMonitor monitor) throws CoreException {
  Repository repo=gitRepo.getRepository();
  List<ResourceTraversal> result=new ArrayList<ResourceTraversal>();
  for (  GitModelObject obj : gitRepo.getChildren())   if (obj instanceof GitModelCommit || obj instanceof GitModelCache) {
    RevCommit revCommit;
    if (obj instanceof GitModelCommit)     revCommit=((GitModelCommit)obj).getBaseCommit();
 else     revCommit=((GitModelCache)obj).getBaseCommit();
    result.add(new GitTreeTraversal(repo,revCommit));
  }
  return result.toArray(new ResourceTraversal[result.size()]);
}
Program: 7771
Project: 7771
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)) {
    String path=new String(tw.getRawPath());
    ObjectId repoId=tw.getObjectId(BASE_NTH);
    ObjectId cacheId=tw.getObjectId(REMOTE_NTH);
    if (path.split("String_Node_Str").length > 1)     return handleCacheTree(repoId,cacheId,path);
    return fileFactory.createFileModel(this,remoteCommit,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=new String(tw.getRawPath());
    ObjectId repoId=tw.getObjectId(BASE_NTH);
    ObjectId cacheId=tw.getObjectId(REMOTE_NTH);
    if (path.split("String_Node_Str").length > 1)     return handleCacheTree(repoId,cacheId,path);
    return fileFactory.createFileModel(this,baseCommit,repoId,cacheId,path);
  }
  return null;
}
Program: 7772
Project: 7772
Buggy source:
private GitModelObject handleCacheTree(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String pathKey=path.split("String_Node_Str")[0];
  GitModelCacheTree cacheTree=cacheTreeMap.get(pathKey);
  if (cacheTree == null) {
    cacheTree=new GitModelCacheTree(this,remoteCommit,repoId,cacheId,pathKey,fileFactory);
    cacheTreeMap.put(pathKey,cacheTree);
  }
  cacheTree.addChild(repoId,cacheId,path.substring(path.indexOf('/') + 1));
  return cacheTree;
}

Fixed version (ground truth):
private GitModelObject handleCacheTree(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String pathKey=path.split("String_Node_Str")[0];
  GitModelCacheTree cacheTree=cacheTreeMap.get(pathKey);
  if (cacheTree == null) {
    cacheTree=new GitModelCacheTree(this,baseCommit,repoId,cacheId,pathKey,fileFactory);
    cacheTreeMap.put(pathKey,cacheTree);
  }
  cacheTree.addChild(repoId,cacheId,path.substring(path.indexOf('/') + 1));
  return cacheTree;
}
Program: 7773
Project: 7773
Buggy source:
void addChild(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String[] entrys=path.split("String_Node_Str");
  String pathKey=entrys[0];
  if (entrys.length > 1) {
    GitModelCacheTree cacheEntry=(GitModelCacheTree)cacheTreeMap.get(pathKey);
    if (cacheEntry == null) {
      cacheEntry=new GitModelCacheTree(this,remoteCommit,repoId,cacheId,pathKey,factory);
      cacheTreeMap.put(pathKey,cacheEntry);
    }
    cacheEntry.addChild(repoId,cacheId,path.substring(path.indexOf('/') + 1));
  }
 else   cacheTreeMap.put(pathKey,factory.createFileModel(this,remoteCommit,repoId,cacheId,pathKey));
}

Fixed version (ground truth):
void addChild(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String[] entrys=path.split("String_Node_Str");
  String pathKey=entrys[0];
  if (entrys.length > 1) {
    GitModelCacheTree cacheEntry=(GitModelCacheTree)cacheTreeMap.get(pathKey);
    if (cacheEntry == null) {
      cacheEntry=new GitModelCacheTree(this,baseCommit,repoId,cacheId,pathKey,factory);
      cacheTreeMap.put(pathKey,cacheEntry);
    }
    cacheEntry.addChild(repoId,cacheId,path.substring(path.indexOf('/') + 1));
  }
 else   cacheTreeMap.put(pathKey,factory.createFileModel(this,baseCommit,repoId,cacheId,pathKey));
}
Program: 7774
Project: 7774
Buggy source:
@Override public int hashCode(){
  int result=getLocation().hashCode() ^ remoteCommit.hashCode();
  if (baseCommit != null)   result^=baseCommit.hashCode();
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=getLocation().hashCode() ^ baseCommit.hashCode();
  if (remoteCommit != null)   result^=remoteCommit.hashCode();
  return result;
}
Program: 7775
Project: 7775
Buggy source:
@Override protected GitModelObject[] getChildrenImpl(){
  TreeWalk tw=createTreeWalk();
  List<GitModelObject> result=new ArrayList<GitModelObject>();
  try {
    RevTree actualTree=remoteCommit.getTree();
    int actualNth=tw.addTree(actualTree);
    int baseNth=-1;
    if (baseCommit != null)     baseNth=tw.addTree(baseCommit.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,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: 7776
Project: 7776
Buggy source:
@Override public String getName(){
  if (name == null)   name=remoteCommit.getShortMessage();
  return name;
}

Fixed version (ground truth):
@Override public String getName(){
  if (name == null)   name=baseCommit.getShortMessage();
  return name;
}
Program: 7777
Project: 7777
Buggy source:
/** 
 * @param parent instance of parent object
 * @param commit commit connected with this container
 * @param direction indicate change direction
 * @throws IOException
 */
protected GitModelObjectContainer(GitModelObject parent,RevCommit commit,int direction) throws IOException {
  super(parent);
  kind=direction;
  remoteCommit=commit;
  ancestorCommit=calculateAncestor(remoteCommit);
  RevCommit[] parents=remoteCommit.getParents();
  if (parents != null && parents.length > 0)   baseCommit=remoteCommit.getParent(0);
 else {
    baseCommit=null;
  }
}

Fixed version (ground truth):
/** 
 * @param parent instance of parent object
 * @param commit commit connected with this container
 * @param direction indicate change direction
 * @throws IOException
 */
protected GitModelObjectContainer(GitModelObject parent,RevCommit commit,int direction) throws IOException {
  super(parent);
  kind=direction;
  baseCommit=commit;
  ancestorCommit=calculateAncestor(baseCommit);
  RevCommit[] parents=baseCommit.getParents();
  if (parents != null && parents.length > 0)   remoteCommit=baseCommit.getParent(0);
 else {
    remoteCommit=null;
  }
}
Program: 7778
Project: 7778
Buggy source:
private void calculateKind(){
  ObjectId base=baseCommit != null ? baseCommit.getId() : zeroId();
  if (base.equals(zeroId()))   kind=kind | ADDITION;
 else   if (remoteCommit.equals(zeroId()))   kind=kind | DELETION;
 else   kind=kind | CHANGE;
}

Fixed version (ground truth):
private void calculateKind(){
  ObjectId remote=remoteCommit != null ? remoteCommit.getId() : zeroId();
  if (remote.equals(zeroId()))   kind=kind | ADDITION;
 else   if (baseCommit.equals(zeroId()))   kind=kind | DELETION;
 else   kind=kind | CHANGE;
}
Program: 7779
Project: 7779
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=tw.getObjectId(ancestorNth);
  int objectType=tw.getFileMode(actualNth).getObjectType();
  if (objectType == Constants.OBJ_BLOB)   return new GitModelBlob(this,getRemoteCommit(),objAncestorId,objBaseId,objRemoteId,objName);
 else   if (objectType == Constants.OBJ_TREE)   return new GitModelTree(this,getRemoteCommit(),objAncestorId,objBaseId,objRemoteId,objName);
  return null;
}

Fixed version (ground truth):
/** 
 * @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=tw.getObjectId(ancestorNth);
  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;
}
Program: 7782
Project: 7782
Buggy source:
public ITypedElement getRight(){
  return CompareUtils.getFileRevisionTypedElement(gitPath,baseCommit,repo,baseId);
}

Fixed version (ground truth):
public ITypedElement getRight(){
  return CompareUtils.getFileRevisionTypedElement(gitPath,remoteCommit,repo,baseId);
}
Program: 7783
Project: 7783
Buggy source:
public ITypedElement getLeft(){
  return CompareUtils.getFileRevisionTypedElement(gitPath,remoteCommit,repo,remoteId);
}

Fixed version (ground truth):
public ITypedElement getLeft(){
  return CompareUtils.getFileRevisionTypedElement(gitPath,baseCommit,repo,remoteId);
}
Program: 7784
Project: 7784
Buggy source:
private String getAbbreviatedId(GitModelCommit commit){
  RevCommit remoteCommit=commit.getRemoteCommit();
  ObjectReader reader=commit.getRepository().newObjectReader();
  ObjectId commitId=remoteCommit.getId();
  AbbreviatedObjectId shortId;
  try {
    shortId=reader.abbreviate(commitId,6);
  }
 catch (  IOException e) {
    shortId=AbbreviatedObjectId.fromObjectId(ObjectId.zeroId());
    Activator.logError(e.getMessage(),e);
  }
 finally {
    reader.release();
  }
  return shortId.name();
}

Fixed version (ground truth):
private String getAbbreviatedId(GitModelCommit commit){
  RevCommit remoteCommit=commit.getBaseCommit();
  ObjectReader reader=commit.getRepository().newObjectReader();
  ObjectId commitId=remoteCommit.getId();
  AbbreviatedObjectId shortId;
  try {
    shortId=reader.abbreviate(commitId,6);
  }
 catch (  IOException e) {
    shortId=AbbreviatedObjectId.fromObjectId(ObjectId.zeroId());
    Activator.logError(e.getMessage(),e);
  }
 finally {
    reader.release();
  }
  return shortId.name();
}
Program: 7785
Project: 7785
Buggy source:
@Override public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof GitModelWorkingTree)   return -1;
  if (e2 instanceof GitModelWorkingTree)   return 1;
  if (e1 instanceof GitModelCache)   return -2;
  if (e2 instanceof GitModelCache)   return 2;
  if (e1 instanceof GitModelCommit && e2 instanceof GitModelCommit) {
    RevCommit rc1=((GitModelCommit)e1).getRemoteCommit();
    RevCommit rc2=((GitModelCommit)e2).getRemoteCommit();
    return rc2.getCommitTime() - rc1.getCommitTime();
  }
  return super.compare(viewer,e1,e2);
}

Fixed version (ground truth):
@Override public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof GitModelWorkingTree)   return -1;
  if (e2 instanceof GitModelWorkingTree)   return 1;
  if (e1 instanceof GitModelCache)   return -2;
  if (e2 instanceof GitModelCache)   return 2;
  if (e1 instanceof GitModelCommit && e2 instanceof GitModelCommit) {
    RevCommit rc1=((GitModelCommit)e1).getBaseCommit();
    RevCommit rc2=((GitModelCommit)e2).getBaseCommit();
    return rc2.getCommitTime() - rc1.getCommitTime();
  }
  return super.compare(viewer,e1,e2);
}
Program: 7786
Project: 7786
Buggy source:
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context,IProgressMonitor monitor) throws CoreException {
  Repository repo=gitRepo.getRepository();
  List<ResourceTraversal> result=new ArrayList<ResourceTraversal>();
  for (  GitModelObject obj : gitRepo.getChildren())   if (obj instanceof GitModelCommit || obj instanceof GitModelCache) {
    RevCommit revCommit;
    if (obj instanceof GitModelCommit)     revCommit=((GitModelCommit)obj).getRemoteCommit();
 else     revCommit=((GitModelCache)obj).getRemoteCommit();
    result.add(new GitTreeTraversal(repo,revCommit));
  }
  return result.toArray(new ResourceTraversal[result.size()]);
}

Fixed version (ground truth):
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context,IProgressMonitor monitor) throws CoreException {
  Repository repo=gitRepo.getRepository();
  List<ResourceTraversal> result=new ArrayList<ResourceTraversal>();
  for (  GitModelObject obj : gitRepo.getChildren())   if (obj instanceof GitModelCommit || obj instanceof GitModelCache) {
    RevCommit revCommit;
    if (obj instanceof GitModelCommit)     revCommit=((GitModelCommit)obj).getBaseCommit();
 else     revCommit=((GitModelCache)obj).getBaseCommit();
    result.add(new GitTreeTraversal(repo,revCommit));
  }
  return result.toArray(new ResourceTraversal[result.size()]);
}
Program: 7787
Project: 7787
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)) {
    String path=new String(tw.getRawPath());
    ObjectId repoId=tw.getObjectId(BASE_NTH);
    ObjectId cacheId=tw.getObjectId(REMOTE_NTH);
    if (path.split("String_Node_Str").length > 1)     return handleCacheTree(repoId,cacheId,path);
    return fileFactory.createFileModel(this,remoteCommit,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=new String(tw.getRawPath());
    ObjectId repoId=tw.getObjectId(BASE_NTH);
    ObjectId cacheId=tw.getObjectId(REMOTE_NTH);
    if (path.split("String_Node_Str").length > 1)     return handleCacheTree(repoId,cacheId,path);
    return fileFactory.createFileModel(this,baseCommit,repoId,cacheId,path);
  }
  return null;
}
Program: 7788
Project: 7788
Buggy source:
private GitModelObject handleCacheTree(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String pathKey=path.split("String_Node_Str")[0];
  GitModelCacheTree cacheTree=cacheTreeMap.get(pathKey);
  if (cacheTree == null) {
    cacheTree=new GitModelCacheTree(this,remoteCommit,repoId,cacheId,pathKey,fileFactory);
    cacheTreeMap.put(pathKey,cacheTree);
  }
  cacheTree.addChild(repoId,cacheId,path.substring(path.indexOf('/') + 1));
  return cacheTree;
}

Fixed version (ground truth):
private GitModelObject handleCacheTree(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String pathKey=path.split("String_Node_Str")[0];
  GitModelCacheTree cacheTree=cacheTreeMap.get(pathKey);
  if (cacheTree == null) {
    cacheTree=new GitModelCacheTree(this,baseCommit,repoId,cacheId,pathKey,fileFactory);
    cacheTreeMap.put(pathKey,cacheTree);
  }
  cacheTree.addChild(repoId,cacheId,path.substring(path.indexOf('/') + 1));
  return cacheTree;
}
Program: 7789
Project: 7789
Buggy source:
void addChild(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String[] entrys=path.split("String_Node_Str");
  String pathKey=entrys[0];
  if (entrys.length > 1) {
    GitModelCacheTree cacheEntry=(GitModelCacheTree)cacheTreeMap.get(pathKey);
    if (cacheEntry == null) {
      cacheEntry=new GitModelCacheTree(this,remoteCommit,repoId,cacheId,pathKey,factory);
      cacheTreeMap.put(pathKey,cacheEntry);
    }
    cacheEntry.addChild(repoId,cacheId,path.substring(path.indexOf('/') + 1));
  }
 else   cacheTreeMap.put(pathKey,factory.createFileModel(this,remoteCommit,repoId,cacheId,pathKey));
}

Fixed version (ground truth):
void addChild(ObjectId repoId,ObjectId cacheId,String path) throws IOException {
  String[] entrys=path.split("String_Node_Str");
  String pathKey=entrys[0];
  if (entrys.length > 1) {
    GitModelCacheTree cacheEntry=(GitModelCacheTree)cacheTreeMap.get(pathKey);
    if (cacheEntry == null) {
      cacheEntry=new GitModelCacheTree(this,baseCommit,repoId,cacheId,pathKey,factory);
      cacheTreeMap.put(pathKey,cacheEntry);
    }
    cacheEntry.addChild(repoId,cacheId,path.substring(path.indexOf('/') + 1));
  }
 else   cacheTreeMap.put(pathKey,factory.createFileModel(this,baseCommit,repoId,cacheId,pathKey));
}
Program: 7790
Project: 7790
Buggy source:
@Override public int hashCode(){
  int result=getLocation().hashCode() ^ remoteCommit.hashCode();
  if (baseCommit != null)   result^=baseCommit.hashCode();
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=getLocation().hashCode() ^ baseCommit.hashCode();
  if (remoteCommit != null)   result^=remoteCommit.hashCode();
  return result;
}
Program: 7791
Project: 7791
Buggy source:
@Override protected GitModelObject[] getChildrenImpl(){
  TreeWalk tw=createTreeWalk();
  List<GitModelObject> result=new ArrayList<GitModelObject>();
  try {
    RevTree actualTree=remoteCommit.getTree();
    int actualNth=tw.addTree(actualTree);
    int baseNth=-1;
    if (baseCommit != null)     baseNth=tw.addTree(baseCommit.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,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: 7792
Project: 7792
Buggy source:
@Override public String getName(){
  if (name == null)   name=remoteCommit.getShortMessage();
  return name;
}

Fixed version (ground truth):
@Override public String getName(){
  if (name == null)   name=baseCommit.getShortMessage();
  return name;
}
Program: 7793
Project: 7793
Buggy source:
/** 
 * @param parent instance of parent object
 * @param commit commit connected with this container
 * @param direction indicate change direction
 * @throws IOException
 */
protected GitModelObjectContainer(GitModelObject parent,RevCommit commit,int direction) throws IOException {
  super(parent);
  kind=direction;
  remoteCommit=commit;
  ancestorCommit=calculateAncestor(remoteCommit);
  RevCommit[] parents=remoteCommit.getParents();
  if (parents != null && parents.length > 0)   baseCommit=remoteCommit.getParent(0);
 else {
    baseCommit=null;
  }
}

Fixed version (ground truth):
/** 
 * @param parent instance of parent object
 * @param commit commit connected with this container
 * @param direction indicate change direction
 * @throws IOException
 */
protected GitModelObjectContainer(GitModelObject parent,RevCommit commit,int direction) throws IOException {
  super(parent);
  kind=direction;
  baseCommit=commit;
  ancestorCommit=calculateAncestor(baseCommit);
  RevCommit[] parents=baseCommit.getParents();
  if (parents != null && parents.length > 0)   remoteCommit=baseCommit.getParent(0);
 else {
    remoteCommit=null;
  }
}
Program: 7794
Project: 7794
Buggy source:
private void calculateKind(){
  ObjectId base=baseCommit != null ? baseCommit.getId() : zeroId();
  if (base.equals(zeroId()))   kind=kind | ADDITION;
 else   if (remoteCommit.equals(zeroId()))   kind=kind | DELETION;
 else   kind=kind | CHANGE;
}

Fixed version (ground truth):
private void calculateKind(){
  ObjectId remote=remoteCommit != null ? remoteCommit.getId() : zeroId();
  if (remote.equals(zeroId()))   kind=kind | ADDITION;
 else   if (baseCommit.equals(zeroId()))   kind=kind | DELETION;
 else   kind=kind | CHANGE;
}
Program: 7795
Project: 7795
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=tw.getObjectId(ancestorNth);
  int objectType=tw.getFileMode(actualNth).getObjectType();
  if (objectType == Constants.OBJ_BLOB)   return new GitModelBlob(this,getRemoteCommit(),objAncestorId,objBaseId,objRemoteId,objName);
 else   if (objectType == Constants.OBJ_TREE)   return new GitModelTree(this,getRemoteCommit(),objAncestorId,objBaseId,objRemoteId,objName);
  return null;
}

Fixed version (ground truth):
/** 
 * @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=tw.getObjectId(ancestorNth);
  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;
}
Program: 7796
Project: 7796
Buggy source:
/** 
 * Allows access to the localized values of the EGit UI Plug-in <p>
 * @param key see  {@link #getPluginLocalizedValue(String)}
 * @param keepAmpersands if <code>true</code>, ampersands will be kept
 * @return see {@link #getPluginLocalizedValue(String)}
 * @throws MissingResourceException see  {@link #getPluginLocalizedValue(String)}
 */
public synchronized String getPluginLocalizedValue(String key,boolean keepAmpersands) throws MissingResourceException {
  if (myBundle == null) {
    ServiceTracker localizationTracker;
    BundleContext context=Activator.getDefault().getBundle().getBundleContext();
    localizationTracker=new ServiceTracker(context,BundleLocalization.class.getName(),null);
    localizationTracker.open();
    BundleLocalization location=(BundleLocalization)localizationTracker.getService();
    if (location != null)     myBundle=location.getLocalization(Activator.getDefault().getBundle(),Locale.getDefault().toString());
  }
  String raw=myBundle.getString(key);
  if (keepAmpersands || raw.indexOf(AMPERSAND) < 0)   return raw;
  StringBuilder sb=new StringBuilder(raw.length());
  for (int i=0; i < raw.length(); i++) {
    char c=raw.charAt(i);
    if (c != AMPERSAND)     sb.append(c);
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Allows access to the localized values of the EGit UI Plug-in <p>
 * @param key see  {@link #getPluginLocalizedValue(String)}
 * @param keepAmpersands if <code>true</code>, ampersands will be kept
 * @return see {@link #getPluginLocalizedValue(String)}
 * @throws MissingResourceException see  {@link #getPluginLocalizedValue(String)}
 */
public synchronized String getPluginLocalizedValue(String key,boolean keepAmpersands) throws MissingResourceException {
  if (myBundle == null) {
    ServiceTracker localizationTracker;
    BundleContext context=Activator.getDefault().getBundle().getBundleContext();
    localizationTracker=new ServiceTracker(context,BundleLocalization.class.getName(),null);
    localizationTracker.open();
    BundleLocalization location=(BundleLocalization)localizationTracker.getService();
    if (location != null)     myBundle=location.getLocalization(Activator.getDefault().getBundle(),Locale.getDefault().toString());
  }
  if (myBundle != null) {
    String raw=myBundle.getString(key);
    if (keepAmpersands || raw.indexOf(AMPERSAND) < 0)     return raw;
    StringBuilder sb=new StringBuilder(raw.length());
    for (int i=0; i < raw.length(); i++) {
      char c=raw.charAt(i);
      if (c != AMPERSAND)       sb.append(c);
    }
    return sb.toString();
  }
  return null;
}
Program: 7799
Project: 7799
Buggy source:
/** 
 * Creates a new branch
 * @param refName starting point for the new branch
 * @param newRefName
 * @throws IOException
 */
public void createBranch(String refName,String newRefName) throws IOException {
  RefUpdate updateRef;
  updateRef=repository.updateRef(newRefName);
  Ref startRef=repository.getRef(refName);
  ObjectId startAt=repository.resolve(refName);
  String startBranch;
  if (startRef != null)   startBranch=refName;
 else   startBranch=startAt.name();
  startBranch=repository.shortenRefName(startBranch);
  updateRef.setNewObjectId(startAt);
  updateRef.setRefLogMessage("String_Node_Str" + startBranch,false);
  updateRef.update();
}

Fixed version (ground truth):
/** 
 * Creates a new branch
 * @param refName starting point for the new branch
 * @param newRefName
 * @throws IOException
 */
public void createBranch(String refName,String newRefName) throws IOException {
  RefUpdate updateRef;
  updateRef=repository.updateRef(newRefName);
  Ref startRef=repository.getRef(refName);
  ObjectId startAt=repository.resolve(refName);
  String startBranch;
  if (startRef != null)   startBranch=refName;
 else   startBranch=startAt.name();
  startBranch=Repository.shortenRefName(startBranch);
  updateRef.setNewObjectId(startAt);
  updateRef.setRefLogMessage("String_Node_Str" + startBranch,false);
  updateRef.update();
}
Program: 7800
Project: 7800
Buggy source:
protected static void createStableBranch(Repository myRepository) throws IOException {
  String newRefName="String_Node_Str";
  RefUpdate updateRef=myRepository.updateRef(newRefName);
  Ref sourceBranch=myRepository.getRef("String_Node_Str");
  ObjectId startAt=sourceBranch.getObjectId();
  String startBranch=myRepository.shortenRefName(sourceBranch.getName());
  updateRef.setNewObjectId(startAt);
  updateRef.setRefLogMessage("String_Node_Str" + startBranch,false);
  updateRef.update();
}

Fixed version (ground truth):
protected static void createStableBranch(Repository myRepository) throws IOException {
  String newRefName="String_Node_Str";
  RefUpdate updateRef=myRepository.updateRef(newRefName);
  Ref sourceBranch=myRepository.getRef("String_Node_Str");
  ObjectId startAt=sourceBranch.getObjectId();
  String startBranch=Repository.shortenRefName(sourceBranch.getName());
  updateRef.setNewObjectId(startAt);
  updateRef.setRefLogMessage("String_Node_Str" + startBranch,false);
  updateRef.update();
}
Program: 7801
Project: 7801
Buggy source:
protected static void createStableBranch(Repository myRepository) throws IOException {
  String newRefName="String_Node_Str";
  RefUpdate updateRef=myRepository.updateRef(newRefName);
  Ref sourceBranch=myRepository.getRef("String_Node_Str");
  ObjectId startAt=sourceBranch.getObjectId();
  String startBranch=myRepository.shortenRefName(sourceBranch.getName());
  updateRef.setNewObjectId(startAt);
  updateRef.setRefLogMessage("String_Node_Str" + startBranch,false);
  updateRef.update();
}

Fixed version (ground truth):
protected static void createStableBranch(Repository myRepository) throws IOException {
  String newRefName="String_Node_Str";
  RefUpdate updateRef=myRepository.updateRef(newRefName);
  Ref sourceBranch=myRepository.getRef("String_Node_Str");
  ObjectId startAt=sourceBranch.getObjectId();
  String startBranch=Repository.shortenRefName(sourceBranch.getName());
  updateRef.setNewObjectId(startAt);
  updateRef.setRefLogMessage("String_Node_Str" + startBranch,false);
  updateRef.update();
}
Program: 7804
Project: 7804
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  final List<RefNode> nodes=getSelectedNodes(event);
  RefNode refNode=nodes.get(0);
  Shell shell=getShell(event);
  String oldName=refNode.getObject().getName();
  String prefix;
  if (oldName.startsWith(Constants.R_HEADS))   prefix=Constants.R_HEADS;
 else   if (oldName.startsWith(Constants.R_REMOTES))   prefix=Constants.R_REMOTES;
 else   throw new ExecutionException(NLS.bind(UIText.RenameBranchCommand_WrongNameMessage,oldName));
  Repository db=refNode.getRepository();
  IInputValidator inputValidator=ValidationUtils.getRefNameInputValidator(db,prefix,true);
  String defaultValue=db.shortenRefName(oldName);
  InputDialog newNameDialog=new InputDialog(shell,UIText.RepositoriesView_RenameBranchTitle,NLS.bind(UIText.RepositoriesView_RenameBranchMessage,defaultValue),defaultValue,inputValidator);
  if (newNameDialog.open() == Window.OK) {
    try {
      String newName=newNameDialog.getValue();
      new RenameBranchOperation(db,refNode.getObject(),newName).execute(null);
    }
 catch (    CoreException e) {
      Activator.handleError(UIText.RepositoriesView_RenameBranchFailure,e,true);
    }
  }
  return null;
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  final List<RefNode> nodes=getSelectedNodes(event);
  RefNode refNode=nodes.get(0);
  Shell shell=getShell(event);
  String oldName=refNode.getObject().getName();
  String prefix;
  if (oldName.startsWith(Constants.R_HEADS))   prefix=Constants.R_HEADS;
 else   if (oldName.startsWith(Constants.R_REMOTES))   prefix=Constants.R_REMOTES;
 else   throw new ExecutionException(NLS.bind(UIText.RenameBranchCommand_WrongNameMessage,oldName));
  Repository db=refNode.getRepository();
  IInputValidator inputValidator=ValidationUtils.getRefNameInputValidator(db,prefix,true);
  String defaultValue=Repository.shortenRefName(oldName);
  InputDialog newNameDialog=new InputDialog(shell,UIText.RepositoriesView_RenameBranchTitle,NLS.bind(UIText.RepositoriesView_RenameBranchMessage,defaultValue),defaultValue,inputValidator);
  if (newNameDialog.open() == Window.OK) {
    try {
      String newName=newNameDialog.getValue();
      new RenameBranchOperation(db,refNode.getObject(),newName).execute(null);
    }
 catch (    CoreException e) {
      Activator.handleError(UIText.RepositoriesView_RenameBranchFailure,e,true);
    }
  }
  return null;
}
Program: 7805
Project: 7805
Buggy source:
private List<IPath> getPathList() throws IOException {
  List<IPath> result=new ArrayList<IPath>();
  Set<String> children=getRepository().getRefDatabase().getRefs(getObject().toPortableString()).keySet();
  for (  String pathEntry : children) {
    result.add(getObject().append(new Path(pathEntry)));
  }
  return result;
}

Fixed version (ground truth):
private List<IPath> getPathList() throws IOException {
  List<IPath> result=new ArrayList<IPath>();
  Map<String,Ref> refsMap=getRepository().getRefDatabase().getRefs(getObject().toPortableString());
  for (  Map.Entry<String,Ref> entry : refsMap.entrySet()) {
    if (entry.getValue().isSymbolic())     continue;
    result.add(getObject().append(new Path(entry.getKey())));
  }
  return result;
}