--- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java Fri Jun 18 16:16:51 2010 +0100
+++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java Fri Jun 18 09:35:22 2010 -0700
@@ -62,9 +62,21 @@
trace = true;
}
- // Turn on verbose:gc to track GC
- mbean.setVerbose(true);
+ try {
+ if (trace) {
+ // Turn on verbose:gc to track GC
+ mbean.setVerbose(true);
+ }
+ test();
+ } finally {
+ if (trace) {
+ mbean.setVerbose(false);
+ }
+ }
+ System.out.println("Test passed.");
+ }
+ private static void test() throws Exception {
// Clean the memory and remove all objects that are pending
// finalization
System.gc();
@@ -130,7 +142,6 @@
+ " end = " + snapshot);
}
- System.out.println("Test passed.");
}
private static void checkFinalizerCount(int expectedTotal, int curFinalized)