8160215: jdk/test/java/io/Reader/ReaderBulkReadContract.java should clean up better
Summary: Create temporary files in the test scratch directory instead of in the default temporary file directory.
Reviewed-by: lancea, alanb
--- a/jdk/test/java/io/Reader/ReaderBulkReadContract.java Mon Jul 11 14:46:21 2016 -0700
+++ b/jdk/test/java/io/Reader/ReaderBulkReadContract.java Mon Jul 11 17:18:59 2016 -0700
@@ -148,7 +148,8 @@
private static File createTempFileWithContents(String contents) {
try {
- File file = File.createTempFile("ReaderContract", "");
+ File testDir = new File(System.getProperty("test.dir", "."));
+ File file = File.createTempFile("ReaderContract", "", testDir);
try (FileWriter w = new FileWriter(file)) {
w.write(contents);
}