8143911: java/lang/StackWalker tests fail on Solaris with IllegalStateException

Mandy Chung mandy.chung at oracle.com
Tue Nov 24 22:37:57 UTC 2015


> On Nov 24, 2015, at 2:20 PM, Daniel D. Daugherty <daniel.daugherty at 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


More information about the hotspot-runtime-dev mailing list