I ran into a case where the machine constructor is called unexpectedly. Here is the code:
| Code: : |
package examples;
public machine ConstructorTest1 {
initial state S1;
state S2 : concurrent {
state SS1: Example0001();
state SS2[2]: Example0001();
}
transition S1 -
-> [ S2.SS1, S2.SS2.NEW ];
}
|
And Example0001 is modified from the one in SVN slightly:
| Code: : |
public machine Example0001 {
public Example0001() {
System.out.println("We are all born mad. Some remain so.");
}
initial state S1;
state S2;
transition S1 - / System.out.println("Hello World!") -> S2;
}
|
When run, the Example0001 constructor is called three times, where I would expect only twice: once for S2.SS1, and once for S2.SS2[0].
| Code: : |
$ ./runExample ConstructorTest1.ech
*** Running ConstructorTest1
We are all born mad. Some remain so.
We are all born mad. Some remain so.
We are all born mad. Some remain so.
Hello World!
Hello World!
*** Completed
|
Wonder why.
Thanks
Eric