changeset 49442:9925be430918

8200355: local variable inference regression test generates classfile in test folder Summary: LVTI harness should generate files in jtreg scratch dir Reviewed-by: vromero
author mcimadamore
date Wed, 28 Mar 2018 14:24:17 +0100
parents 0fdb76741c56
children 879cf9f18688
files test/langtools/tools/javac/lvti/harness/LocalVariableInferenceTester.java
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/langtools/tools/javac/lvti/harness/LocalVariableInferenceTester.java	Wed Mar 28 14:08:26 2018 +0100
+++ b/test/langtools/tools/javac/lvti/harness/LocalVariableInferenceTester.java	Wed Mar 28 14:24:17 2018 +0100
@@ -56,8 +56,18 @@
 
 public class LocalVariableInferenceTester {
 
-    static final JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
-    static final StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
+    static final StandardJavaFileManager fm;
+
+    static {
+        final JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
+        fm = comp.getStandardFileManager(null, null, null);
+        File destDir = new File(System.getProperty("user.dir"));
+        try {
+            fm.setLocation(javax.tools.StandardLocation.CLASS_OUTPUT, Arrays.asList(destDir));
+        } catch (IOException ex) {
+            throw new AssertionError(ex);
+        }
+    }
 
     public static void main(String[] args) throws IOException {
         try {