You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-14Lines changed: 4 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,14 +56,6 @@ To follow along with this tutorial, make sure you have the following installed:
56
56
57
57
> Don't forget to star [LiquidJava](https://github.com/liquid-java/liquidjava) and its [extension](https://github.com/liquid-java/vscode-liquidjava) on GitHub! ⭐
58
58
59
-
### Important!
60
-
61
-
- Currently, **only one error is reported at a time**, so an error might not be reported if another one is present! In each part of the tutorial, **make sure to fix all errors before moving on to the next one**.
62
-
- It is recommended to enable **auto-save** in VS Code to ensure that the LiquidJava extension always checks the latest version of the code. You can enable it by going to `File > Auto Save`.
63
-
- It is also highly recommended to disable **GitHub Copilot** while following this tutorial, as it might give you the answers to the exercises before you even can think about them.
64
-
- The extension might take a few seconds to verify the code after each change, so be patient while it checks for errors.
65
-
- Lastly, if you think the extension isn't working correctly, try restarting the extension with the command palette (`Cmd+Shift+P` or `Ctrl+Shift+P`) and selecting `Developer: Restart Extension Host` or `Developer: Reload Window`.
66
-
67
59
---
68
60
69
61
## Tutorial
@@ -86,7 +78,7 @@ As demonstrated previously, we can also refine method parameters and return valu
86
78
87
79
Here, the method `divide` is refined to ensure that the parameter `b` is never zero.
88
80
89
-
> Try changing the value of the second argument in the `divide` method call to zero and observe the error reported by LiquidJava. Now change it back to a non-zero value.
81
+
> Try changing the value of the second argument in the `divide` method call to zero and observe the error reported by LiquidJava.
90
82
91
83
But wait, we can also refine the return value of the method! Let's introduce a bug.
92
84
@@ -102,8 +94,6 @@ No error! Let's fix this.
102
94
103
95
Now we get an error! LiquidJava is telling us that the implementation of the method does not satisfy the refinement specified for the return value. This way, we can catch errors not only in the inputs of the methods, but also in their outputs.
104
96
105
-
> Fix the implementation of the method to return `a / b` again to make the error disappear.
106
-
107
97
#### Exercise
108
98
109
99
> Open [Bank.java](./src/main/java/com/tutorial/part1/exercise/Bank.java).
@@ -148,7 +138,7 @@ This object has two methods, `turnOn` and `turnOff`. From the state refinements,
> Uncomment line 22 to observe the error and then comment it back again.
141
+
> Uncomment line 22 to observe the error.
152
142
153
143
#### Exercise
154
144
@@ -165,7 +155,7 @@ If you get stuck, here are some **hints**:
165
155
- If a method is allowed from multiple source states, use the `||` operator to combine them
166
156
- Don't forget the `(this)` after each state name, since states are always associated with an object instance
167
157
168
-
With the correct implementation, LiquidJava will report an error in line 30, since we are trying to resume playback when the player is stopped. Fix the error before proceeding.
158
+
With the correct implementation, LiquidJava will report an error in line 30, since we are trying to resume playback when the player is stopped.
169
159
170
160
### 3. External Refinements
171
161
@@ -191,7 +181,7 @@ We want to ensure that the `lock` method can only be called in the `unlocked` st
With the correct implementation, LiquidJava will report an error in line 10 of [ReentrantLockExample.java](./src/main/java/com/tutorial/part3/exercise/ReentrantLockExample.java), since we are trying to unlock a lock that is not locked. Remember to fix the error before moving on.
184
+
With the correct implementation, LiquidJava will report an error in line 10 of [ReentrantLockExample.java](./src/main/java/com/tutorial/part3/exercise/ReentrantLockExample.java), since we are trying to unlock a lock that is not locked.
0 commit comments