Patch review request - Test bug 7123972 test/java/lang/annotation/loaderLeak/Main.java fails intermittently (original) (raw)

Eric Wang yiming.wang at oracle.com
Thu Jun 21 06:05:11 UTC 2012


Hi All,

I come from Java SQE team who are interested in regression test bug fix. Here is the first simple fix for bug 7123972 <http://monaco.us.oracle.com/detail.jsf?cr=7123972>, Can you please help to review and comment? Attachment is the patch Thanks!

This bug is caused by wrong assumption that the GC is started immediately to recycle un-referenced objects after System.gc() called one or two times.

The proposed solution is to make sure the un-referenced object is recycled by GC before checking if the reference is null.

Regards, Eric -------------- next part -------------- --- old/test/java/lang/annotation/loaderLeak/Main.java 2012-06-21 11:30:28.242617920 +0800 +++ new/test/java/lang/annotation/loaderLeak/Main.java 2012-06-21 11:30:26.828522968 +0800 @@ -36,6 +36,8 @@ import java.io.*;

public class Main {

@@ -57,8 +59,10 @@ System.gc(); System.gc(); loader = null;

@@ -124,4 +129,8 @@ classes.put(className, result); return result; }

}



More information about the core-libs-dev mailing list