8200355: local variable inference regression test generates classfile in test folder
Summary: LVTI harness should generate files in jtreg scratch dir
Reviewed-by: vromero
--- 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 {