public synchronized boolean canChange ( DebugState newState ) { switch ( newState ) { case Disconnected : return ! inState ( DebugState . Terminated ) && ! inState ( DebugState . Disconnected ) ; case Terminated : return ! inState ( DebugState . Terminated ) ; case Suspended : return inState ( DebugState . Resumed ) ; // states.size()==1 && case IsStepping : return ( ! inState ( DebugState . Terminated ) || ! inState ( DebugState . Disconnected ) || ! inState ( DebugState . Deadlocked ) ) && inState ( DebugState . Suspended ) ; case Resumed : return states . size ( ) == 0 || inState ( DebugState . IsStepping ) || inState ( DebugState . Suspended ) ; default : return false ; } }
Checks if a change to the newState is allowed