Program: 97465
Project: 97465
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());
        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<? extends IAtsUser> updatedAssigees=getToAssignees(awa,toState);
          awa.getStateMgr().transitionHelper(updatedAssigees,fromState,toState,completedCancellationReason);
          if (awa.isValidationRequired() && awa.isTeamWorkflow()) {
            ValidateReviewManager.createValidateReview((TeamWorkFlowArtifact)awa,false,transitionDate,transitionUser,transaction);
          }
          awa.persist(transaction);
          awa.transitioned(fromState,toState,updatedAssigees,transaction);
          for (          ITransitionListener listener : TransitionListeners.getListeners()) {
            listener.transitioned(awa,fromState,toState,updatedAssigees,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,toState);
          }
 else           if (fromState.getStateType().isCompletedState()) {
            logWorkflowUnCompletedEvent(awa,toState);
          }
          if (toState.getStateType().isCancelledState()) {
            logWorkflowCancelledEvent(awa,fromState,toState,completedCancellationReason,transitionDate,transitionUser);
          }
 else           if (toState.getStateType().isCompletedState()) {
            logWorkflowCompletedEvent(awa,fromState,toState,completedCancellationReason,transitionDate,transitionUser);
          }
 else {
            logStateCompletedEvent(awa,awa.getStateMgr().getCurrentStateName(),completedCancellationReason,transitionDate,transitionUser);
          }
          logStateStartedEvent(awa,toState,transitionDate,transitionUser);
          List<? extends IAtsUser> updatedAssigees=getToAssignees(awa,toState);
          awa.getStateMgr().transitionHelper(updatedAssigees,fromState,toState,completedCancellationReason);
          if (awa.isValidationRequired() && awa.isTeamWorkflow()) {
            ValidateReviewManager.createValidateReview((TeamWorkFlowArtifact)awa,false,transitionDate,transitionUser,transaction);
          }
          awa.persist(transaction);
          awa.transitioned(fromState,toState,updatedAssigees,transaction);
          for (          ITransitionListener listener : TransitionListeners.getListeners()) {
            listener.transitioned(awa,fromState,toState,updatedAssigees,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));
  }
}