Program: 89892
Project: 89892
Buggy source:
private void setStateMachine(){
  _stateMachine=new StateMachine2<State,VirtualMachine.Event,VMInstanceVO>();
  _stateMachine.addTransition(null,VirtualMachine.Event.CreateRequested,State.Creating);
  _stateMachine.addTransition(State.Creating,VirtualMachine.Event.OperationSucceeded,State.Stopped);
  _stateMachine.addTransition(State.Creating,VirtualMachine.Event.OperationFailed,State.Error);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.StartRequested,State.Starting);
  _stateMachine.addTransition(State.Error,VirtualMachine.Event.DestroyRequested,State.Expunging);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.DestroyRequested,State.Destroyed);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.StopRequested,State.Stopped);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.OperationFailed,State.Error);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.OperationRetry,State.Starting);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.OperationSucceeded,State.Running);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.OperationFailed,State.Stopped);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.AgentReportRunning,State.Running);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Destroyed,VirtualMachine.Event.RecoveryRequested,State.Stopped);
  _stateMachine.addTransition(State.Destroyed,VirtualMachine.Event.ExpungeOperation,State.Expunging);
  _stateMachine.addTransition(State.Creating,VirtualMachine.Event.MigrationRequested,State.Destroyed);
  _stateMachine.addTransition(State.Running,VirtualMachine.Event.MigrationRequested,State.Migrating);
  _stateMachine.addTransition(State.Running,VirtualMachine.Event.AgentReportRunning,State.Running);
  _stateMachine.addTransition(State.Running,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Running,VirtualMachine.Event.StopRequested,State.Stopping);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.MigrationRequested,State.Migrating);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.OperationSucceeded,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.OperationFailed,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.MigrationFailedOnSource,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.MigrationFailedOnDest,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.AgentReportRunning,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.OperationSucceeded,State.Stopped);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.OperationFailed,State.Running);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.AgentReportRunning,State.Running);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.StopRequested,State.Stopping);
  _stateMachine.addTransition(State.Expunging,VirtualMachine.Event.OperationFailed,State.Expunging);
  _stateMachine.addTransition(State.Expunging,VirtualMachine.Event.ExpungeOperation,State.Expunging);
  _stateMachine.registerListeners(_stateListner);
}

Fixed version (ground truth):
private void setStateMachine(){
  _stateMachine=new StateMachine2<State,VirtualMachine.Event,VMInstanceVO>();
  _stateMachine.addTransition(null,VirtualMachine.Event.CreateRequested,State.Creating);
  _stateMachine.addTransition(State.Creating,VirtualMachine.Event.OperationSucceeded,State.Stopped);
  _stateMachine.addTransition(State.Creating,VirtualMachine.Event.OperationFailed,State.Error);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.StartRequested,State.Starting);
  _stateMachine.addTransition(State.Error,VirtualMachine.Event.DestroyRequested,State.Expunging);
  _stateMachine.addTransition(State.Error,VirtualMachine.Event.ExpungeOperation,State.Expunging);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.DestroyRequested,State.Destroyed);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.StopRequested,State.Stopped);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Stopped,VirtualMachine.Event.OperationFailed,State.Error);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.OperationRetry,State.Starting);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.OperationSucceeded,State.Running);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.OperationFailed,State.Stopped);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.AgentReportRunning,State.Running);
  _stateMachine.addTransition(State.Starting,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Destroyed,VirtualMachine.Event.RecoveryRequested,State.Stopped);
  _stateMachine.addTransition(State.Destroyed,VirtualMachine.Event.ExpungeOperation,State.Expunging);
  _stateMachine.addTransition(State.Creating,VirtualMachine.Event.MigrationRequested,State.Destroyed);
  _stateMachine.addTransition(State.Running,VirtualMachine.Event.MigrationRequested,State.Migrating);
  _stateMachine.addTransition(State.Running,VirtualMachine.Event.AgentReportRunning,State.Running);
  _stateMachine.addTransition(State.Running,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Running,VirtualMachine.Event.StopRequested,State.Stopping);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.MigrationRequested,State.Migrating);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.OperationSucceeded,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.OperationFailed,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.MigrationFailedOnSource,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.MigrationFailedOnDest,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.AgentReportRunning,State.Running);
  _stateMachine.addTransition(State.Migrating,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.OperationSucceeded,State.Stopped);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.OperationFailed,State.Running);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.AgentReportRunning,State.Running);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.AgentReportStopped,State.Stopped);
  _stateMachine.addTransition(State.Stopping,VirtualMachine.Event.StopRequested,State.Stopping);
  _stateMachine.addTransition(State.Expunging,VirtualMachine.Event.OperationFailed,State.Expunging);
  _stateMachine.addTransition(State.Expunging,VirtualMachine.Event.ExpungeOperation,State.Expunging);
  _stateMachine.registerListeners(_stateListner);
}