8160215: jdk/test/java/io/Reader/ReaderBulkReadContract.java should clean up better

Create temporary files in the test scratch directory instead of in the default temporary file directory.

Reviewed-by: lancea, alanb
This commit is contained in:
Brian Burkhalter 2016-07-11 17:18:59 -07:00
parent a7e2ba6615
commit fadef405a9

View File

@ -148,7 +148,8 @@ public class ReaderBulkReadContract {
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);
}