--- a/jdk/test/java/util/Scanner/FailingConstructors.java Tue Feb 22 12:01:35 2011 -0800
+++ b/jdk/test/java/util/Scanner/FailingConstructors.java Tue Feb 22 15:34:17 2011 -0800
@@ -33,6 +33,7 @@
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.nio.file.Files;
import java.util.Scanner;
public class FailingConstructors {
@@ -46,9 +47,7 @@
/* create the file and write its contents */
File file = File.createTempFile(fileName, null);
file.deleteOnExit();
- FileOutputStream fos = new FileOutputStream(file);
- fos.write(FILE_CONTENTS.getBytes());
- fos.close();
+ Files.write(file.toPath(), FILE_CONTENTS.getBytes());
test(true, file);
file.delete();