test/tools/javac/T6558476.java

changeset 1669
d3648557391b
parent 554
9d9f26857129
child 2525
2eb010b6cb22
equal deleted inserted replaced
1668:991f11e13598 1669:d3648557391b
1 /* 1 /*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
21 * questions. 21 * questions.
22 */ 22 */
23 23
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 6558476
27 * @summary com/sun/tools/javac/Main.compile don't release file handles on return
26 * @run main/othervm -Xmx512m -Xms512m T6558476 28 * @run main/othervm -Xmx512m -Xms512m T6558476
27 */ 29 */
28 30
29 import java.io.File; 31 import java.io.File;
30 import java.io.FileInputStream; 32 import java.io.FileInputStream;
68 return sb.toString(); 70 return sb.toString();
69 } 71 }
70 72
71 public static void main(String[] args) throws IOException { 73 public static void main(String[] args) throws IOException {
72 File javaHomeDir = new File(System.getProperty("java.home")); 74 File javaHomeDir = new File(System.getProperty("java.home"));
73 File tmpDir = new File(System.getProperty("java.io.tmpdir")); 75 File outputDir = new File("outputDir" + new Random().nextInt(65536));
74 File outputDir = new File(tmpDir, "outputDir" + new Random().nextInt(65536));
75 outputDir.mkdir(); 76 outputDir.mkdir();
76 outputDir.deleteOnExit(); 77 outputDir.deleteOnExit();
77 78
78 File dnsjarfile = new File(javaHomeDir, "lib" + File.separator + "ext" + File.separator + "dnsns.jar"); 79 File dnsjarfile = new File(javaHomeDir, "lib" + File.separator + "ext" + File.separator + "dnsns.jar");
79 File tmpJar = copyFileTo(dnsjarfile, outputDir); 80 File tmpJar = copyFileTo(dnsjarfile, outputDir);

mercurial