nus-yam/ex-repair huggingface dataset:
Program: 7656
Project: 7656
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onSignBreak(BlockBreakEvent event){
  if (Config.isWorldSupported(event.getBlock().getWorld().getName())) {
    Poi poi=_isPoiSign(event.getBlock());
    if (poi == null) {
      if (_hasAttachedPoiSign(event.getBlock()) != null) {
        event.setCancelled(true);
      }
      return;
    }
    Player player=event.getPlayer();
    if (poi.getOwner().equals(event.getPlayer().getName())) {
      try {
        if (!player.hasPermission("String_Node_Str")) {
          player.sendMessage("String_Node_Str");
          event.setCancelled(true);
          return;
        }
        _poiManager.removePOI(poi.getId(),poi.getName());
        event.getPlayer().sendMessage("String_Node_Str");
      }
 catch (      PoiException e) {
        event.getPlayer().sendMessage(ChatColor.RED + "String_Node_Str");
      }
    }
 else {
      event.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onSignBreak(BlockBreakEvent event){
  if (Config.isWorldSupported(event.getBlock().getWorld().getName())) {
    Poi poi=_isPoiSign(event.getBlock());
    if (poi == null) {
      if (_hasAttachedPoiSign(event.getBlock()) != null) {
        event.setCancelled(true);
      }
      return;
    }
    Player player=event.getPlayer();
    if (poi.getOwner().equals(event.getPlayer().getName())) {
      try {
        if (!player.hasPermission("String_Node_Str")) {
          player.sendMessage("String_Node_Str");
          event.setCancelled(true);
          return;
        }
        _poiManager.removePOI(poi.getId(),poi.getName());
        _poiManager.unselectPoi(player,poi.getId());
        event.getPlayer().sendMessage("String_Node_Str");
      }
 catch (      PoiException e) {
        event.getPlayer().sendMessage(ChatColor.RED + "String_Node_Str");
      }
    }
 else {
      event.setCancelled(true);
    }
  }
}
Program: 7657
Project: 7657
Buggy source:
/** 
 * Maximum number of search results when a player does an area search.
 * @return
 */
public static int getMaxSearchResults(){
  return _maxSearchResults;
}

Fixed version (ground truth):
/** 
 * Maximum number of search results when a player does an area search.
 * @return
 */
public static int getMaxSearchResults(){
  return _instance._maxSearchResults;
}
Program: 7658
Project: 7658
Buggy source:
/** 
 * Dictates minimum distance between POIs.  
 * @return
 */
public static int getMinPoiGap(){
  return _minPoiGap;
}

Fixed version (ground truth):
/** 
 * Dictates minimum distance between POIs.  
 * @return
 */
public static int getMinPoiGap(){
  return _instance._minPoiGap;
}
Program: 7659
Project: 7659
Buggy source:
/** 
 * Reloads the config from the file.
 * @return
 */
public static boolean reload(){
  try {
    return Config.load(Config._dataFolder,Config._log);
  }
 catch (  Exception ex) {
    System.out.println("String_Node_Str");
    ex.printStackTrace();
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Reloads the config from the file.
 * @return
 */
public static boolean reload(){
  if (_instance == null) {
    _log.severe("String_Node_Str");
    return false;
  }
  Config previous=_instance;
  if (!_load(_dataFolder,_log)) {
    _log.severe("String_Node_Str");
    _instance=previous;
    return false;
  }
  return true;
}
Program: 7660
Project: 7660
Buggy source:
/** 
 * Maximum number of POIs a player can create in each world.
 * @return
 */
public static int getMaxPlayerPoiPerWorld(){
  return _maxPlayerPoiPerWorld;
}

Fixed version (ground truth):
/** 
 * Maximum number of POIs a player can create in each world.
 * @return
 */
public static int getMaxPlayerPoiPerWorld(){
  return _instance._maxPlayerPoiPerWorld;
}
Program: 7662
Project: 7662
Buggy source:
/** 
 * List of worlds in which POIs are not supported.
 */
public static boolean isWorldSupported(String world){
  return _worldBlackList == null || !_worldBlackList.contains(world.toLowerCase());
}

Fixed version (ground truth):
/** 
 * List of worlds in which POIs are not supported.
 */
public static boolean isWorldSupported(String world){
  return _instance._worldBlackList == null || !_instance._worldBlackList.contains(world.toLowerCase());
}
Program: 7663
Project: 7663
Buggy source:
/** 
 * Dictates how far to search and maximum distance a player can be from a POI and still get directions
 * @return 
 */
public static int getDistanceThreshold(){
  return _distanceThreshold;
}

Fixed version (ground truth):
/** 
 * Dictates how far to search and maximum distance a player can be from a POI and still get directions
 * @return 
 */
public static int getDistanceThreshold(){
  return _instance._distanceThreshold;
}
Program: 7665
Project: 7665
Buggy source:
/** 
 * Returns a list of messages which form the general help.
 * @return
 */
private ArrayList<String> _generalHelp(boolean isOp){
  ArrayList<String> messages=new ArrayList<String>();
  ArrayList<String> alternation=new ArrayList<String>();
  alternation.add("String_Node_Str");
  alternation.add("String_Node_Str");
  alternation.add("String_Node_Str");
  messages.add(ChatColor.AQUA + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str"+ this._required("String_Node_Str")+ this._optional("String_Node_Str")+ this._alternation(alternation,true));
  messages.add("String_Node_Str");
  messages.add(this._select(true).get(0));
  messages.add(this._summary(true).get(0));
  if (isOp || !Config.isAddRestrictedToOps()) {
    messages.add(this._add(true).get(0));
  }
  messages.add(this._remove(true).get(0));
  messages.add(this._search(true).get(0));
  messages.add(this._list(true).get(0));
  messages.add(this._page(true).get(0));
  messages.add(this._action(PoiCommand.ACTION_HELP) + this._optional("String_Node_Str") + this._shortDescription("String_Node_Str"));
  return messages;
}

Fixed version (ground truth):
/** 
 * Returns a list of messages which form the general help.
 * @return
 */
private ArrayList<String> _generalHelp(boolean isOp){
  ArrayList<String> messages=new ArrayList<String>();
  ArrayList<String> alternation=new ArrayList<String>();
  alternation.add("String_Node_Str");
  alternation.add("String_Node_Str");
  alternation.add("String_Node_Str");
  messages.add(ChatColor.AQUA + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str"+ this._required("String_Node_Str")+ this._optional("String_Node_Str")+ this._alternation(alternation,true));
  messages.add("String_Node_Str");
  messages.add(this._select(true).get(0));
  messages.add(this._summary(true).get(0));
  messages.add(this._add(true).get(0));
  messages.add(this._remove(true).get(0));
  messages.add(this._search(true).get(0));
  messages.add(this._list(true).get(0));
  messages.add(this._page(true).get(0));
  messages.add(this._action(PoiCommand.ACTION_HELP) + this._optional("String_Node_Str") + this._shortDescription("String_Node_Str"));
  return messages;
}
Program: 7666
Project: 7666
Buggy source:
@Override protected IStatus run(IProgressMonitor monitor){
  waitForWorkspaceLock();
  if (monitor.isCanceled())   return Status.CANCEL_STATUS;
  lock.lock();
  try {
    long startTime=System.currentTimeMillis();
    IndexDiffData result=calcIndexDiffData(monitor,getName(),filesToUpdate,resourcesToUpdate);
    if (monitor.isCanceled())     return Status.CANCEL_STATUS;
    indexDiffData=result;
    if (GitTraceLocation.INDEXDIFFCACHE.isActive()) {
      long time=System.currentTimeMillis() - startTime;
      StringBuilder message=new StringBuilder(NLS.bind("String_Node_Str",Integer.valueOf(resourcesToUpdate.size()),Long.valueOf(time)));
      GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),message.append(indexDiffData.toString()).toString());
    }
    notifyListeners();
    return Status.OK_STATUS;
  }
 catch (  RuntimeException e) {
    if (GitTraceLocation.INDEXDIFFCACHE.isActive())     GitTraceLocation.getTrace().trace(GitTraceLocation.INDEXDIFFCACHE.getLocation(),"String_Node_Str",e);
    scheduleReloadJob("String_Node_Str");
    return Status.OK_STATUS;
  }
 finally {
    lock.unlock();
  }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixed version (ground truth):
/** 
 * @return state
 */
public CommitMessageComponentState getState(){
  updateStateFromUI();
  CommitMessageComponentState state=new CommitMessageComponentState();
  state.setAmend(isAmending());
  state.setAuthor(getAuthor());
  state.setCommitMessage(commitText.getText());
  state.setCommitter(getCommitter());
  state.setHeadCommit(getHeadCommit());
  return state;
}
Program: 7703
Project: 7703
Buggy source:
/** 
 * @param shell
 * @param repository
 * @param config
 */
private SimpleConfigureFetchDialog(Shell shell,Repository repository,RemoteConfig config){
  super(shell);
  setHelpAvailable(false);
  this.repository=repository;
  this.config=config;
}

Fixed version (ground truth):
/** 
 * @param shell
 * @param repository
 * @param config
 */
private SimpleConfigureFetchDialog(Shell shell,Repository repository,RemoteConfig config){
  super(shell);
  setHelpAvailable(false);
  setShellStyle(getShellStyle() | SWT.SHELL_TRIM);
  this.repository=repository;
  this.config=config;
}
Program: 7706
Project: 7706
Buggy source:
private SimpleConfigurePushDialog(Shell shell,Repository repository,RemoteConfig config){
  super(shell);
  setHelpAvailable(false);
  this.repository=repository;
  this.config=config;
}

Fixed version (ground truth):
private SimpleConfigurePushDialog(Shell shell,Repository repository,RemoteConfig config){
  super(shell);
  setHelpAvailable(false);
  setShellStyle(getShellStyle() | SWT.SHELL_TRIM);
  this.repository=repository;
  this.config=config;
}
Program: 7707
Project: 7707
Buggy source:
/** 
 * {@link RevWalk#markStart(RevCommit)} all refs with given prefix to markstart of graph traversal using currentWalker
 * @param prefix prefix of refs to be marked
 * @throws IOException
 * @throws MissingObjectException
 * @throws IncorrectObjectTypeException
 */
private void markStartAllRefs(String prefix) throws IOException, MissingObjectException, IncorrectObjectTypeException {
  for (  Entry<String,Ref> refEntry : input.getRepository().getRefDatabase().getRefs(prefix).entrySet()) {
    Ref ref=refEntry.getValue();
    if (ref.isSymbolic())     continue;
    currentWalk.markStart(currentWalk.parseCommit(ref.getObjectId()));
  }
}

Fixed version (ground truth):
/** 
 * {@link RevWalk#markStart(RevCommit)} all refs with given prefix to markstart of graph traversal using currentWalker
 * @param prefix prefix of refs to be marked
 * @throws IOException
 * @throws MissingObjectException
 * @throws IncorrectObjectTypeException
 */
private void markStartAllRefs(String prefix) throws IOException, MissingObjectException, IncorrectObjectTypeException {
  for (  Entry<String,Ref> refEntry : input.getRepository().getRefDatabase().getRefs(prefix).entrySet()) {
    Ref ref=refEntry.getValue();
    if (ref.isSymbolic())     continue;
    Object refTarget=currentWalk.parseAny(ref.getObjectId());
    if (refTarget instanceof RevCommit)     currentWalk.markStart((RevCommit)refTarget);
  }
}
Program: 7708
Project: 7708
Buggy source:
private void setWalkStartPoints(Repository db,AnyObjectId headId){
  try {
    if (store.getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES)) {
      markStartAllRefs(Constants.R_HEADS);
      markStartAllRefs(Constants.R_REMOTES);
      markStartAllRefs(Constants.R_TAGS);
    }
 else     currentWalk.markStart(currentWalk.parseCommit(headId));
  }
 catch (  IOException e) {
    throw new IllegalStateException(NLS.bind(UIText.GitHistoryPage_errorReadingHeadCommit,headId,db.getDirectory().getAbsolutePath()),e);
  }
}

Fixed version (ground truth):
private void setWalkStartPoints(Repository db,AnyObjectId headId){
  try {
    if (store.getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES)) {
      markStartAllRefs(Constants.R_HEADS);
      markStartAllRefs(Constants.R_REMOTES);
      markStartAllRefs(Constants.R_TAGS);
    }
 else     currentWalk.markStart(currentWalk.parseCommit(headId));
  }
 catch (  IOException e) {
    throw new IllegalStateException(NLS.bind(UIText.GitHistoryPage_errorSettingStartPoints,Activator.getDefault().getRepositoryUtil().getRepositoryName(db)),e);
  }
}
Program: 7709
Project: 7709
Buggy source:
private void showTag(Ref ref,Repository repo){
  RevWalk rw=new RevWalk(repo);
  try {
    RevCommit c=null;
    RevObject any=rw.parseAny(ref.getLeaf().getObjectId());
    if (any instanceof RevCommit) {
      c=(RevCommit)any;
    }
 else     if (any instanceof RevTag) {
      RevTag t=rw.parseTag(any);
      c=rw.parseCommit(t.getObject());
    }
    if (c != null)     graph.selectCommit(c);
  }
 catch (  IOException e) {
    Activator.handleError(e.getMessage(),e,true);
  }
}

Fixed version (ground truth):
private void showTag(Ref ref,Repository repo){
  RevWalk rw=new RevWalk(repo);
  try {
    RevCommit c=null;
    RevObject any=rw.parseAny(ref.getLeaf().getObjectId());
    if (any instanceof RevCommit) {
      c=(RevCommit)any;
    }
 else     if (any instanceof RevTag) {
      RevTag t=rw.parseTag(any);
      Object anyCommit=rw.parseAny(t.getObject());
      if (anyCommit instanceof RevCommit)       c=(RevCommit)anyCommit;
    }
    if (c != null)     graph.selectCommit(c);
  }
 catch (  IOException e) {
    Activator.handleError(e.getMessage(),e,true);
  }
}
Program: 7710
Project: 7710
Buggy source:
/** 
 * {@link RevWalk#markStart(RevCommit)} all refs with given prefix to markstart of graph traversal using currentWalker
 * @param prefix prefix of refs to be marked
 * @throws IOException
 * @throws MissingObjectException
 * @throws IncorrectObjectTypeException
 */
private void markStartAllRefs(String prefix) throws IOException, MissingObjectException, IncorrectObjectTypeException {
  for (  Entry<String,Ref> refEntry : input.getRepository().getRefDatabase().getRefs(prefix).entrySet()) {
    Ref ref=refEntry.getValue();
    if (ref.isSymbolic())     continue;
    currentWalk.markStart(currentWalk.parseCommit(ref.getObjectId()));
  }
}

Fixed version (ground truth):
/** 
 * {@link RevWalk#markStart(RevCommit)} all refs with given prefix to markstart of graph traversal using currentWalker
 * @param prefix prefix of refs to be marked
 * @throws IOException
 * @throws MissingObjectException
 * @throws IncorrectObjectTypeException
 */
private void markStartAllRefs(String prefix) throws IOException, MissingObjectException, IncorrectObjectTypeException {
  for (  Entry<String,Ref> refEntry : input.getRepository().getRefDatabase().getRefs(prefix).entrySet()) {
    Ref ref=refEntry.getValue();
    if (ref.isSymbolic())     continue;
    Object refTarget=currentWalk.parseAny(ref.getObjectId());
    if (refTarget instanceof RevCommit)     currentWalk.markStart((RevCommit)refTarget);
  }
}
Program: 7711
Project: 7711
Buggy source:
private void setWalkStartPoints(Repository db,AnyObjectId headId){
  try {
    if (store.getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES)) {
      markStartAllRefs(Constants.R_HEADS);
      markStartAllRefs(Constants.R_REMOTES);
      markStartAllRefs(Constants.R_TAGS);
    }
 else     currentWalk.markStart(currentWalk.parseCommit(headId));
  }
 catch (  IOException e) {
    throw new IllegalStateException(NLS.bind(UIText.GitHistoryPage_errorReadingHeadCommit,headId,db.getDirectory().getAbsolutePath()),e);
  }
}

Fixed version (ground truth):
private void setWalkStartPoints(Repository db,AnyObjectId headId){
  try {
    if (store.getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES)) {
      markStartAllRefs(Constants.R_HEADS);
      markStartAllRefs(Constants.R_REMOTES);
      markStartAllRefs(Constants.R_TAGS);
    }
 else     currentWalk.markStart(currentWalk.parseCommit(headId));
  }
 catch (  IOException e) {
    throw new IllegalStateException(NLS.bind(UIText.GitHistoryPage_errorSettingStartPoints,Activator.getDefault().getRepositoryUtil().getRepositoryName(db)),e);
  }
}
Program: 7712
Project: 7712
Buggy source:
private void showTag(Ref ref,Repository repo){
  RevWalk rw=new RevWalk(repo);
  try {
    RevCommit c=null;
    RevObject any=rw.parseAny(ref.getLeaf().getObjectId());
    if (any instanceof RevCommit) {
      c=(RevCommit)any;
    }
 else     if (any instanceof RevTag) {
      RevTag t=rw.parseTag(any);
      c=rw.parseCommit(t.getObject());
    }
    if (c != null)     graph.selectCommit(c);
  }
 catch (  IOException e) {
    Activator.handleError(e.getMessage(),e,true);
  }
}

Fixed version (ground truth):
private void showTag(Ref ref,Repository repo){
  RevWalk rw=new RevWalk(repo);
  try {
    RevCommit c=null;
    RevObject any=rw.parseAny(ref.getLeaf().getObjectId());
    if (any instanceof RevCommit) {
      c=(RevCommit)any;
    }
 else     if (any instanceof RevTag) {
      RevTag t=rw.parseTag(any);
      Object anyCommit=rw.parseAny(t.getObject());
      if (anyCommit instanceof RevCommit)       c=(RevCommit)anyCommit;
    }
    if (c != null)     graph.selectCommit(c);
  }
 catch (  IOException e) {
    Activator.handleError(e.getMessage(),e,true);
  }
}
Program: 7713
Project: 7713
Buggy source:
@Override public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof GitModelBlob && !(e2 instanceof GitModelBlob))   return 1;
  if (e2 instanceof GitModelBlob && !(e1 instanceof GitModelBlob))   return -1;
  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 GitModelTree && e1 instanceof GitModelTree) || (e1 instanceof GitModelBlob && e1 instanceof GitModelBlob))   return super.compare(viewer,e1,e2);
  if (e1 instanceof GitModelTree && e2 instanceof GitModelCommit)   return 1;
  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);
}

Fixed version (ground truth):
@Override public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof GitModelBlob && !(e2 instanceof GitModelBlob))   return 1;
  if (e2 instanceof GitModelBlob && !(e1 instanceof GitModelBlob))   return -1;
  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 GitModelTree && e2 instanceof GitModelTree) || (e1 instanceof GitModelBlob && e2 instanceof GitModelBlob))   return super.compare(viewer,e1,e2);
  if (e1 instanceof GitModelTree && e2 instanceof GitModelCommit)   return 1;
  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: 7714
Project: 7714
Buggy source:
@Override public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof GitModelBlob && !(e2 instanceof GitModelBlob))   return 1;
  if (e2 instanceof GitModelBlob && !(e1 instanceof GitModelBlob))   return -1;
  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 GitModelTree && e1 instanceof GitModelTree) || (e1 instanceof GitModelBlob && e1 instanceof GitModelBlob))   return super.compare(viewer,e1,e2);
  if (e1 instanceof GitModelTree && e2 instanceof GitModelCommit)   return 1;
  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);
}

Fixed version (ground truth):
@Override public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof GitModelBlob && !(e2 instanceof GitModelBlob))   return 1;
  if (e2 instanceof GitModelBlob && !(e1 instanceof GitModelBlob))   return -1;
  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 GitModelTree && e2 instanceof GitModelTree) || (e1 instanceof GitModelBlob && e2 instanceof GitModelBlob))   return super.compare(viewer,e1,e2);
  if (e1 instanceof GitModelTree && e2 instanceof GitModelCommit)   return 1;
  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);
}