8152897: refactor ToolBox to allow reduced documented dependencies

Reviewed-by: vromero
This commit is contained in:
Jonathan Gibbons 2016-03-31 15:20:50 -07:00
parent 208d93e110
commit 7812306bc0
212 changed files with 3955 additions and 3485 deletions

View File

@ -28,7 +28,8 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib
* @build KullaTesting TestingInputStream ToolBox Compiler
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
* @build KullaTesting TestingInputStream Compiler
* @run testng ClassPathTest
*/

View File

@ -30,7 +30,8 @@
* jdk.jdeps/com.sun.tools.javap
* jdk.jshell/jdk.internal.jshell.tool
* @library /tools/lib
* @build ReplToolTesting TestingInputStream Compiler ToolBox
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
* @build ReplToolTesting TestingInputStream Compiler
* @run testng CommandCompletionTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -30,6 +30,10 @@ import java.nio.file.Paths;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import toolbox.JarTask;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class Compiler {
private final ToolBox tb = new ToolBox();
@ -57,7 +61,7 @@ public class Compiler {
public void compile(Path directory, String...sources) {
Path classDir = getClassDir();
tb.new JavacTask()
new JavacTask(tb)
.options("-d", classDir.resolve(directory).toString())
.sources(sources)
.run();
@ -73,7 +77,7 @@ public class Compiler {
Path classDirPath = getClassDir();
Path baseDir = classDirPath.resolve(directory);
Path jarPath = baseDir.resolve(jarName);
tb.new JarTask(jarPath.toString())
new JarTask(tb, jarPath.toString())
.manifest(manifest)
.baseDir(baseDir.toString())
.files(files).run();

View File

@ -29,7 +29,8 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib
* @build KullaTesting TestingInputStream ToolBox Compiler
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
* @build KullaTesting TestingInputStream Compiler
* @run testng CompletionSuggestionTest
*/

View File

@ -26,10 +26,10 @@
* @bug 8131027
* @summary Test Get FQNs
* @library /tools/lib
* @build KullaTesting TestingInputStream ToolBox Compiler
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
* @build KullaTesting TestingInputStream Compiler
* @run testng ComputeFQNsTest
*/

View File

@ -29,7 +29,7 @@
* jdk.jdeps/com.sun.tools.javap
* jdk.jshell/jdk.internal.jshell.tool
* @library /tools/lib
* @build KullaTesting TestingInputStream ExpectedDiagnostic ToolBox Compiler
* @build KullaTesting TestingInputStream ExpectedDiagnostic toolbox.ToolBox Compiler
* @run testng ErrorTranslationTest
*/

View File

@ -28,7 +28,7 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib
* @build KullaTesting TestingInputStream ToolBox ExpectedDiagnostic
* @build KullaTesting TestingInputStream toolbox.Task.ExpectedDiagnostic
* @run testng ImportTest
*/

View File

@ -29,7 +29,7 @@
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build KullaTesting TestingInputStream ToolBox Compiler
* @build KullaTesting TestingInputStream toolbox.ToolBox Compiler
* @run testng InferTypeTest
*/

View File

@ -29,7 +29,7 @@
* jdk.jdeps/com.sun.tools.javap
* jdk.jshell/jdk.internal.jshell.tool
* @library /tools/lib
* @build Compiler ToolBox
* @build Compiler toolbox.ToolBox
* @run testng StartOptionTest
*/

View File

@ -24,11 +24,12 @@
/*
* @test
* @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317
* @requires os.family != "solaris"
* @summary Tests for Basic tests for REPL tool
* @requires os.family != "solaris"
* @library /tools/lib
* @ignore 8139873
* @build KullaTesting TestingInputStream ToolBox Compiler
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
* @build KullaTesting TestingInputStream Compiler
* @run testng/timeout=600 ToolBasicTest
*/

View File

@ -30,7 +30,7 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* jdk.jshell/jdk.internal.jshell.tool
* @build KullaTesting TestingInputStream ToolBox Compiler
* @build KullaTesting TestingInputStream toolbox.ToolBox Compiler
* @run testng ToolFormatTest
*/
import java.util.ArrayList;

View File

@ -31,7 +31,7 @@
* jdk.jdeps/com.sun.tools.javap
* jdk.jshell/jdk.internal.jshell.tool
* @library /tools/lib
* @build KullaTesting TestingInputStream ToolBox Compiler
* @build KullaTesting TestingInputStream toolbox.ToolBox Compiler
* @run testng ToolReloadTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -28,18 +28,11 @@
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.doclint
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JarTask
* @run main PathsTest
*/
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.file.JavacFileManager;
import com.sun.tools.doclint.DocLint;
import com.sun.tools.doclint.DocLint.BadArgs;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@ -48,6 +41,13 @@ import java.io.StringWriter;
import java.util.regex.Pattern;
import javax.tools.StandardLocation;
import javax.tools.JavaFileManager;
import javax.tools.ToolProvider;
import com.sun.tools.doclint.DocLint;
import com.sun.tools.doclint.DocLint.BadArgs;
import toolbox.JarTask;
import toolbox.ToolBox;
public class PathsTest {
public static void main(String... args) throws Exception {
@ -117,9 +117,10 @@ public class PathsTest {
File createJar() throws IOException {
File f = new File("test.jar");
try (JavaFileManager fm = new JavacFileManager(new Context(), false, null)) {
try (JavaFileManager fm = ToolProvider.getSystemJavaCompiler()
.getStandardFileManager(null, null, null)) {
ToolBox tb = new ToolBox();
tb.new JarTask(f.getPath())
new JarTask(tb, f.getPath())
.files(fm, StandardLocation.PLATFORM_CLASS_PATH, "java.lang.*")
.run();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -27,10 +27,9 @@
* @summary check that javac operates correctly in EBCDIC locale
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox
* @run main CheckEBCDICLocaleTest
*/
@ -45,6 +44,8 @@ import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import toolbox.ToolBox;
public class CheckEBCDICLocaleTest {
private static final String TestSrc =

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -28,10 +28,8 @@
* encoding, if available
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox
* @run compile -encoding iso-8859-1 -XD-printsource T6302184.java
* @run main HiddenOptionsShouldUseGivenEncodingTest
*/
@ -40,6 +38,8 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import toolbox.ToolBox;
// Original test: test/tools/javac/6302184/T6302184.sh
public class HiddenOptionsShouldUseGivenEncodingTest {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2016, 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
@ -28,11 +28,8 @@
* (This test is specifically to test the new impl of inferBinaryName)
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox p.A
* @build toolbox.ToolBox toolbox.JarTask p.A
* @run main TestInferBinaryName
*/
@ -40,13 +37,11 @@ import java.io.*;
import java.util.*;
import javax.tools.*;
import com.sun.tools.javac.file.JavacFileManager;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.Options;
import static javax.tools.JavaFileObject.Kind.*;
import static javax.tools.StandardLocation.*;
import toolbox.JarTask;
import toolbox.ToolBox;
/**
* Verify the various implementations of inferBinaryName, but configuring
@ -70,9 +65,10 @@ public class TestInferBinaryName {
File createJar() throws IOException {
File f = new File("test.jar");
try (JavaFileManager fm = new JavacFileManager(new Context(), false, null)) {
try (JavaFileManager fm = ToolProvider.getSystemJavaCompiler()
.getStandardFileManager(null, null, null)) {
ToolBox tb = new ToolBox();
tb.new JarTask(f.getPath())
new JarTask(tb, f.getPath())
.files(fm, StandardLocation.PLATFORM_CLASS_PATH, "java.lang.*")
.run();
}
@ -124,9 +120,8 @@ public class TestInferBinaryName {
JavaFileManager getFileManager(List<File> path)
throws IOException {
Context ctx = new Context();
JavacFileManager fm = new JavacFileManager(ctx, false, null);
StandardJavaFileManager fm = ToolProvider.getSystemJavaCompiler()
.getStandardFileManager(null, null, null);
fm.setLocation(CLASS_PATH, path);
return fm;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,13 +27,15 @@
* @summary javac wrongly allows a subclass of an anonymous class
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main AnonymousSubclassTest
*/
import toolbox.JavacTask;
import toolbox.Task;
import toolbox.ToolBox;
public class AnonymousSubclassTest {
public static void main(String... args) throws Exception {
new AnonymousSubclassTest().run();
@ -68,19 +70,19 @@ public class AnonymousSubclassTest {
"}";
void compOk(String code) throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.sources(code)
.run();
}
void compFail(String code) throws Exception {
String errs = tb.new JavacTask()
String errs = new JavacTask(tb)
.sources(code)
.classpath(".")
.options("-XDrawDiagnostics")
.run(ToolBox.Expect.FAIL)
.run(Task.Expect.FAIL)
.writeAll()
.getOutput(ToolBox.OutputKind.DIRECT);
.getOutput(Task.OutputKind.DIRECT);
if (!errs.contains("cant.inherit.from.anon")) {
throw new Exception("test failed");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -27,15 +27,17 @@
* @summary Test -classpath option and classpath defaults.
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main ClassPathTest
*/
import java.nio.file.Paths;
import toolbox.JavacTask;
import toolbox.Task;
import toolbox.ToolBox;
// Original test: test/tools/javac/ClassPathTest/ClassPathTest.sh
public class ClassPathTest {
@ -100,55 +102,55 @@ public class ClassPathTest {
// automatically but this is not happening when called using ProcessBuilder
// testJavac success ClassPathTest3.java
tb.new JavacTask(ToolBox.Mode.EXEC)
new JavacTask(tb, Task.Mode.EXEC)
.classpath(".")
.files("ClassPathTest3.java")
.run();
// testJavac failure ClassPathTest1.java
tb.new JavacTask(ToolBox.Mode.EXEC)
new JavacTask(tb, Task.Mode.EXEC)
.classpath(".")
.files("ClassPathTest1.java")
.run(ToolBox.Expect.FAIL);
.run(Task.Expect.FAIL);
// testJavac success ClassPathTest2.java
tb.new JavacTask(ToolBox.Mode.EXEC)
new JavacTask(tb, Task.Mode.EXEC)
.envVar("CLASSPATH", "bar")
.files("ClassPathTest2.java")
.run();
// testJavac failure ClassPathTest1.java
tb.new JavacTask(ToolBox.Mode.EXEC)
new JavacTask(tb, Task.Mode.EXEC)
.envVar("CLASSPATH", "bar")
.files("ClassPathTest1.java")
.run(ToolBox.Expect.FAIL);
.run(Task.Expect.FAIL);
// testJavac failure ClassPathTest3.java
tb.new JavacTask(ToolBox.Mode.EXEC)
new JavacTask(tb, Task.Mode.EXEC)
.envVar("CLASSPATH", "bar")
.files("ClassPathTest3.java")
.run(ToolBox.Expect.FAIL);
.run(Task.Expect.FAIL);
// testJavac success -classpath foo ClassPathTest1.java
tb.new JavacTask(ToolBox.Mode.EXEC)
new JavacTask(tb, Task.Mode.EXEC)
.envVar("CLASSPATH", "bar")
.classpath("foo")
.files("ClassPathTest1.java")
.run();
// testJavac failure -classpath foo ClassPathTest2.java
tb.new JavacTask(ToolBox.Mode.EXEC)
new JavacTask(tb, Task.Mode.EXEC)
.envVar("CLASSPATH", "bar")
.classpath("foo")
.files("ClassPathTest2.java")
.run(ToolBox.Expect.FAIL);
.run(Task.Expect.FAIL);
// testJavac failure -classpath foo ClassPathTest3.java
tb.new JavacTask(ToolBox.Mode.EXEC)
new JavacTask(tb, Task.Mode.EXEC)
.envVar("CLASSPATH", "bar")
.classpath("foo")
.files("ClassPathTest3.java")
.run(ToolBox.Expect.FAIL);
.run(Task.Expect.FAIL);
}
}

View File

@ -27,10 +27,9 @@
* @summary Constant folding deficiency
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavapTask
* @run main ConstFoldTest
*/
@ -39,6 +38,10 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import toolbox.JavapTask;
import toolbox.Task;
import toolbox.ToolBox;
public class ConstFoldTest {
public static void main(String... args) throws Exception {
new ConstFoldTest().run();
@ -82,12 +85,12 @@ public class ConstFoldTest {
URL url = ConstFoldTest.class.getResource("ConstFoldTest$CFTest.class");
Path file = Paths.get(url.toURI());
List<String> result = tb.new JavapTask()
List<String> result = new JavapTask(tb)
.options("-c")
.classes(file.toString())
.run()
.write(ToolBox.OutputKind.DIRECT)
.getOutputLines(ToolBox.OutputKind.DIRECT);
.write(Task.OutputKind.DIRECT)
.getOutputLines(Task.OutputKind.DIRECT);
List<String> bad_codes = tb.grep(regex, result);
if (!bad_codes.isEmpty()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -27,15 +27,17 @@
* @summary Test that '.jar' files in -extdirs are found.
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
* @run main ExtDirTest
*/
import java.io.File;
import toolbox.JarTask;
import toolbox.JavacTask;
import toolbox.ToolBox;
// Original test: test/tools/javac/ExtDirs/ExtDirs.sh
public class ExtDirTest {
@ -112,22 +114,22 @@ public class ExtDirTest {
}
void createJars() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.sources(ExtDirTestClass1Src)
.run();
tb.new JarTask("pkg1.jar")
new JarTask(tb, "pkg1.jar")
.manifest(jar1Manifest)
.files("pkg1/ExtDirTestClass1.class")
.run();
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.sources(ExtDirTestClass2Src)
.run();
tb.new JarTask("pkg2.jar")
new JarTask(tb, "pkg2.jar")
.manifest(jar2Manifest)
.files("pkg2/ExtDirTestClass2.class")
.run();
@ -149,7 +151,7 @@ public class ExtDirTest {
}
void compileWithExtDirs() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.options("-source", "8",
"-extdirs", "ext1")
@ -157,7 +159,7 @@ public class ExtDirTest {
.run()
.writeAll();
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.options("-source", "8",
"-extdirs", "ext1" + File.pathSeparator + "ext2")
@ -165,7 +167,7 @@ public class ExtDirTest {
.run()
.writeAll();
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.options("-source", "8",
"-extdirs", "ext3")

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,13 +27,15 @@
* @summary Incorrect inheritance of inaccessible static method
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main IncorrectInheritanceTest
*/
import toolbox.JavacTask;
import toolbox.ToolBox;
public class IncorrectInheritanceTest {
private static final String ASrc =
"package pkg;\n" +
@ -65,7 +67,7 @@ public class IncorrectInheritanceTest {
public void test() throws Exception {
ToolBox tb = new ToolBox();
tb.new JavacTask()
new JavacTask(tb)
.sources(ASrc, BSrc, CSrc)
.run();
}

View File

@ -28,13 +28,15 @@
* doesn't exist.
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main MissingIncludeTest
*/
import toolbox.JavacTask;
import toolbox.Task;
import toolbox.ToolBox;
// Original test: test/tools/javac/MissingInclude.sh
public class MissingIncludeTest {
@ -46,10 +48,10 @@ public class MissingIncludeTest {
tb.writeFile(MissingIncludeFile, MissingIncludeSrc);
tb.new JavacTask(ToolBox.Mode.CMDLINE)
new JavacTask(tb, Task.Mode.CMDLINE)
.options("@/nonexistent_file")
.files(MissingIncludeFile)
.run(ToolBox.Expect.FAIL);
.run(Task.Expect.FAIL);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -28,11 +28,9 @@
* @author govereau
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @ignore 8055768 ToolBox does not close opened files
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask toolbox.JarTask
* @run main AbsolutePathTest
*/
@ -40,12 +38,16 @@ import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import toolbox.JarTask;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class AbsolutePathTest {
public static void main(String... cmdline) throws Exception {
ToolBox tb = new ToolBox();
// compile test.Test
tb.new JavacTask()
new JavacTask(tb)
.outdir(".") // this is needed to get the classfiles in test
.sources("package test; public class Test{}")
.run();
@ -54,18 +56,18 @@ public class AbsolutePathTest {
// we need the jars in a directory different from the working
// directory to trigger the bug.
Files.createDirectory(Paths.get("jars"));
tb.new JarTask("jars/test.jar")
new JarTask(tb, "jars/test.jar")
.files("test/Test.class")
.run();
// build second jar in jars directory using
// an absolute path reference to the first jar
tb.new JarTask("jars/test2.jar")
new JarTask(tb, "jars/test2.jar")
.classpath(new File("jars/test.jar").getAbsolutePath())
.run();
// this should not fail
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.classpath("jars/test2.jar")
.sources("import test.Test; class Test2 {}")

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -27,13 +27,16 @@
* @summary Verify allowed access to protected class from another package
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavaTask toolbox.JavacTask
* @run main ProtectedInnerClassesTest
*/
import toolbox.JavaTask;
import toolbox.JavacTask;
import toolbox.Task;
import toolbox.ToolBox;
// Original tests: test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh
// and test/tools/javac/ProtectedInnerClass/ProtectedInnerClass_2.java
public class ProtectedInnerClassesTest {
@ -86,12 +89,12 @@ public class ProtectedInnerClassesTest {
}
void compileAndExecute() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.sources(protectedInnerClass1Src, protectedInnerClass2Src)
.run();
tb.new JavaTask()
new JavaTask(tb)
.classpath(System.getProperty("user.dir"))
.className("p2.ProtectedInnerClass2")
.run();
@ -99,15 +102,15 @@ public class ProtectedInnerClassesTest {
//from test/tools/javac/ProtectedInnerClass/ProtectedInnerClass_2.java
void compileOnly() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.sources(protectedInnerClass1Src)
.run();
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.sources(protectedInnerClass3Src)
.run(ToolBox.Expect.FAIL);
.run(Task.Expect.FAIL);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -27,16 +27,18 @@
* @summary javac fails with assertion error
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main AssertionFailureTest
*/
import java.io.File;
import java.nio.file.Paths;
import toolbox.JavacTask;
import toolbox.ToolBox;
// Original test: test/tools/javac/T5090006/compiler.sh
public class AssertionFailureTest {
@ -62,7 +64,7 @@ public class AssertionFailureTest {
String classpath = Paths.get(tb.testSrc, "broken.jar")
+ File.pathSeparator
+ ".";
tb.new JavacTask()
new JavacTask(tb)
.classpath(classpath)
.sources(testSrc)
.run();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2016, 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
@ -27,10 +27,9 @@
* @summary com/sun/tools/javac/Main.compile don't release file handles on return
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
* @run main/othervm -Xmx512m -Xms512m T6558476
*/
@ -42,6 +41,10 @@ import java.util.Random;
import com.sun.tools.javac.Main;
import toolbox.JarTask;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class T6558476 {
private static final String classFoo = "class Foo {}";
@ -55,17 +58,17 @@ public class T6558476 {
public static void main(String[] args) throws IOException {
ToolBox tb = new ToolBox();
tb.new JavacTask()
.sources(classFoo)
.run();
tb.new JarTask("foo.jar")
.files("Foo.class")
.run();
new JavacTask(tb)
.sources(classFoo)
.run();
new JarTask(tb, "foo.jar")
.files("Foo.class")
.run();
tb.new JavacTask()
.classpath("foo.jar")
.sources(classMyFoo)
.run();
new JavacTask(tb)
.classpath("foo.jar")
.sources(classMyFoo)
.run();
File foo_jar = new File("foo.jar");
if (foo_jar.delete()) {
System.out.println("jar file successfully deleted");

View File

@ -31,8 +31,7 @@
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JarTask
* @run main T6725036
*/
@ -49,6 +48,9 @@ import com.sun.tools.javac.file.JavacFileManager;
import com.sun.tools.javac.file.RelativePath.RelativeFile;
import com.sun.tools.javac.util.Context;
import toolbox.JarTask;
import toolbox.ToolBox;
public class T6725036 {
public static void main(String... args) throws Exception {
new T6725036().run();
@ -82,7 +84,7 @@ public class T6725036 {
try (JavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
File f = new File(name);
ToolBox tb = new ToolBox();
tb.new JarTask(name)
new JarTask(tb, name)
.files(fm, StandardLocation.PLATFORM_CLASS_PATH, paths)
.run();
return f;

View File

@ -28,11 +28,10 @@
* @library /tools/lib
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main DebugPointerAtBadPositionTest
*/
@ -45,6 +44,9 @@ import com.sun.tools.classfile.LineNumberTable_attribute;
import com.sun.tools.classfile.Method;
import com.sun.tools.javac.util.Assert;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class DebugPointerAtBadPositionTest {
static final String testSource =
@ -82,7 +84,7 @@ public class DebugPointerAtBadPositionTest {
void compileTestClass() throws Exception {
ToolBox tb = new ToolBox();
tb.new JavacTask()
new JavacTask(tb)
.sources(testSource)
.run();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -28,11 +28,10 @@
* @library /tools/lib
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main InlinedFinallyConfuseDebuggersTest
*/
@ -45,6 +44,9 @@ import com.sun.tools.classfile.LineNumberTable_attribute;
import com.sun.tools.classfile.Method;
import com.sun.tools.javac.util.Assert;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class InlinedFinallyConfuseDebuggersTest {
static final String testSource =
@ -88,7 +90,7 @@ public class InlinedFinallyConfuseDebuggersTest {
}
void compileTestClass() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.sources(testSource)
.run();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -27,17 +27,21 @@
* @summary -profile <compact> does not work when -bootclasspath specified
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main CheckRejectProfileBCPOptionsIfUsedTogetherTest
*/
import com.sun.tools.javac.util.Assert;
import java.nio.file.Paths;
import com.sun.tools.javac.util.Assert;
import toolbox.JavacTask;
import toolbox.Task;
import toolbox.ToolBox;
public class CheckRejectProfileBCPOptionsIfUsedTogetherTest {
private static final String TestSrc =
@ -49,14 +53,14 @@ public class CheckRejectProfileBCPOptionsIfUsedTogetherTest {
ToolBox tb = new ToolBox();
tb.writeFile("Test.java", TestSrc);
ToolBox.Result result = tb.new JavacTask(ToolBox.Mode.CMDLINE)
Task.Result result = new JavacTask(tb, Task.Mode.CMDLINE)
.options("-profile", "compact1",
"-bootclasspath", Paths.get(ToolBox.testJDK, "jre/lib/rt.jar").toString())
.files("Test.java")
.run(ToolBox.Expect.FAIL)
.run(Task.Expect.FAIL)
.writeAll();
String out = result.getOutput(ToolBox.OutputKind.DIRECT);
String out = result.getOutput(Task.OutputKind.DIRECT);
Assert.check(out.startsWith(
"javac: profile and bootclasspath options cannot be used together"),
"Incorrect javac error output");

View File

@ -27,13 +27,14 @@
* @summary Javac Crashes while building OpenJFX
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main CompilerCrashWhenMixingBinariesAndSourcesTest
*/
import toolbox.JavacTask;
import toolbox.ToolBox;
public class CompilerCrashWhenMixingBinariesAndSourcesTest {
private static final String ASource =
"class A {\n" +
@ -53,13 +54,13 @@ public class CompilerCrashWhenMixingBinariesAndSourcesTest {
public static void main(String[] args) throws Exception {
ToolBox tb = new ToolBox();
tb.new JavacTask()
new JavacTask(tb)
.sources(ASource, BSource, CSource, DSource)
.run();
tb.deleteFiles("A.class", "A$1.class", "C.class", "D.class");
tb.new JavacTask()
new JavacTask(tb)
.classpath(".")
.sources(ASource, CSource, DSource)
.run();

View File

@ -27,13 +27,14 @@
* @summary compile of iterator use fails with error "defined in an inaccessible class or interface"
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main CompileErrorWithIteratorTest
*/
import toolbox.JavacTask;
import toolbox.ToolBox;
public class CompileErrorWithIteratorTest {
private static final String TestCollectionSrc =
@ -80,7 +81,7 @@ public class CompileErrorWithIteratorTest {
}
void compile() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.sources(TestCollectionSrc, TestSrc)
.run();
}

View File

@ -27,12 +27,10 @@
* @summary javac, generates erroneous LVT for a test case with lambda code
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main WrongLNTForLambdaTest
*/
@ -45,6 +43,9 @@ import com.sun.tools.classfile.LineNumberTable_attribute;
import com.sun.tools.classfile.Method;
import com.sun.tools.javac.util.Assert;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class WrongLNTForLambdaTest {
static final String testSource =
@ -152,7 +153,7 @@ public class WrongLNTForLambdaTest {
}
void compileTestClass() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.sources(testSource)
.run();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -27,13 +27,15 @@
* @summary Incorrect signature determination for certain inner class generics
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main IncorrectSignatureDeterminationForInnerClassesTest
*/
import toolbox.JavacTask;
import toolbox.ToolBox;
public class IncorrectSignatureDeterminationForInnerClassesTest {
private static final String DSrc =
@ -73,13 +75,13 @@ public class IncorrectSignatureDeterminationForInnerClassesTest {
ToolBox tb = new ToolBox();
tb.createDirectories("classes");
tb.new JavacTask()
new JavacTask(tb)
.outdir("classes")
.sources(DSrc)
.run();
// compile class H against the class files for classes D and Q
tb.new JavacTask()
new JavacTask(tb)
.outdir("classes")
.classpath("classes")
.sources(HSrc)

View File

@ -27,12 +27,10 @@
* @summary javac, previous solution for JDK-8022186 was incorrect
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main NoDeadCodeGenerationOnTrySmtTest
*/
@ -45,6 +43,9 @@ import com.sun.tools.classfile.Code_attribute.Exception_data;
import com.sun.tools.classfile.Method;
import com.sun.tools.javac.util.Assert;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class NoDeadCodeGenerationOnTrySmtTest {
static final String testSource =
@ -93,7 +94,7 @@ public class NoDeadCodeGenerationOnTrySmtTest {
}
void compileTestClass() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.sources(testSource)
.run();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -27,16 +27,18 @@
* @summary Inferring the exception thrown by a lambda: sometimes fails to compile
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main ExceptionInferenceFromClassFileTest
*/
import java.nio.file.Files;
import java.nio.file.Paths;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class ExceptionInferenceFromClassFileTest {
static final String ABSrc =
@ -61,12 +63,12 @@ public class ExceptionInferenceFromClassFileTest {
ToolBox tb = new ToolBox();
tb.createDirectories("out");
tb.new JavacTask()
new JavacTask(tb)
.outdir("out")
.sources(ABSrc)
.run();
tb.new JavacTask()
new JavacTask(tb)
.outdir("out")
.classpath("out")
.sources(CSrc)

View File

@ -27,10 +27,9 @@
* @summary No type annotations generated for nested lambdas
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavapTask
* @run compile -g NestedLambdasCastedTest.java
* @run main NestedLambdasCastedTest
*/
@ -40,20 +39,24 @@ import java.nio.file.Paths;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import toolbox.JavapTask;
import toolbox.Task;
import toolbox.ToolBox;
public class NestedLambdasCastedTest {
// Expected output can't be directly encoded into NestedLambdasCastedTest !!!
static class ExpectedOutputHolder {
public String [] outputs = {
public String[] outputs = {
"public static strictfp void main(java.lang.String[])",
"private static strictfp void lambda$main$3();",
"private static strictfp void lambda$main$2();",
"private static strictfp void lambda$main$1();",
"private static strictfp void lambda$main$0();",
"0: #63(#64=s#65): CAST, offset=5, type_index=0",
"0: #63(#64=s#70): CAST, offset=5, type_index=0",
"0: #63(#64=s#73): CAST, offset=5, type_index=0",
"0: #63(#64=s#76): CAST, offset=5, type_index=0"
"0: #62(#63=s#64): CAST, offset=5, type_index=0",
"0: #62(#63=s#69): CAST, offset=5, type_index=0",
"0: #62(#63=s#72): CAST, offset=5, type_index=0",
"0: #62(#63=s#75): CAST, offset=5, type_index=0"
};
}
@ -73,11 +76,11 @@ public class NestedLambdasCastedTest {
};
ToolBox tb = new ToolBox();
Path classPath = Paths.get(ToolBox.testClasses, "NestedLambdasCastedTest.class");
String javapOut = tb.new JavapTask()
String javapOut = new JavapTask(tb)
.options("-v", "-p")
.classes(classPath.toString())
.run()
.getOutput(ToolBox.OutputKind.DIRECT);
.getOutput(Task.OutputKind.DIRECT);
ExpectedOutputHolder holder = new ExpectedOutputHolder();
for (String s : holder.outputs) {
if (!javapOut.contains(s))

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2016, 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
@ -27,15 +27,17 @@
* @summary ToolProvider should be less compiler-specific
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavaTask
* @run main HelloWorldTest
*/
import java.util.Arrays;
import toolbox.JavaTask;
import toolbox.Task;
import toolbox.ToolBox;
// verify that running a simple program, such as this one, does not trigger
// the loading of ToolProvider or any com.sun.tools.javac class
public class HelloWorldTest {
@ -53,15 +55,15 @@ public class HelloWorldTest {
String classpath = System.getProperty("java.class.path");
ToolBox.Result tr = tb.new JavaTask()
Task.Result tr = new JavaTask(tb)
.vmOptions("-verbose:class")
.classpath(classpath)
.className(HelloWorldTest.class.getName())
.classArgs("Hello", "World")
.run();
if (tr.getOutput(ToolBox.OutputKind.STDOUT).contains("java.lang.Object")) {
for (String line : tr.getOutputLines(ToolBox.OutputKind.STDOUT)) {
if (tr.getOutput(Task.OutputKind.STDOUT).contains("java.lang.Object")) {
for (String line : tr.getOutputLines(Task.OutputKind.STDOUT)) {
System.err.println(line);
if (line.contains("javax.tools.ToolProvider") || line.contains("com.sun.tools.javac."))
error(">>> " + line);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2016, 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
@ -27,15 +27,17 @@
* @summary ToolProvider should be less compiler-specific
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavaTask
* @run main ToolProviderTest1
*/
import java.util.List;
import toolbox.JavaTask;
import toolbox.Task;
import toolbox.ToolBox;
// verify that running accessing ToolProvider by itself does not
// trigger loading com.sun.tools.javac.*
public class ToolProviderTest1 {
@ -52,13 +54,13 @@ public class ToolProviderTest1 {
ToolBox tb = new ToolBox();
String classpath = System.getProperty("java.class.path");
List<String> lines = tb.new JavaTask()
List<String> lines = new JavaTask(tb)
.vmOptions("-verbose:class")
.classpath(classpath)
.className(getClass().getName())
.classArgs("javax.tools.ToolProvider")
.run()
.getOutputLines(ToolBox.OutputKind.STDOUT);
.getOutputLines(Task.OutputKind.STDOUT);
for (String line : lines) {
System.err.println(line);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2016, 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
@ -27,16 +27,18 @@
* @summary ToolProvider should be less compiler-specific
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavaTask
* @run main ToolProviderTest2
*/
import javax.tools.ToolProvider;
import java.util.List;
import toolbox.JavaTask;
import toolbox.Task;
import toolbox.ToolBox;
// control for ToolProviderTest1 -- verify that using ToolProvider to
// access the compiler does trigger loading com.sun.tools.javac.*
public class ToolProviderTest2 {
@ -53,13 +55,13 @@ public class ToolProviderTest2 {
ToolBox tb = new ToolBox();
String classpath = System.getProperty("java.class.path");
List<String> lines = tb.new JavaTask()
List<String> lines = new JavaTask(tb)
.vmOptions("-verbose:class")
.classpath(classpath)
.className(getClass().getName())
.classArgs("javax.tools.ToolProvider")
.run()
.getOutputLines(ToolBox.OutputKind.STDOUT);
.getOutputLines(Task.OutputKind.STDOUT);
boolean found = false;
for (String line : lines) {

View File

@ -25,10 +25,12 @@
* @test
* @bug 8143388
* @summary Verify that boxed postfix operator works properly when referring to super class' field.
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib
* @build toolbox.ToolBox toolbox.JavacTask
* @run main IncrementBoxedAndAccess
*/
import java.io.IOException;
@ -36,6 +38,9 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class IncrementBoxedAndAccess {
public static void main(String... args) throws IOException {
new IncrementBoxedAndAccess().run();
@ -47,7 +52,7 @@ public class IncrementBoxedAndAccess {
Path expected = Paths.get("expected");
Files.createDirectories(expected);
tb.cleanDirectory(expected);
tb.new JavacTask()
new JavacTask(tb)
.sources("package p1;" +
"public class B {" +
" protected Integer i;" +
@ -68,7 +73,7 @@ public class IncrementBoxedAndAccess {
Path actual = Paths.get("actual");
Files.createDirectories(actual);
tb.cleanDirectory(actual);
tb.new JavacTask()
new JavacTask(tb)
.sources("package p1;" +
"public class B {" +
" protected Integer i;" +

View File

@ -26,11 +26,10 @@
* @summary Verify that nested enums have correct abstract flag in the InnerClasses attribute.
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox T8068517
* @build toolbox.ToolBox toolbox.JavacTask
* @build T8068517
* @run main T8068517
*/
@ -40,6 +39,9 @@ import javax.tools.JavaFileManager;
import javax.tools.StandardLocation;
import javax.tools.ToolProvider;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class T8068517 {
public static void main(String[] args) throws Exception {
@ -106,11 +108,11 @@ public class T8068517 {
try (JavaFileManager fm = ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null)) {
ToolBox tb = new ToolBox();
ToolBox.MemoryFileManager memoryFM1 = new ToolBox.MemoryFileManager(fm);
tb.new JavacTask().fileManager(memoryFM1)
new JavacTask(tb).fileManager(memoryFM1)
.sources(aJava, bJava)
.run();
ToolBox.MemoryFileManager memoryFM2 = new ToolBox.MemoryFileManager(fm);
tb.new JavacTask().fileManager(memoryFM2)
new JavacTask(tb).fileManager(memoryFM2)
.sources(bJava, aJava)
.run();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,16 +27,13 @@
* @summary Checking AnnotationDefault attribute.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build AnnotationDefaultTest TestBase TestResult InMemoryFileManager ToolBox AnnotationDefaultVerifier
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build AnnotationDefaultTest AnnotationDefaultVerifier
* @run main AnnotationDefaultTest
*/
import com.sun.tools.classfile.*;
import java.io.File;
import java.io.IOException;
import java.lang.annotation.RetentionPolicy;
@ -48,6 +45,8 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.sun.tools.classfile.*;
public class AnnotationDefaultTest extends TestResult {
private final static String templateFileName = "AnnotationDefault.java.template";

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,9 @@
* @summary Checking EnclosingMethod attribute of anonymous/local class.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build EnclosingMethodTest TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @run main EnclosingMethodTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -30,8 +30,8 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox TestBase InMemoryFileManager LineNumberTestBase Container TestCase
* @build toolbox.ToolBox InMemoryFileManager TestBase
* @build LineNumberTestBase Container TestCase
* @run main LineNumberTest
*/
public class LineNumberTest extends LineNumberTestBase {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -30,8 +30,8 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox LocalVariableTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase
* @build LocalVariableTestBase
* @compile -g LocalVariableTableTest.java
* @run main LocalVariableTableTest
*/

View File

@ -30,8 +30,7 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox LocalVariableTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase LocalVariableTestBase
* @compile -g LocalVariableTypeTableTest.java
* @run main LocalVariableTypeTableTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -30,8 +30,7 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask toolbox.ToolBox
* @run main ModuleFlagTest
*/
@ -43,13 +42,16 @@ import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class ModuleFlagTest {
public static void main(String[] args) throws IOException, ConstantPoolException {
Path outdir = Paths.get(".");
ToolBox tb = new ToolBox();
final Path moduleInfo = Paths.get("module-info.java");
tb.writeFile(moduleInfo, "module test_module{}");
tb.new JavacTask()
new JavacTask(tb)
.outdir(outdir)
.files(moduleInfo)
.run();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -29,9 +29,9 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib ../lib /tools/javac/lib
* @build ToolBox TestBase TestResult ModuleTestBase
* @build toolbox.ToolBox toolbox.JavacTask toolbox.ToolBox
* TestBase TestResult ModuleTestBase
* @run main ModuleTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -42,6 +42,10 @@ import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import toolbox.JavacTask;
import toolbox.Task;
import toolbox.ToolBox;
public class ModuleTestBase {
protected final ToolBox tb = new ToolBox();
private final TestResult tr = new TestResult();
@ -124,9 +128,9 @@ public class ModuleTestBase {
}
protected void compile(Path base) throws IOException {
tb.new JavacTask()
new JavacTask(tb)
.files(findJavaFiles(base))
.run(ToolBox.Expect.SUCCESS)
.run(Task.Expect.SUCCESS)
.writeAll();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -27,11 +27,9 @@
* @summary Checks Signature attribute for constructors.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build ConstructorTest Driver ExpectedSignature ExpectedSignatureContainer
* @run main Driver ConstructorTest
*/

View File

@ -27,11 +27,9 @@
* @summary Checks Signature attribute for enum.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build EnumTest Driver ExpectedSignature ExpectedSignatureContainer
* @run main Driver EnumTest
*/

View File

@ -27,11 +27,9 @@
* @summary Checks Signature attribute for methods which throw exceptions.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build ExceptionTest Driver ExpectedSignature ExpectedSignatureContainer
* @run main Driver ExceptionTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -27,11 +27,9 @@
* @summary Checks Signature attribute for fields.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build FieldTest Driver ExpectedSignature ExpectedSignatureContainer
* @run main Driver FieldTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -27,11 +27,9 @@
* @summary Checks Signature attribute for inner classes.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassTest Driver ExpectedSignature ExpectedSignatureContainer
* @run main Driver InnerClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -27,11 +27,9 @@
* @summary Checks Signature attribute for method parameters.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build MethodParameterTest Driver ExpectedSignature ExpectedSignatureContainer
* @run main Driver MethodParameterTest
*/

View File

@ -27,11 +27,9 @@
* @summary Checks Signature attribute for type bounds.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build MethodTypeBoundTest Driver ExpectedSignature ExpectedSignatureContainer
* @run main Driver MethodTypeBoundTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,11 +28,9 @@
* @library /tools/lib /tools/javac/lib ../lib
* @modules java.desktop
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build ReturnTypeTest Driver ExpectedSignature ExpectedSignatureContainer
* @run main Driver ReturnTypeTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,9 @@
* @bug 8040129
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox SourceFileTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase SourceFileTestBase
* @run main AnonymousClassTest
*/

View File

@ -27,11 +27,9 @@
* @bug 8040129
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox SourceFileTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase SourceFileTestBase
* @run main InnerClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,9 @@
* @bug 8040129
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox SourceFileTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase SourceFileTestBase
* @run main LocalClassTest
*/

View File

@ -27,11 +27,9 @@
* @bug 8040129
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox SourceFileTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase SourceFileTestBase
* @run main MixTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -27,27 +27,29 @@
* @bug 8080878
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox SourceFileTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox toolbox.JavacTask InMemoryFileManager TestBase SourceFileTestBase
* @run main ModuleInfoTest
*/
import java.nio.file.Path;
import java.nio.file.Paths;
import toolbox.JavacTask;
import toolbox.Task;
import toolbox.ToolBox;
public class ModuleInfoTest extends SourceFileTestBase {
public static void main(String[] args) throws Exception {
Path outdir = Paths.get(".");
ToolBox tb = new ToolBox();
final Path moduleInfo = Paths.get("module-info.java");
tb.writeFile(moduleInfo, "module m1{}");
tb.new JavacTask()
new JavacTask(tb)
.files(moduleInfo)
.outdir(outdir)
.run(ToolBox.Expect.SUCCESS)
.run(Task.Expect.SUCCESS)
.writeAll();
new ModuleInfoTest().test(outdir.resolve("module-info.class"), "module-info.java");

View File

@ -27,11 +27,9 @@
* @bug 8040129
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox SourceFileTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase SourceFileTestBase
* @compile -g:none NoSourceFileAttribute.java
* @run main NoSourceFileAttribute
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -31,6 +31,8 @@ import java.util.List;
import java.util.Map;
import javax.tools.JavaFileObject;
import toolbox.ToolBox;
/**
* Base class for Source file attribute tests. Checks expected file name for specified classes in the SourceFile attribute.
* To add new tests you should extend the SourceFileTestBase class and invoke {@link #test} for static sources

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,9 @@
* @bug 8040129
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox SourceFileTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase SourceFileTestBase
* @run main SyntheticClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,9 @@
* @bug 8040129
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox SourceFileTestBase TestBase InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestBase SourceFileTestBase
* @run main TopLevelClassesOneFileTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -27,12 +27,10 @@
* @summary Checking ACC_SYNTHETIC flag is generated for access method
* generated to access to private methods and fields.
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult
* @build AccessToPrivateInnerClassMembersTest SyntheticTestDriver ExpectedClass ExpectedClasses
* @run main SyntheticTestDriver AccessToPrivateInnerClassMembersTest 1
*/

View File

@ -29,9 +29,8 @@
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build AccessToPrivateSiblingsTest SyntheticTestDriver ExpectedClass ExpectedClasses
* @run main SyntheticTestDriver AccessToPrivateSiblingsTest 1
*/

View File

@ -26,12 +26,10 @@
* @bug 8044537
* @summary Checking ACC_SYNTHETIC flag is generated for assert statement.
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build AssertFieldTest SyntheticTestDriver ExpectedClass ExpectedClasses
* @run main SyntheticTestDriver AssertFieldTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -26,12 +26,10 @@
* @bug 8044537
* @summary Checking ACC_SYNTHETIC flag is generated for bridge method generated for generic method.
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build BridgeMethodForGenericMethodTest SyntheticTestDriver ExpectedClass ExpectedClasses
* @run main SyntheticTestDriver BridgeMethodForGenericMethodTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -27,12 +27,10 @@
* @summary Checking ACC_SYNTHETIC flag is generated for bridge method
* generated for lambda expressions and method references.
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build BridgeMethodsForLambdaTest SyntheticTestDriver ExpectedClass ExpectedClasses
* @run main SyntheticTestDriver BridgeMethodsForLambdaTest 1
*/

View File

@ -26,12 +26,10 @@
* @bug 8044537
* @summary Checking ACC_SYNTHETIC flag is generated for enum members.
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build EnumTest SyntheticTestDriver ExpectedClass ExpectedClasses
* @run main SyntheticTestDriver EnumTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -26,12 +26,10 @@
* @bug 8044537
* @summary Checking ACC_SYNTHETIC flag is generated for package-info.
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build SyntheticTestDriver ExpectedClass ExpectedClasses
* @compile -Xpkginfo:always package_info_test/package-info.java
* @run main SyntheticTestDriver package_info_test.package-info 1

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,9 +28,8 @@
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build ThisFieldTest SyntheticTestDriver ExpectedClass ExpectedClasses
* @run main SyntheticTestDriver ThisFieldTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -29,10 +29,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeAnnotationsForGenericMethodTest AnnotationsTestBase RuntimeAnnotationsTestBase
* @run main RuntimeAnnotationsForGenericMethodTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,10 +28,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeAnnotationsForInnerAnnotationTest AnnotationsTestBase RuntimeAnnotationsTestBase
* @run main RuntimeAnnotationsForInnerAnnotationTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,10 +28,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeAnnotationsForInnerClassTest AnnotationsTestBase RuntimeAnnotationsTestBase
* @run main RuntimeAnnotationsForInnerClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,10 +28,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeAnnotationsForInnerEnumTest AnnotationsTestBase RuntimeAnnotationsTestBase
* @run main RuntimeAnnotationsForInnerEnumTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,10 +28,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeAnnotationsForInnerInterfaceTest AnnotationsTestBase RuntimeAnnotationsTestBase
* @run main RuntimeAnnotationsForInnerInterfaceTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,10 +28,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeAnnotationsForTopLevelClassTest AnnotationsTestBase RuntimeAnnotationsTestBase
* @run main RuntimeAnnotationsForTopLevelClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -29,10 +29,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeParameterAnnotationsForGenericMethodTest AnnotationsTestBase RuntimeParameterAnnotationsTestBase
* @run main RuntimeParameterAnnotationsForGenericMethodTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,10 +28,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeParameterAnnotationsForLambdaTest AnnotationsTestBase RuntimeParameterAnnotationsTestBase
* @run main RuntimeParameterAnnotationsForLambdaTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -28,10 +28,9 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @library /tools/lib /tools/javac/lib ../lib
* @build WorkAnnotations TestBase TestResult InMemoryFileManager ToolBox
* @build TestCase ClassType TestAnnotationInfo
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build WorkAnnotations TestCase ClassType TestAnnotationInfo
* @build RuntimeParameterAnnotationsTest AnnotationsTestBase RuntimeParameterAnnotationsTestBase
* @run main RuntimeParameterAnnotationsTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -30,8 +30,7 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox TestBase TestResult InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @run main DeprecatedPackageTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -31,8 +31,7 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox TestBase TestResult InMemoryFileManager
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @run main DeprecatedTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner annotations in inner annotation.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerAnnotationsInInnerAnnotationTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner annotations in inner class.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerAnnotationsInInnerClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner annotations in inner enum.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerAnnotationsInInnerEnumTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner annotations in inner interface.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerAnnotationsInInnerInterfaceTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,17 +27,12 @@
* @summary Test that inner classes have in its inner classes attribute enclosing classes and its immediate members.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestResult TestBase InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @run main InnerClassesHierarchyTest
*/
import com.sun.tools.classfile.*;
import com.sun.tools.classfile.InnerClasses_attribute.Info;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
@ -45,6 +40,9 @@ import java.lang.annotation.Annotation;
import java.util.*;
import java.util.stream.Collectors;
import com.sun.tools.classfile.*;
import com.sun.tools.classfile.InnerClasses_attribute.Info;
public class InnerClassesHierarchyTest extends TestResult {
private final Map<String, Set<String>> innerClasses;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner classes in anonymous class.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesTestBase TestResult TestBase InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesTestBase
* @run main InnerClassesInAnonymousClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner classes in inner annotation.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestResult TestBase InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerClassesInInnerAnnotationTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner classes in inner class.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestResult TestBase InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerClassesInInnerClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner classes in inner enum.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestResult TestBase InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerClassesInInnerEnumTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner classes in inner interface.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestResult TestBase InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerClassesInInnerInterfaceTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -28,10 +28,9 @@
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesTestBase TestResult TestBase InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesTestBase
* @run main InnerClassesInLocalClassTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,9 @@
* @summary Test that outer_class_info_index of local and anonymous class is zero.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @run main InnerClassesIndexTest
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -27,11 +27,10 @@
* @summary Testing inner classes attributes.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesTestBase TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesTestBase
* @run main InnerClassesTest
*/

View File

@ -27,11 +27,10 @@
* @summary Testing InnerClasses_attribute of inner enums in inner annotation.
* @library /tools/lib /tools/javac/lib ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.classfile
* jdk.jdeps/com.sun.tools.javap
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase TestBase TestResult InMemoryFileManager ToolBox
* @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
* @build InnerClassesInInnerClassTestBase InnerClassesTestBase
* @run main InnerEnumInInnerAnnotationTest
*/

Some files were not shown because too many files have changed in this diff Show More