* tests/gc/ClassInit.java: Changed trigger for static initializer from method
authormichi <none@none>
Wed, 20 Jun 2007 23:39:22 +0000 (23:39 +0000)
committermichi <none@none>
Wed, 20 Jun 2007 23:39:22 +0000 (23:39 +0000)
call to field access.

--HG--
branch : exact-gc

tests/gc/ClassInit.java

index 1c3741fcb20be184317ebbf129fc1dff7efd44f0..223cfd5500d2b852fbfa8e90d838402512b3becd 100644 (file)
@@ -4,6 +4,8 @@ class ClassInitTest {
                System.gc();
        }
 
+       public static int val;
+
        public static void test() {
                System.out.println("Static method fine.");
        }
@@ -16,10 +18,14 @@ public class ClassInit {
                System.out.println("Preparing a String ...");
                t = new String("Remember Me!");
 
-               System.out.println("Static Test Method will be called ...");
-               ClassInitTest.test();
+               /*System.out.println("Static Test Method will be called ...");
+               ClassInitTest.test();*/
+
+               System.out.println("Static Field will be accessed ...");
+               ClassInitTest.val = 123;
 
                System.out.println("String: " + t);
+               System.out.println("Field:  " + ClassInitTest.val);
                System.out.println("Test fine.");
        }
 }