Program: 97610
Project: 97610
Buggy source:
/** 
 * Process transition and persist changes to given skynet transaction
 * @return Result.isFalse if failure
 */
public void handleTransition(TransitionResults results){
  try {
    if (transaction == null) {
      transaction=TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),helper.getName());
    }
    for (    AbstractWorkflowArtifact awa : helper.getAwas()) {
      try {
        IAtsStateDefinition fromState=awa.getStateDefinition();
        IAtsStateDefinition toState=awa.getStateDefinitionByName(helper.getToStateName());
        Date transitionDate=getTransitionOnDate();
        IAtsUser transitionUser=getTransitionAsUser();
        if (fromState.getStateType().isCancelledState()) {
          logWorkflowUnCancelledEvent(awa);
        }
 else         if (fromState.getStateType().isCompletedState()) {
          logWorkflowUnCompletedEvent(awa);
        }
        if (toState.getStateType().isCancelledState()) {
          logWorkflowCancelledEvent(awa,awa.getStateMgr().getCurrentStateName(),completedCancellationReason,transitionDate,transitionUser);
        }
 else         if (toState.getStateType().isCompletedState()) {
          logWorkflowCompletedEvent(awa,awa.getStateMgr().getCurrentStateName(),completedCancellationReason,transitionDate,transitionUser);
        }
 else {
          logStateCompletedEvent(awa,awa.getStateMgr().getCurrentStateName(),completedCancellationReason,transitionDate,transitionUser);
        }
        logStateStartedEvent(awa,toState,transitionDate,transitionUser);
        List<IAtsUser> toAssignees=new LinkedList<IAtsUser>();
        if (!toState.getStateType().isCompletedOrCancelledState()) {
          if (helper.getToAssignees() != null) {
            toAssignees.addAll(helper.getToAssignees());
          }
          if (toAssignees.contains(AtsUsers.getUnAssigned())) {
            toAssignees.remove(AtsUsers.getUnAssigned());
            toAssignees.add(AtsUsersClient.getUser());
          }
          if (toAssignees.isEmpty()) {
            toAssignees.add(AtsUsersClient.getUser());
          }
        }
        awa.getStateMgr().transitionHelper(toAssignees,fromState,toState,completedCancellationReason);
        if (awa.isValidationRequired() && awa.isTeamWorkflow()) {
          ValidateReviewManager.createValidateReview((TeamWorkFlowArtifact)awa,false,transitionDate,transitionUser,transaction);
        }
        awa.persist(transaction);
        awa.transitioned(fromState,toState,helper.getToAssignees(),transaction);
        for (        ITransitionListener listener : TransitionListeners.getListeners()) {
          listener.transitioned(awa,fromState,toState,helper.getToAssignees(),transaction);
        }
        if (toState.getStateType().isCompletedOrCancelledState()) {
          awa.clearImplementersCache();
        }
      }
 catch (      Exception ex) {
        results.addResult(awa,new TransitionResult(String.format("String_Node_Str",helper.getName()),ex));
      }
    }
  }
 catch (  Exception ex) {
    results.addResult(new TransitionResult(String.format("String_Node_Str",helper.getName()),ex));
  }
}

Fixed version (ground truth):
/** 
 * Process transition and persist changes to given skynet transaction
 * @return Result.isFalse if failure
 */
public void handleTransition(TransitionResults results){
  try {
    if (transaction == null) {
      transaction=TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),helper.getName());
    }
    for (    AbstractWorkflowArtifact awa : helper.getAwas()) {
      try {
        IAtsStateDefinition fromState=awa.getStateDefinition();
        IAtsStateDefinition toState=awa.getStateDefinitionByName(helper.getToStateName());
        if (!fromState.equals(toState)) {
          Date transitionDate=getTransitionOnDate();
          IAtsUser transitionUser=getTransitionAsUser();
          if (fromState.getStateType().isCancelledState()) {
            logWorkflowUnCancelledEvent(awa);
          }
 else           if (fromState.getStateType().isCompletedState()) {
            logWorkflowUnCompletedEvent(awa);
          }
          if (toState.getStateType().isCancelledState()) {
            logWorkflowCancelledEvent(awa,awa.getStateMgr().getCurrentStateName(),completedCancellationReason,transitionDate,transitionUser);
          }
 else           if (toState.getStateType().isCompletedState()) {
            logWorkflowCompletedEvent(awa,awa.getStateMgr().getCurrentStateName(),completedCancellationReason,transitionDate,transitionUser);
          }
 else {
            logStateCompletedEvent(awa,awa.getStateMgr().getCurrentStateName(),completedCancellationReason,transitionDate,transitionUser);
          }
          logStateStartedEvent(awa,toState,transitionDate,transitionUser);
          List<IAtsUser> toAssignees=new LinkedList<IAtsUser>();
          if (!toState.getStateType().isCompletedOrCancelledState()) {
            if (helper.getToAssignees() != null) {
              toAssignees.addAll(helper.getToAssignees());
            }
            if (toAssignees.contains(AtsUsers.getUnAssigned())) {
              toAssignees.remove(AtsUsers.getUnAssigned());
              toAssignees.add(AtsUsersClient.getUser());
            }
            if (toAssignees.isEmpty()) {
              toAssignees.add(AtsUsersClient.getUser());
            }
          }
          awa.getStateMgr().transitionHelper(toAssignees,fromState,toState,completedCancellationReason);
          if (awa.isValidationRequired() && awa.isTeamWorkflow()) {
            ValidateReviewManager.createValidateReview((TeamWorkFlowArtifact)awa,false,transitionDate,transitionUser,transaction);
          }
          awa.persist(transaction);
          awa.transitioned(fromState,toState,helper.getToAssignees(),transaction);
          for (          ITransitionListener listener : TransitionListeners.getListeners()) {
            listener.transitioned(awa,fromState,toState,helper.getToAssignees(),transaction);
          }
          if (toState.getStateType().isCompletedOrCancelledState()) {
            awa.clearImplementersCache();
          }
        }
      }
 catch (      Exception ex) {
        results.addResult(awa,new TransitionResult(String.format("String_Node_Str",helper.getName()),ex));
      }
    }
  }
 catch (  Exception ex) {
    results.addResult(new TransitionResult(String.format("String_Node_Str",helper.getName()),ex));
  }
}