13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * Portions Copyright (c) 2011 IBM Corporation
26 */
27
28 /*
29 * @test
30 * @bug 7031076
31 * @summary Allow stale InputStreams from ZipFiles to be GC'd
32 * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
33 */
34 import java.lang.ref.ReferenceQueue;
35 import java.lang.ref.WeakReference;
36 import java.io.File;
37 import java.io.FileOutputStream;
38 import java.io.InputStream;
39 import java.util.Enumeration;
40 import java.util.HashSet;
41 import java.util.Random;
42 import java.util.Set;
43 import java.util.zip.ZipEntry;
44 import java.util.zip.ZipFile;
45 import java.util.zip.ZipOutputStream;
46
47 public class ClearStaleZipFileInputStreams {
48 private static final int ZIP_ENTRY_NUM = 5;
49
50 private static final byte[][] data;
51
52 static {
|
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * Portions Copyright (c) 2011 IBM Corporation
26 */
27
28 /*
29 * @test
30 * @bug 7031076
31 * @summary Allow stale InputStreams from ZipFiles to be GC'd
32 * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
33 * @key randomness
34 */
35 import java.lang.ref.ReferenceQueue;
36 import java.lang.ref.WeakReference;
37 import java.io.File;
38 import java.io.FileOutputStream;
39 import java.io.InputStream;
40 import java.util.Enumeration;
41 import java.util.HashSet;
42 import java.util.Random;
43 import java.util.Set;
44 import java.util.zip.ZipEntry;
45 import java.util.zip.ZipFile;
46 import java.util.zip.ZipOutputStream;
47
48 public class ClearStaleZipFileInputStreams {
49 private static final int ZIP_ENTRY_NUM = 5;
50
51 private static final byte[][] data;
52
53 static {
|