* tests/gc/ClassInit: Testcase for static class initializers works correct now.
authormichi <none@none>
Sun, 10 Jun 2007 15:48:01 +0000 (15:48 +0000)
committermichi <none@none>
Sun, 10 Jun 2007 15:48:01 +0000 (15:48 +0000)
--HG--
branch : exact-gc

tests/gc/ClassInit.java

index d0bc76d89dfa9280be088386a4173eb4bfc04511..1c3741fcb20be184317ebbf129fc1dff7efd44f0 100644 (file)
@@ -4,22 +4,20 @@ class ClassInitTest {
                System.gc();
        }
 
-       public void test() {
-               System.out.println("Object fine.");
+       public static void test() {
+               System.out.println("Static method fine.");
        }
 }
 
 public class ClassInit {
        public static void main(String[] s) {
                String t;
-               ClassInitTest o;
 
                System.out.println("Preparing a String ...");
                t = new String("Remember Me!");
 
-               System.out.println("Static Initializer will be called ...");
-               o = new ClassInitTest();
-               o.test();
+               System.out.println("Static Test Method will be called ...");
+               ClassInitTest.test();
 
                System.out.println("String: " + t);
                System.out.println("Test fine.");