Skip to content
Permalink
Browse files

8236997: tools/javac tests fail with --illegal-access=deny

Correctly exporting packages to tests.

Reviewed-by: jlahoda
  • Loading branch information
asotona authored and Jan Lahoda committed Jan 28, 2020
1 parent a89b838 commit f2013ac2471b2322c7a6e146001ad203ec2c4b5d
Showing with 31 additions and 97 deletions.
  1. +1 −0 test/jdk/java/lang/reflect/Proxy/ProxyGeneratorCombo.java
  2. +1 −4 test/langtools/tools/javac/DefiniteAssignment/T8204610.java
  3. +1 −4 test/langtools/tools/javac/T7093325.java
  4. +1 −2 test/langtools/tools/javac/T8222949/TestConstantDynamic.java
  5. +1 −4 test/langtools/tools/javac/cast/intersection/IntersectionTypeCastTest.java
  6. +1 −1 test/langtools/tools/javac/classwriter/ExtraAttributes.java
  7. +1 −4 test/langtools/tools/javac/defaultMethods/static/hiding/InterfaceMethodHidingTest.java
  8. +1 −4 test/langtools/tools/javac/defaultMethods/super/TestDefaultSuperCall.java
  9. +1 −2 test/langtools/tools/javac/failover/CheckAttributedTree.java
  10. +1 −4 test/langtools/tools/javac/generics/diamond/7046778/DiamondAndInnerClassTest.java
  11. +1 −4 test/langtools/tools/javac/generics/inference/8176534/TestUncheckedCalls.java
  12. +1 −4 test/langtools/tools/javac/generics/rawOverride/7062745/GenericOverrideTest.java
  13. +1 −4 test/langtools/tools/javac/lambda/FunctionalInterfaceConversionTest.java
  14. +1 −4 test/langtools/tools/javac/lambda/LambdaParserTest.java
  15. +1 −4 test/langtools/tools/javac/lambda/MethodReferenceParserTest.java
  16. +1 −2 test/langtools/tools/javac/lambda/TestInvokeDynamic.java
  17. +1 −4 test/langtools/tools/javac/lambda/TestLambdaToMethodStats.java
  18. +1 −4 test/langtools/tools/javac/lambda/bytecode/TestLambdaBytecode.java
  19. +1 −0 test/langtools/tools/javac/lambda/deduplication/ClassFieldDeduplication.java
  20. +1 −4 test/langtools/tools/javac/lambda/mostSpecific/StructuralMostSpecificTest.java
  21. +1 −4 test/langtools/tools/javac/lambda/typeInference/combo/TypeInferenceComboTest.java
  22. +3 −9 test/langtools/tools/javac/lib/combo/ComboInstance.java
  23. +1 −4 test/langtools/tools/javac/multicatch/7030606/DisjunctiveTypeWellFormednessTest.java
  24. +2 −1 test/langtools/tools/javac/plugin/InternalAPI.java
  25. +1 −4 test/langtools/tools/javac/resolve/BitWiseOperators.java
  26. +1 −4 test/langtools/tools/javac/varargs/7042566/T7042566.java
  27. +1 −4 test/langtools/tools/javac/varargs/warning/Warn4.java
  28. +1 −4 test/langtools/tools/javac/varargs/warning/Warn5.java
@@ -28,6 +28,7 @@
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.util
@@ -27,10 +27,7 @@
* @summary Compiler confused by parenthesized "this" in final fields assignments
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
@@ -29,10 +29,7 @@
* @library /tools/javac/lib
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main T7093325
@@ -29,8 +29,7 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.jvm
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.util
@@ -28,10 +28,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
@@ -86,7 +86,7 @@ void run() throws Exception {

List<String> stdout = new toolbox.JavacTask(tb)
.classpath(pluginJar)
.options("-Xplugin:ExtraAttributes")
.options("-XDaccessInternalAPI")
.outdir(Files.createDirectories(Path.of("classes")))
.files(tb.findJavaFiles(src))
.run()
@@ -28,10 +28,7 @@
* Smoke test for static interface method hiding
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main InterfaceMethodHidingTest
@@ -28,10 +28,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main TestDefaultSuperCall
@@ -30,8 +30,7 @@
* @modules java.desktop
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
@@ -28,10 +28,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @compile -Xlint:all DiamondAndInnerClassTest.java
@@ -35,10 +35,7 @@
* @summary Missing check against target-type during applicability inference
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
*
@@ -29,10 +29,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main GenericOverrideTest
@@ -29,10 +29,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main FunctionalInterfaceConversionTest
@@ -29,10 +29,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
@@ -29,10 +29,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main MethodReferenceParserTest
@@ -31,8 +31,7 @@
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.jvm
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.util
@@ -27,10 +27,7 @@
* @summary Add stat support to LambdaToMethod
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main TestLambdaToMethodStats
@@ -28,10 +28,7 @@
* @library /tools/javac/lib
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main TestLambdaBytecode
@@ -28,6 +28,7 @@
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
@@ -29,10 +29,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
@@ -30,10 +30,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @compile TypeInferenceComboTest.java
@@ -23,10 +23,11 @@

package combo;

import java.lang.reflect.Method;
import javax.tools.StandardJavaFileManager;
import java.util.Optional;

import com.sun.tools.javac.file.BaseFileManager;

/**
* This class is the common superclass of all combo test instances. It defines few helper methods
* to build compilation tasks using the shared context object, as well as entry points for
@@ -58,14 +59,7 @@ final void run(ComboTestHelper<X>.Env env) {
env.info().lastError = Optional.of(ex);
} finally {
this.env = null;
try {
Class<?> fmClass = env.fileManager().getClass();
Method clear = fmClass.getMethod("clear");
clear.setAccessible(true);
clear.invoke(env.fileManager());
} catch (Exception ex) {
throw new IllegalStateException(ex);
}
((BaseFileManager) env.fileManager()).clear();
}
}

@@ -28,10 +28,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main DisjunctiveTypeWellFormednessTest
@@ -27,6 +27,7 @@
* @summary Extend support for -XDaccessInternalAPI to plugin modules
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.main
* jdk.jlink
* @build toolbox.ToolBox toolbox.JavacTask toolbox.JarTask
@@ -127,10 +128,10 @@ void run() throws Exception {
runTests(m -> new Object[] { Path.of(m.getName()) });
}

// -XDaccessInternalAPI has always been supported for classpath plugins
@Test
public void testClassPath(Path base) throws Exception {
List<String> stdout = new JavacTask(tb)
.options("-XDaccessInternalAPI")
.classpath(pluginJar)
.outdir(Files.createDirectories(base.resolve("out")))
.files(tb.findJavaFiles(Path.of("hw")))
@@ -27,10 +27,7 @@
* @summary Verify that bitwise operators don't allow to mix numeric and boolean operands.
* @library ../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main BitWiseOperators
@@ -29,10 +29,7 @@
* @library /tools/javac/lib
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main T7042566
@@ -28,10 +28,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main Warn4
@@ -28,10 +28,7 @@
* temporarily workaround combo tests are causing time out in several platforms
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.comp
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.tree
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.util
* @build combo.ComboTestHelper
* @run main/othervm Warn5

0 comments on commit f2013ac

Please sign in to comment.