langtools/test/tools/javac/T6900149.java
changeset 16800 3267051107a1
parent 6596 3274cf9d4873
child 27319 030080f03e4f
--- a/langtools/test/tools/javac/T6900149.java	Thu Mar 28 10:49:39 2013 -0700
+++ b/langtools/test/tools/javac/T6900149.java	Thu Mar 28 10:58:45 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
         StandardJavaFileManager fm =
                 compiler.getStandardFileManager(null, null, null);
-        File emptyFile = File.createTempFile("Empty", ".java");
+        File emptyFile = createTempFile("Empty.java");
         File[] files = new File[] { emptyFile, emptyFile };
         CompilationTask task = compiler.getTask(null, fm, diag,
                 null, null, fm.getJavaFileObjects(files));
@@ -47,4 +47,10 @@
             throw new AssertionError("compilation failed");
         }
     }
+
+    private static File createTempFile(String path) throws IOException {
+        File f = new File(path);
+        try (FileWriter out = new FileWriter(f)) { }
+        return f;
+    }
 }