File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
liquidjava-example/src/main/java/testSuite/classes/state_refinement_no_to_typestate_correct Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ package testSuite .classes .state_refinement_no_to_typestate_correct ;
2+
3+ import liquidjava .specification .StateRefinement ;
4+ import liquidjava .specification .StateSet ;
5+
6+ @ StateSet ({"empty" , "one" , "many" })
7+ public class Counter {
8+
9+ @ StateRefinement (to ="empty(this)" )
10+ public Counter () {}
11+
12+ @ StateRefinement (from ="empty(this)" , to ="one(this)" )
13+ public void addFirst () {}
14+
15+ @ StateRefinement (from ="one(this)" , to ="many(this)" )
16+ public void addSecond () {}
17+
18+ @ StateRefinement (from ="one(this) || many(this)" )
19+ public void inspect () {}
20+
21+ @ StateRefinement (from ="many(this)" )
22+ public void consumeOne () {}
23+ }
Original file line number Diff line number Diff line change 1+ package testSuite .classes .state_refinement_no_to_typestate_correct ;
2+
3+ public class Test {
4+
5+ public void test () {
6+ Counter counter = new Counter ();
7+ counter .addFirst ();
8+ counter .addSecond ();
9+ counter .inspect ();
10+ counter .consumeOne ();
11+ }
12+ }
You can’t perform that action at this time.
0 commit comments