You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by us...@apache.org on 2021/09/22 17:46:42 UTC

[solr] branch main updated: Only pass "--illegal-access=deny" up to JDK-15, later versions deprecate the option and default to "deny"

This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 0c1a6bf  Only pass "--illegal-access=deny" up to JDK-15, later versions deprecate the option and default to "deny"
0c1a6bf is described below

commit 0c1a6bf68f06eac6bd64392781fddc57dfa6cd1b
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Wed Sep 22 19:41:59 2021 +0200

    Only pass "--illegal-access=deny" up to JDK-15, later versions deprecate the option and default to "deny"
---
 gradle/testing/defaults-tests.gradle | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gradle/testing/defaults-tests.gradle b/gradle/testing/defaults-tests.gradle
index 9d65097..6178c79 100644
--- a/gradle/testing/defaults-tests.gradle
+++ b/gradle/testing/defaults-tests.gradle
@@ -105,7 +105,12 @@ allprojects {
       ignoreFailures = resolvedTestOption("tests.haltonfailure").toBoolean() == false
 
       jvmArgs Commandline.translateCommandline(resolvedTestOption("tests.jvmargs"))
-      jvmArgs '--illegal-access=deny'
+      
+      // Up to JDK-15 we have to enforce --illegal-access=deny, because we want no code to access
+      // JDK internals; JDK-16 and later will default to deny, see https://openjdk.java.net/jeps/396:
+      if (rootProject.runtimeJavaVersion < JavaVersion.VERSION_16) {
+        jvmArgs '--illegal-access=deny'
+      }
 
       systemProperty 'java.util.logging.config.file', file("${resources}/logging.properties")
       systemProperty 'java.awt.headless', 'true'