Program: 96747
Project: 96747
Buggy source:
/** 
 * Either return a single commit transaction or user must choose from a list of valid commit transactions
 */
public static TransactionToken getTransactionIdOrPopupChoose(TeamWorkFlowArtifact teamArt,String title,boolean showMergeManager) throws OseeCoreException {
  Collection<TransactionToken> transactionIds=new HashSet<>();
  Collection<TransactionRecord> transactions=AtsClientService.get().getBranchService().getTransactionIds(teamArt,showMergeManager);
  final Map<IOseeBranch,TransactionId> branchToTx=new LinkedHashMap<>();
  if (transactionIds.size() == 1) {
    return transactionIds.iterator().next();
  }
  for (  TransactionRecord id : transactions) {
    boolean workingBranch=BranchManager.getType(id).isWorkingBranch();
    BranchState state=BranchManager.getState(id.getBranch());
    if (!workingBranch || !(state.isRebaselined() && state.isCommitted())) {
      IOseeBranch branch=BranchManager.getBranchToken(id.getBranch());
      branchToTx.put(branch,id);
    }
  }
  ViewerSorter sorter=new ViewerSorter(){
    @Override public int compare(    Viewer viewer,    Object e1,    Object e2){
      if (e1 == null || e2 == null) {
        return 0;
      }
      Long b1=((IOseeBranch)e1).getId();
      Long b2=((IOseeBranch)e1).getId();
      if (b1 > b2) {
        return -1;
      }
      if (b2 > b1) {
        return 1;
      }
      return 0;
    }
  }
;
  FilteredTreeDialog dialog=new FilteredTreeDialog(title,"String_Node_Str",new ArrayTreeContentProvider(),new NameLabelProvider(),sorter);
  dialog.setInput(branchToTx.keySet());
  if (dialog.open() == 0) {
    IOseeBranch branch=dialog.getSelectedFirst();
    if (branch != null) {
      TransactionId id=branchToTx.get(branch);
      return TransactionToken.valueOf(id,branch);
    }
  }
  return TransactionToken.SENTINEL;
}

Fixed version (ground truth):
/** 
 * Either return a single commit transaction or user must choose from a list of valid commit transactions
 */
public static TransactionToken getTransactionIdOrPopupChoose(TeamWorkFlowArtifact teamArt,String title,boolean showMergeManager) throws OseeCoreException {
  Collection<TransactionRecord> transactions=AtsClientService.get().getBranchService().getTransactionIds(teamArt,showMergeManager);
  final Map<IOseeBranch,TransactionId> branchToTx=new LinkedHashMap<>();
  if (transactions.size() == 1) {
    return transactions.iterator().next();
  }
  for (  TransactionRecord id : transactions) {
    boolean workingBranch=BranchManager.getType(id).isWorkingBranch();
    BranchState state=BranchManager.getState(id.getBranch());
    if (!workingBranch || !(state.isRebaselined() && state.isCommitted())) {
      IOseeBranch branch=BranchManager.getBranchToken(id.getBranch());
      branchToTx.put(branch,id);
    }
  }
  ViewerSorter sorter=new ViewerSorter(){
    @Override public int compare(    Viewer viewer,    Object e1,    Object e2){
      if (e1 == null || e2 == null) {
        return 0;
      }
      Long b1=((IOseeBranch)e1).getId();
      Long b2=((IOseeBranch)e1).getId();
      if (b1 > b2) {
        return -1;
      }
      if (b2 > b1) {
        return 1;
      }
      return 0;
    }
  }
;
  FilteredTreeDialog dialog=new FilteredTreeDialog(title,"String_Node_Str",new ArrayTreeContentProvider(),new NameLabelProvider(),sorter);
  dialog.setInput(branchToTx.keySet());
  if (dialog.open() == 0) {
    IOseeBranch branch=dialog.getSelectedFirst();
    if (branch != null) {
      TransactionId id=branchToTx.get(branch);
      return TransactionToken.valueOf(id,branch);
    }
  }
  return TransactionToken.SENTINEL;
}