Program: 87712
Project: 87712
Buggy source:
/** 
 * Checks the transition of the execution state and outputs an error in case of an unexpected state transition.
 * @param jobManager <code>true</code> to indicate the method is called by the job manager, <code>false/<code> to indicate it is called by a task manager
 * @param taskName the name of the task whose execution has changed
 * @param oldState the old execution state
 * @param newState the new execution state
 */
public static void checkTransition(final boolean jobManager,final String taskName,final ExecutionState oldState,final ExecutionState newState){
  LOG.info((jobManager ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + oldState+ "String_Node_Str"+ newState+ "String_Node_Str"+ taskName+ "String_Node_Str"+ System.currentTimeMillis());
  boolean unexpectedStateChange=true;
  if (oldState == ExecutionState.CREATED && newState == ExecutionState.SCHEDULED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.SCHEDULED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.ASSIGNED && newState == ExecutionState.READY) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.READY && newState == ExecutionState.STARTING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.STARTING && newState == ExecutionState.RUNNING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.RUNNING && newState == ExecutionState.FINISHING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHING && newState == ExecutionState.FINISHED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FAILED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FAILED && newState == ExecutionState.CREATED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHED && newState == ExecutionState.CREATED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.CANCELED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.CANCELED && newState == ExecutionState.CREATED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.STARTING && newState == ExecutionState.REPLAYING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.REPLAYING && newState == ExecutionState.FINISHING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.CREATED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.SCHEDULED && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.ASSIGNED && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.READY && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.STARTING && newState == ExecutionState.FAILED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.RUNNING && newState == ExecutionState.FAILED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHING && newState == ExecutionState.FAILED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.REPLAYING && newState == ExecutionState.FAILED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.RUNNING && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHING && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.RUNNING && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHING && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.CANCELING && newState == ExecutionState.CANCELED) {
    unexpectedStateChange=false;
  }
  if (unexpectedStateChange) {
    try {
      throw new IllegalStateException("String_Node_Str" + oldState + "String_Node_Str"+ newState);
    }
 catch (    IllegalStateException e) {
      LOG.error(StringUtils.stringifyException(e));
    }
  }
}

Fixed version (ground truth):
/** 
 * Checks the transition of the execution state and outputs an error in case of an unexpected state transition.
 * @param jobManager <code>true</code> to indicate the method is called by the job manager, <code>false/<code> to indicate it is called by a task manager
 * @param taskName the name of the task whose execution has changed
 * @param oldState the old execution state
 * @param newState the new execution state
 */
public static void checkTransition(final boolean jobManager,final String taskName,final ExecutionState oldState,final ExecutionState newState){
  LOG.info((jobManager ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + oldState+ "String_Node_Str"+ newState+ "String_Node_Str"+ taskName+ "String_Node_Str"+ System.currentTimeMillis());
  boolean unexpectedStateChange=true;
  if (oldState == ExecutionState.CREATED && newState == ExecutionState.SCHEDULED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.SCHEDULED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.ASSIGNED && newState == ExecutionState.READY) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.READY && newState == ExecutionState.STARTING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.STARTING && newState == ExecutionState.RUNNING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.RUNNING && newState == ExecutionState.FINISHING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHING && newState == ExecutionState.FINISHED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FAILED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FAILED && newState == ExecutionState.CREATED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHED && newState == ExecutionState.CREATED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.CANCELED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.CANCELED && newState == ExecutionState.CREATED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.STARTING && newState == ExecutionState.REPLAYING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.REPLAYING && newState == ExecutionState.FINISHING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.CREATED && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.SCHEDULED && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.ASSIGNED && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.READY && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.STARTING && newState == ExecutionState.FAILED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.RUNNING && newState == ExecutionState.FAILED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHING && newState == ExecutionState.FAILED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.REPLAYING && newState == ExecutionState.FAILED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.RUNNING && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.REPLAYING && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHING && newState == ExecutionState.ASSIGNED) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.RUNNING && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.FINISHING && newState == ExecutionState.CANCELING) {
    unexpectedStateChange=false;
  }
  if (oldState == ExecutionState.CANCELING && newState == ExecutionState.CANCELED) {
    unexpectedStateChange=false;
  }
  if (unexpectedStateChange) {
    try {
      throw new IllegalStateException("String_Node_Str" + oldState + "String_Node_Str"+ newState);
    }
 catch (    IllegalStateException e) {
      LOG.error(StringUtils.stringifyException(e));
    }
  }
}