Hi Mandy,
Seems okay.
I presume when you say the anchor is unsigned, you mean it represents an
external unsigned value? So -1 is the only sentinel value being used?
Thanks,
David
On 25/11/2015 8:37 AM, Mandy Chung wrote:
On Nov 24, 2015, at 2:20 PM, Daniel D. Daugherty <daniel.daughe...@oracle.com>
wrote:
You use both 'this.anchor' and 'anchor'. Seems inconsistent.
Oh yeah. I took out “this.” from it.
diff --git a/src/java.base/share/classes/java/lang/StackStreamFactory.java
b/src/java.base/share/classes/java/lang/StackStreamFactory.java
--- a/src/java.base/share/classes/java/lang/StackStreamFactory.java
+++ b/src/java.base/share/classes/java/lang/StackStreamFactory.java
@@ -225,17 +225,17 @@
}
switch (state) {
case NEW:
- if (this.anchor != 0) {
+ if (anchor != 0) {
throw new IllegalStateException("This stack stream is
being reused.");
}
break;
case OPEN:
- if (this.anchor <= 0) {
- throw new IllegalStateException("This stack stream is not
valid for walking");
+ if (anchor == 0 || anchor == -1L) {
+ throw new IllegalStateException("This stack stream is not
valid for walking: " + anchor);
}
break;
case CLOSED:
- if (this.anchor != -1L) {
+ if (anchor != -1L) {
throw new IllegalStateException("This stack stream is not
closed.");
}
}
Mandy