< prev index next >

test/vmTestbase/nsk/jvmti/PopFrame/popframe003p.java

Print this page

        

@@ -32,11 +32,10 @@
 public class popframe003p extends Thread {
     static final int PASSED = 0;
     static final int FAILED = 2;
 
     private PrintStream out;
-    private boolean DEBUG_MODE;
 
     public static volatile int totRes = PASSED;
     public static Object barrier = new Object();
     public Wicket startingBarrier;
 

@@ -74,14 +73,13 @@
     public boolean booleanPubGlFld = false;
     public String strPubGlFld = "public instance field";
 
     private popFrameCls popframeCls;
 
-    popframe003p(String name, PrintStream out, boolean verbose) {
+    popframe003p(String name, PrintStream out) {
         super(name);
         this.out = out;
-        DEBUG_MODE = verbose;
         startingBarrier = new Wicket();
         popframeCls = new popFrameCls();
     }
 
     public void run() {

@@ -122,15 +120,16 @@
                 "\t\tdoublePubGlFld=" + doublePubGlFld + "\texpected: 7.35\n" +
                 "\t\tcharPubGlFld='" + charPubGlFld + "'\texpected: 'b'\n" +
                 "\t\tbooleanPubGlFld=" + booleanPubGlFld + "\texpected: true\n" +
                 "\t\tstrPubGlFld=\"" + strPubGlFld + "\"\texpected: null\n");
             totRes = FAILED;
-        } else if (DEBUG_MODE)
+        } else {
             out.println("Check #5 PASSED: changes for the instance fields of a class,\n" +
                 "\twhich have been made in the popped frame's method, remained\n" +
                 "popframe003p (" + this + "): exiting...");
     }
+    }
 
     class popFrameCls {
         // dummy popFrameCls fields
         protected byte bytePubFld = 10;
         public short shortPubFld = 20;

@@ -147,26 +146,25 @@
 
         void activeMeth(int i, long l, double d, char c, boolean b) {
             boolean compl = true;
 
             if (popFrameHasBeenDone) { // popping has been done
-                if (DEBUG_MODE)
-                    out.println("popframe003p (" + this +
-                        "): enter activeMeth() after popping");
+                out.println("popframe003p (" + this + "): enter activeMeth() after popping");
                 /* check that any changes for the arguments,
                  * which occurred in the called method, remain
                  */
                 if (i != 2 || l != Long.MIN_VALUE ||
                         d != Double.MAX_VALUE || c != 'c' || b != true) {
                     out.println("TEST FAILED: changes for the arguments of " +
                         "the popped frame's method, did not remain\n" +
                         "\tcurrent argument values: i=" + i + " l=" + l +
                         " d=" + d + " c='" + c + "'\n");
                     totRes = FAILED;
-                } else if (DEBUG_MODE)
+                } else {
                     out.println("Check #3 PASSED: changes for the arguments of " +
                         "the popped frame's method, remained\n");
+                }
                 /* check that any changes for the class fields,
                  * which occurred in the called method, remain
                  */
                 if (bytePubFld != 0 || shortPubFld != 0 ||
                         intPubFld != 0 || longPubFld != 0L ||

@@ -183,14 +181,15 @@
                         "\t\tdoublePubFld=" + doublePubFld + "\texpected: 0\n" +
                         "\t\tcharPubFld='" + charPubFld + "'\texpected: ' '\n" +
                         "\t\tbooleanPubFld=" + booleanPubFld + "\texpected: false\n" +
                         "\t\tstrPubFld=\"" + strPubFld + "\"\texpected: \"static fld\"\n");
                     totRes = FAILED;
-                } else if (DEBUG_MODE)
+                } else {
                     out.println("Check #4 PASSED: changes for the fields of an inner class,\n" +
                         "\twhich have been made in the popped frame's method, remained\n" +
                         "popframe003p (" + this + "): exiting...\n");
+                }
 
                 return;
             }
 
             // make some variable changes:

@@ -246,17 +245,13 @@
             strPubFld = "static fld";
 
             try {
                 // notify the main thread about readiness
                 synchronized (barrier) {
-                    if (DEBUG_MODE)
-                        out.println("popFrameCls (" + this +
-                            "): notifying main thread");
+                    out.println("popFrameCls (" + this + "): notifying main thread");
                     startingBarrier.unlock();
-                    if (DEBUG_MODE)
-                        out.println("popFrameCls (" + this +
-                            "): inside activeMethod()");
+                    out.println("popFrameCls (" + this + "): inside activeMethod()");
                 }
                 // loop until the main thread pops us
                 int ii = 0;
                 int n = 1000;
                 while (!popFrameHasBeenDone) {
< prev index next >