7060779: test/tools/javac/diags/Example.java leaves directories in tempdir
authorvromero
Tue, 21 May 2013 12:17:18 +0100
changeset 17798 abe47e71498b
parent 17797 4ee9186c3998
child 17799 0ce3b298b678
7060779: test/tools/javac/diags/Example.java leaves directories in tempdir Reviewed-by: mcimadamore
langtools/test/tools/javac/diags/Example.java
--- 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;
     }