1 // Copyright 2007 The Android Open Source Project 2 3 /** 4 * Test a class with a bad finalizer. 5 */ 6 public class Main { 7 public static void main(String[] args) { 8 BadFinalizer bf = new BadFinalizer(); 9 10 System.out.println("Constructed object."); 11 bf = null; 12 13 System.out.println("Nulled. Requestion gc."); 14 System.gc(); 15 16 for (int i = 0; i < 8; i++) { 17 BadFinalizer.snooze(4000); 18 System.out.println("Requesting another GC."); 19 System.gc(); 20 } 21 22 System.out.println("Done waiting."); 23 System.exit(0); 24 } 25 } 26