10
10
import pex .utils .exceptions .BugFoundException ;
11
11
import pex .utils .misc .Assert ;
12
12
import pex .utils .serialize .SerializableBiFunction ;
13
- import pex .values .PEvent ;
13
+ import pex .values .Event ;
14
14
import pex .values .PMachineValue ;
15
15
import pex .values .PMessage ;
16
16
import pex .values .PValue ;
@@ -87,7 +87,7 @@ public PMachine(String name, int id, State startState, State... states) {
87
87
88
88
// register create machine handler
89
89
startState .registerHandlers (
90
- new EventHandler (PEvent .createMachine ) {
90
+ new EventHandler (Event .createMachine ) {
91
91
@ Override
92
92
public void handleEvent (PMachine target , PValue <?> payload ) {
93
93
assert (!target .isStarted ());
@@ -364,7 +364,7 @@ public PMachineValue create(
364
364
PValue <?> payload ) {
365
365
Class <? extends PMachine > trueMachineType = PExGlobal .getModel ().getTestDriver ().interfaceMap .getOrDefault (machineType , machineType );
366
366
PMachine machine = PExGlobal .getScheduler ().allocateMachine (trueMachineType );
367
- PMessage msg = new PMessage (PEvent .createMachine , machine , payload );
367
+ PMessage msg = new PMessage (Event .createMachine , machine , payload );
368
368
sendBuffer .add (msg );
369
369
return new PMachineValue (machine );
370
370
}
@@ -384,10 +384,10 @@ public PMachineValue create(
384
384
* Send an event to a target machine
385
385
*
386
386
* @param target Target machine
387
- * @param event PEvent to send
387
+ * @param event Event to send
388
388
* @param payload Payload corresponding to the event
389
389
*/
390
- public void sendEvent (PMachineValue target , PEvent event , PValue <?> payload ) {
390
+ public void sendEvent (PMachineValue target , Event event , PValue <?> payload ) {
391
391
if (PValue .isEqual (target , null )) {
392
392
throw new BugFoundException ("Machine in send event cannot be null." );
393
393
}
@@ -481,7 +481,7 @@ public void clearBlocked() {
481
481
blockedBy = null ;
482
482
}
483
483
484
- public boolean isDeferred (PEvent event ) {
484
+ public boolean isDeferred (Event event ) {
485
485
if (currentState .isDeferred (event )) {
486
486
return true ;
487
487
}
@@ -553,7 +553,7 @@ void processEvent(PMessage message) {
553
553
* @param message Message to process
554
554
*/
555
555
void runEvent (PMessage message ) {
556
- PEvent event = message .getEvent ();
556
+ Event event = message .getEvent ();
557
557
if (isBlocked ()) {
558
558
PContinuation currBlockedBy = this .blockedBy ;
559
559
clearBlocked ();
@@ -583,7 +583,7 @@ void runEvent(PMessage message) {
583
583
* @param event Event to raise
584
584
* @param payload Payload
585
585
*/
586
- public void raiseEvent (PEvent event , PValue <?> payload ) {
586
+ public void raiseEvent (Event event , PValue <?> payload ) {
587
587
// do nothing if already halted
588
588
if (isHalted ()) {
589
589
return ;
@@ -610,7 +610,7 @@ public void raiseEvent(PEvent event, PValue<?> payload) {
610
610
*
611
611
* @param event Event to raise
612
612
*/
613
- public void raiseEvent (PEvent event ) {
613
+ public void raiseEvent (Event event ) {
614
614
raiseEvent (event , null );
615
615
}
616
616
@@ -676,7 +676,7 @@ public void enterNewState(State newState, PValue<?> payload) {
676
676
newState .entry (this , payload );
677
677
}
678
678
679
- private void addObservedEvent (PEvent newEvent ) {
679
+ private void addObservedEvent (Event newEvent ) {
680
680
for (String happenedBeforeEvent : observedEvents ) {
681
681
happensBeforePairs .add (String .format ("(%s,%s)" , happenedBeforeEvent , newEvent ));
682
682
}
0 commit comments