Program: 7781
Project: 7781
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  boolean compareMode=Boolean.TRUE.toString().equals(event.getParameter(HistoryViewCommands.COMPARE_MODE_PARAM));
  IStructuredSelection selection=getSelection(getPage());
  if (selection.size() < 1)   return null;
  Object input=getPage().getInputInternal().getSingleFile();
  if (input == null)   return null;
  boolean errorOccured=false;
  List<ObjectId> ids=new ArrayList<ObjectId>();
  String gitPath=null;
  if (input instanceof IFile) {
    IFile resource=(IFile)input;
    final RepositoryMapping map=RepositoryMapping.getMapping(resource);
    gitPath=map.getRepoRelativePath(resource);
    Iterator<?> it=selection.iterator();
    while (it.hasNext()) {
      RevCommit commit=(RevCommit)it.next();
      IFileRevision rev=null;
      try {
        rev=CompareUtils.getFileRevision(gitPath,commit,map.getRepository(),null);
      }
 catch (      IOException e) {
        Activator.logError(NLS.bind(UIText.GitHistoryPage_errorLookingUpPath,gitPath,commit.getId()),e);
        errorOccured=true;
      }
      if (rev != null) {
        if (compareMode) {
          ITypedElement right=CompareUtils.getFileRevisionTypedElement(gitPath,commit,map.getRepository());
          final GitCompareFileRevisionEditorInput in=new GitCompareFileRevisionEditorInput(SaveableCompareEditorInput.createFileElement(resource),right,null);
          try {
            openInCompare(event,in);
          }
 catch (          Exception e) {
            errorOccured=true;
          }
        }
 else {
          try {
            EgitUiEditorUtils.openEditor(getPart(event).getSite().getPage(),rev,new NullProgressMonitor());
          }
 catch (          CoreException e) {
            Activator.logError(UIText.GitHistoryPage_openFailed,e);
            errorOccured=true;
          }
        }
      }
 else {
        ids.add(commit.getId());
      }
    }
  }
  if (input instanceof File) {
    File fileInput=(File)input;
    Repository repo=getRepository(event);
    gitPath=getRepoRelativePath(repo,fileInput);
    Iterator<?> it=selection.iterator();
    while (it.hasNext()) {
      RevCommit commit=(RevCommit)it.next();
      IFileRevision rev=null;
      try {
        rev=CompareUtils.getFileRevision(gitPath,commit,repo,null);
      }
 catch (      IOException e) {
        Activator.logError(NLS.bind(UIText.GitHistoryPage_errorLookingUpPath,gitPath,commit.getId()),e);
        errorOccured=true;
      }
      if (rev != null) {
        if (compareMode) {
          try {
            ITypedElement left=CompareUtils.getFileRevisionTypedElement(gitPath,new RevWalk(repo).parseCommit(repo.resolve(Constants.HEAD)),repo);
            ITypedElement right=CompareUtils.getFileRevisionTypedElement(gitPath,commit,repo);
            final GitCompareFileRevisionEditorInput in=new GitCompareFileRevisionEditorInput(left,right,null);
            openInCompare(event,in);
          }
 catch (          Exception e) {
            errorOccured=true;
          }
        }
 else {
          try {
            EgitUiEditorUtils.openEditor(getPart(event).getSite().getPage(),rev,new NullProgressMonitor());
          }
 catch (          CoreException e) {
            Activator.logError(UIText.GitHistoryPage_openFailed,e);
            errorOccured=true;
          }
        }
      }
 else {
        ids.add(commit.getId());
      }
    }
  }
  if (errorOccured)   Activator.showError(UIText.GitHistoryPage_openFailed,null);
  if (ids.size() > 0) {
    String idList="String_Node_Str";
    for (    ObjectId objectId : ids) {
      idList+=objectId.getName() + "String_Node_Str";
    }
    MessageDialog.openError(getPart(event).getSite().getShell(),UIText.GitHistoryPage_fileNotFound,NLS.bind(UIText.GitHistoryPage_notContainedInCommits,gitPath,idList));
  }
  return null;
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  boolean compareMode=Boolean.TRUE.toString().equals(event.getParameter(HistoryViewCommands.COMPARE_MODE_PARAM));
  IStructuredSelection selection=getSelection(getPage());
  if (selection.size() < 1)   return null;
  Object input=getPage().getInputInternal().getSingleFile();
  if (input == null)   return null;
  boolean errorOccured=false;
  List<ObjectId> ids=new ArrayList<ObjectId>();
  String gitPath=null;
  if (input instanceof IFile) {
    IFile resource=(IFile)input;
    final RepositoryMapping map=RepositoryMapping.getMapping(resource);
    gitPath=map.getRepoRelativePath(resource);
    Iterator<?> it=selection.iterator();
    while (it.hasNext()) {
      RevCommit commit=(RevCommit)it.next();
      IFileRevision rev=null;
      try {
        rev=CompareUtils.getFileRevision(gitPath,commit,map.getRepository(),null);
      }
 catch (      IOException e) {
        Activator.logError(NLS.bind(UIText.GitHistoryPage_errorLookingUpPath,gitPath,commit.getId()),e);
        errorOccured=true;
      }
      if (rev != null) {
        if (compareMode) {
          ITypedElement right=CompareUtils.getFileRevisionTypedElement(gitPath,commit,map.getRepository());
          final GitCompareFileRevisionEditorInput in=new GitCompareFileRevisionEditorInput(SaveableCompareEditorInput.createFileElement(resource),right,null);
          try {
            openInCompare(event,in);
          }
 catch (          Exception e) {
            errorOccured=true;
          }
        }
 else {
          try {
            EgitUiEditorUtils.openEditor(getPart(event).getSite().getPage(),rev,new NullProgressMonitor());
          }
 catch (          CoreException e) {
            Activator.logError(UIText.GitHistoryPage_openFailed,e);
            errorOccured=true;
          }
        }
      }
 else {
        ids.add(commit.getId());
      }
    }
  }
  if (input instanceof File) {
    File fileInput=(File)input;
    Repository repo=getRepository(event);
    gitPath=getRepoRelativePath(repo,fileInput);
    Iterator<?> it=selection.iterator();
    while (it.hasNext()) {
      RevCommit commit=(RevCommit)it.next();
      IFileRevision rev=null;
      try {
        rev=CompareUtils.getFileRevision(gitPath,commit,repo,null);
      }
 catch (      IOException e) {
        Activator.logError(NLS.bind(UIText.GitHistoryPage_errorLookingUpPath,gitPath,commit.getId()),e);
        errorOccured=true;
      }
      if (rev != null) {
        if (compareMode) {
          try {
            ITypedElement left=CompareUtils.getFileRevisionTypedElement(gitPath,new RevWalk(repo).parseCommit(repo.resolve(Constants.HEAD)),repo);
            ITypedElement right=CompareUtils.getFileRevisionTypedElement(gitPath,commit,repo);
            final GitCompareFileRevisionEditorInput in=new GitCompareFileRevisionEditorInput(left,right,null);
            openInCompare(event,in);
          }
 catch (          IOException e) {
            errorOccured=true;
          }
        }
 else {
          try {
            EgitUiEditorUtils.openEditor(getPart(event).getSite().getPage(),rev,new NullProgressMonitor());
          }
 catch (          CoreException e) {
            Activator.logError(UIText.GitHistoryPage_openFailed,e);
            errorOccured=true;
          }
        }
      }
 else {
        ids.add(commit.getId());
      }
    }
  }
  if (errorOccured)   Activator.showError(UIText.GitHistoryPage_openFailed,null);
  if (ids.size() > 0) {
    String idList="String_Node_Str";
    for (    ObjectId objectId : ids) {
      idList+=objectId.getName() + "String_Node_Str";
    }
    MessageDialog.openError(getPart(event).getSite().getShell(),UIText.GitHistoryPage_fileNotFound,NLS.bind(UIText.GitHistoryPage_notContainedInCommits,gitPath,idList));
  }
  return null;
}