Program: 14488
Project: 14488
Buggy source:
private Callable<Boolean> handleStateTransition(final VmState newState,final VmState oldState,final VmState olderState){
  Callable<Boolean> action=null;
  LOG.info(String.format("String_Node_Str",this.getVmInstance().getInstanceId(),oldState,newState,olderState));
  if (VmStateSet.RUN.contains(oldState) && VmStateSet.NOT_RUNNING.contains(newState)) {
    this.getVmInstance().setState(newState);
    action=this.cleanUpRunnable();
  }
 else   if (VmState.PENDING.equals(oldState) && VmState.RUNNING.equals(newState)) {
    this.getVmInstance().setState(newState);
    if (VmState.STOPPED.equals(olderState)) {
      this.restoreVolumeState();
    }
  }
 else   if (VmState.PENDING.equals(oldState) && VmState.TERMINATED.equals(newState) && VmState.STOPPED.equals(olderState)) {
    this.getVmInstance().setState(VmState.STOPPED);
    action=this.cleanUpRunnable();
  }
 else   if (VmState.STOPPED.equals(oldState) && VmState.TERMINATED.equals(newState)) {
    this.getVmInstance().setState(VmState.TERMINATED);
    action=this.cleanUpRunnable();
  }
 else   if (VmStateSet.EXPECTING_TEARDOWN.contains(oldState) && VmStateSet.RUN.contains(newState)) {
    this.getVmInstance().setState(oldState);
  }
 else   if (VmStateSet.EXPECTING_TEARDOWN.contains(oldState) && VmStateSet.TORNDOWN.contains(newState)) {
    if (VmState.SHUTTING_DOWN.equals(oldState)) {
      this.getVmInstance().setState(VmState.TERMINATED);
    }
 else {
      this.getVmInstance().setState(VmState.STOPPED);
    }
    action=this.cleanUpRunnable();
  }
 else   if (VmState.STOPPED.equals(oldState) && VmState.PENDING.equals(newState)) {
    this.getVmInstance().setState(VmState.PENDING);
  }
 else   if (VmStateSet.RUN.contains(oldState) && VmStateSet.NOT_RUNNING.contains(newState)) {
    this.getVmInstance().setState(newState);
    action=this.cleanUpRunnable();
  }
 else {
    this.getVmInstance().setState(newState);
  }
  try {
    this.getVmInstance().store();
  }
 catch (  final Exception ex1) {
    LOG.error(ex1,ex1);
  }
  return action;
}

Fixed version (ground truth):
private Callable<Boolean> handleStateTransition(final VmState newState,final VmState oldState,final VmState olderState){
  Callable<Boolean> action=null;
  LOG.info(String.format("String_Node_Str",this.getVmInstance().getInstanceId(),oldState,newState,olderState));
  if (VmStateSet.RUN.contains(oldState) && VmStateSet.NOT_RUNNING.contains(newState)) {
    this.getVmInstance().setState(newState);
    action=this.cleanUpRunnable();
  }
 else   if (VmState.PENDING.equals(oldState) && VmState.RUNNING.equals(newState)) {
    this.getVmInstance().setState(newState);
    if (VmState.STOPPED.equals(olderState)) {
      this.restoreVolumeState();
    }
  }
 else   if (VmState.PENDING.equals(oldState) && VmState.TERMINATED.equals(newState) && VmState.STOPPED.equals(olderState)) {
    this.getVmInstance().setState(VmState.STOPPED);
    this.getVmInstance().updatePublicAddress(this.getVmInstance().getPrivateAddress());
    action=this.cleanUpRunnable();
  }
 else   if (VmState.STOPPED.equals(oldState) && VmState.TERMINATED.equals(newState)) {
    this.getVmInstance().setState(VmState.TERMINATED);
    this.getVmInstance().updatePublicAddress(this.getVmInstance().getPrivateAddress());
    action=this.cleanUpRunnable();
  }
 else   if (VmStateSet.EXPECTING_TEARDOWN.contains(oldState) && VmStateSet.RUN.contains(newState)) {
    this.getVmInstance().setState(oldState);
  }
 else   if (VmStateSet.EXPECTING_TEARDOWN.contains(oldState) && VmStateSet.TORNDOWN.contains(newState)) {
    if (VmState.SHUTTING_DOWN.equals(oldState)) {
      this.getVmInstance().setState(VmState.TERMINATED);
      this.getVmInstance().updatePublicAddress(this.getVmInstance().getPrivateAddress());
    }
 else {
      this.getVmInstance().setState(VmState.STOPPED);
      this.getVmInstance().updatePublicAddress(this.getVmInstance().getPrivateAddress());
    }
    action=this.cleanUpRunnable();
  }
 else   if (VmState.STOPPED.equals(oldState) && VmState.PENDING.equals(newState)) {
    this.getVmInstance().setState(VmState.PENDING);
  }
 else   if (VmStateSet.RUN.contains(oldState) && VmStateSet.NOT_RUNNING.contains(newState)) {
    this.getVmInstance().setState(newState);
    action=this.cleanUpRunnable();
  }
 else {
    this.getVmInstance().setState(newState);
  }
  try {
    this.getVmInstance().store();
  }
 catch (  final Exception ex1) {
    LOG.error(ex1,ex1);
  }
  return action;
}