7060779: test/tools/javac/diags/Example.java leaves directories in tempdir
Reviewed-by: mcimadamore
--- a/langtools/test/tools/javac/diags/Example.java Tue May 21 11:41:21 2013 +0100
+++ b/langtools/test/tools/javac/diags/Example.java Tue May 21 12:17:18 2013 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012, 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
@@ -296,7 +296,10 @@
private Set<String> actualKeys;
private Set<String> declaredKeys;
- static File tempDir = new File(System.getProperty("java.io.tmpdir"));
+ static File tempDir = (System.getProperty("test.src") != null) ?
+ new File(System.getProperty("user.dir")):
+ new File(System.getProperty("java.io.tmpdir"));
+
static void setTempDir(File tempDir) {
Example.tempDir = tempDir;
}