8200355: local variable inference regression test generates classfile in test folder
authormcimadamore
Wed, 28 Mar 2018 14:24:17 +0100
changeset 49437 9925be430918
parent 49436 0fdb76741c56
child 49438 879cf9f18688
8200355: local variable inference regression test generates classfile in test folder Summary: LVTI harness should generate files in jtreg scratch dir Reviewed-by: vromero
test/langtools/tools/javac/lvti/harness/LocalVariableInferenceTester.java
--- 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 {