1.1 --- a/test/tools/javac/varargs/warning/Warn5.java Wed Feb 23 10:34:45 2011 -0800 1.2 +++ b/test/tools/javac/varargs/warning/Warn5.java Thu Feb 24 08:40:49 2011 -0800 1.3 @@ -29,6 +29,7 @@ 1.4 * @run main Warn5 1.5 */ 1.6 import com.sun.source.util.JavacTask; 1.7 +import com.sun.tools.javac.api.JavacTool; 1.8 import java.net.URI; 1.9 import java.util.ArrayList; 1.10 import java.util.Arrays; 1.11 @@ -36,6 +37,7 @@ 1.12 import javax.tools.JavaCompiler; 1.13 import javax.tools.JavaFileObject; 1.14 import javax.tools.SimpleJavaFileObject; 1.15 +import javax.tools.StandardJavaFileManager; 1.16 import javax.tools.ToolProvider; 1.17 1.18 public class Warn5 { 1.19 @@ -207,12 +209,15 @@ 1.20 } 1.21 } 1.22 1.23 + // Create a single file manager and reuse it for each compile to save time. 1.24 + static StandardJavaFileManager fm = JavacTool.create().getStandardFileManager(null, null, null); 1.25 + 1.26 static void test(SourceLevel sourceLevel, XlintOption xlint, TrustMe trustMe, SuppressLevel suppressLevel, 1.27 ModifierKind modKind, MethodKind methKind, SignatureKind sig, BodyKind body) throws Exception { 1.28 final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); 1.29 JavaSource source = new JavaSource(trustMe, suppressLevel, modKind, methKind, sig, body); 1.30 DiagnosticChecker dc = new DiagnosticChecker(); 1.31 - JavacTask ct = (JavacTask)tool.getTask(null, null, dc, 1.32 + JavacTask ct = (JavacTask)tool.getTask(null, fm, dc, 1.33 Arrays.asList(xlint.getXlintOption(), "-source", sourceLevel.sourceKey), null, Arrays.asList(source)); 1.34 ct.analyze(); 1.35 check(sourceLevel, dc, source, xlint, trustMe,