Program: 97514
Project: 97514
Buggy source:
private static void handleTransitionToSelected(final String toStateName,final Set<AbstractWorkflowArtifact> awas){
  final ITransitionHelper helper=new TransitionHelperAdapter(){
    @Override public Result handleExtraHoursSpent(){
      final Result result=new Result(true,"String_Node_Str");
      Displays.ensureInDisplayThread(new Runnable(){
        @Override public void run(){
          IAtsStateDefinition toStateDef=awas.iterator().next().getWorkDefinition().getStateByName(toStateName);
          boolean showPercentCompleted=!toStateDef.getStateType().isCompletedOrCancelledState();
          TransitionStatusData data=new TransitionStatusData(getAwas(),showPercentCompleted);
          if (toStateDef.getRecommendedPercentComplete() != null) {
            data.setDefaultPercent(toStateDef.getRecommendedPercentComplete());
            data.setPercent(100);
          }
 else           if (toStateDef.getStateType().isCompletedOrCancelledState()) {
            data.setDefaultPercent(100);
            data.setPercent(100);
          }
          String title=null;
          String message=null;
          if (data.isPercentRequired()) {
            title="String_Node_Str";
            message="String_Node_Str";
          }
 else {
            title="String_Node_Str";
            message="String_Node_Str";
          }
          TransitionStatusDialog dialog=new TransitionStatusDialog(title,message,data);
          int dialogResult=dialog.open();
          if (dialogResult == 0) {
            try {
              SMAPromptChangeStatus.performChangeStatus(awas,null,data.getAdditionalHours(),data.getPercent(),data.isSplitHoursBetweenItems(),true);
            }
 catch (            OseeCoreException ex) {
              OseeLog.log(Activator.class,Level.SEVERE,ex);
              result.set(false);
              result.setTextWithFormat("String_Node_Str",getToStateName());
            }
          }
 else {
            result.setCancelled(true);
          }
        }
      }
,true);
      return result;
    }
    @Override public String getToStateName(){
      return toStateName;
    }
    @Override public Collection<? extends IAtsUser> getToAssignees(){
      return Collections.emptyList();
    }
    @Override public String getName(){
      return "String_Node_Str" + getToStateName();
    }
    @Override public Result getCompleteOrCancellationReason(){
      final Result result=new Result(false,"String_Node_Str");
      Displays.ensureInDisplayThread(new Runnable(){
        @Override public void run(){
          AbstractWorkflowArtifact awa=getAwas().iterator().next();
          IAtsStateDefinition stateDef=awa.getStateDefinitionByName(getToStateName());
          if (stateDef.getStateType().isCancelledState()) {
            EntryDialog dialog=new EntryDialog("String_Node_Str","String_Node_Str");
            if (dialog.open() != 0) {
              result.setCancelled(true);
            }
 else {
              result.setText(dialog.getEntry());
              result.set(true);
            }
          }
        }
      }
,true);
      return result;
    }
    @Override public Collection<AbstractWorkflowArtifact> getAwas(){
      return awas;
    }
  }
;
  final TransitionToOperation operation=new TransitionToOperation(helper);
  Operations.executeAsJob(operation,true,Job.SHORT,new JobChangeAdapter(){
    @Override public void done(    IJobChangeEvent event){
      TransitionResults results=operation.getResults();
      if (!results.isEmpty()) {
        results.logExceptions();
        if (helper.getAwas().size() == 1) {
          String resultStr=results.getResultString();
          AWorkbench.popup(MessageType.Error,"String_Node_Str",resultStr);
        }
 else {
          XResultData resultData=results.getResultXResultData();
          XResultDataUI.report(resultData,"String_Node_Str");
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private static void handleTransitionToSelected(final String toStateName,final Set<AbstractWorkflowArtifact> awas){
  final ITransitionHelper helper=new TransitionHelperAdapter(){
    @Override public Result handleExtraHoursSpent(){
      final Result result=new Result(true,"String_Node_Str");
      Displays.ensureInDisplayThread(new Runnable(){
        @Override public void run(){
          IAtsStateDefinition toStateDef=awas.iterator().next().getWorkDefinition().getStateByName(toStateName);
          boolean showPercentCompleted=!toStateDef.getStateType().isCompletedOrCancelledState();
          TransitionStatusData data=new TransitionStatusData(getAwas(),showPercentCompleted);
          if (toStateDef.getRecommendedPercentComplete() != null) {
            data.setDefaultPercent(toStateDef.getRecommendedPercentComplete());
            data.setPercent(100);
          }
 else           if (toStateDef.getStateType().isCompletedOrCancelledState()) {
            data.setDefaultPercent(100);
            data.setPercent(100);
          }
          String title=null;
          String message=null;
          if (data.isPercentRequired()) {
            title="String_Node_Str";
            message="String_Node_Str";
          }
 else {
            title="String_Node_Str";
            message="String_Node_Str";
          }
          TransitionStatusDialog dialog=new TransitionStatusDialog(title,message,data);
          int dialogResult=dialog.open();
          if (dialogResult == 0) {
            try {
              SMAPromptChangeStatus.performChangeStatus(awas,null,data.getAdditionalHours(),data.getPercent(),data.isSplitHoursBetweenItems(),true);
            }
 catch (            OseeCoreException ex) {
              OseeLog.log(Activator.class,Level.SEVERE,ex);
              result.set(false);
              result.setTextWithFormat("String_Node_Str",getToStateName());
            }
          }
 else {
            result.setCancelled(true);
          }
        }
      }
,true);
      return result;
    }
    @Override public String getToStateName(){
      return toStateName;
    }
    @Override public Collection<? extends IAtsUser> getToAssignees(    AbstractWorkflowArtifact awa) throws OseeCoreException {
      return awa.getAssignees();
    }
    @Override public String getName(){
      return "String_Node_Str" + getToStateName();
    }
    @Override public Result getCompleteOrCancellationReason(){
      final Result result=new Result(false,"String_Node_Str");
      Displays.ensureInDisplayThread(new Runnable(){
        @Override public void run(){
          AbstractWorkflowArtifact awa=getAwas().iterator().next();
          IAtsStateDefinition stateDef=awa.getStateDefinitionByName(getToStateName());
          if (stateDef.getStateType().isCancelledState()) {
            EntryDialog dialog=new EntryDialog("String_Node_Str","String_Node_Str");
            if (dialog.open() != 0) {
              result.setCancelled(true);
            }
 else {
              result.setText(dialog.getEntry());
              result.set(true);
            }
          }
        }
      }
,true);
      return result;
    }
    @Override public Collection<AbstractWorkflowArtifact> getAwas(){
      return awas;
    }
  }
;
  final TransitionToOperation operation=new TransitionToOperation(helper);
  Operations.executeAsJob(operation,true,Job.SHORT,new JobChangeAdapter(){
    @Override public void done(    IJobChangeEvent event){
      TransitionResults results=operation.getResults();
      if (!results.isEmpty()) {
        results.logExceptions();
        if (helper.getAwas().size() == 1) {
          String resultStr=results.getResultString();
          AWorkbench.popup(MessageType.Error,"String_Node_Str",resultStr);
        }
 else {
          XResultData resultData=results.getResultXResultData();
          XResultDataUI.report(resultData,"String_Node_Str");
        }
      }
    }
  }
);
}