daniellansun commented on code in PR #1771:
URL: https://github.com/apache/groovy/pull/1771#discussion_r956661653
##########
buildSrc/src/main/groovy/org.apache.groovy-tested.gradle:
##########
@@ -32,12 +32,18 @@ sourceSets {
}
}
+// TODO remove the jdk16+ add-opens jvm args once offending code/tests are
fixed
+//
https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#removes_implicit_add_opens_for_test_workers
tasks.withType(Test).configureEach {
def fs = objects.newInstance(TestServices).fileSystemOperations
def grapeDirectory = new File(temporaryDir, "grape")
def jdk8 = ['-XX:+UseConcMarkSweepGC']
def jdk9 = ['-Djava.locale.providers=COMPAT,SPI']
// def jdk9 = ['-Djava.locale.providers=COMPAT,SPI',
'--illegal-access=debug']
+ if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
+ jdk9 += ["--add-opens=java.base/java.lang=ALL-UNNAMED",
+ "--add-opens=java.base/java.util=ALL-UNNAMED"]
Review Comment:
The remaining issue seems just related to accessing `clone` illegally, e.g.
`AutoClone`.
( https://github.com/apache/groovy/runs/8015134704?check_suite_focus=true )
```
org.codehaus.groovy.transform.ImmutableTransformTest > testCloneableField
FAILED
java.lang.IllegalAccessException: class
org.codehaus.groovy.reflection.CachedMethod cannot access a member of class
java.lang.Object (in module java.base) with modifiers "protected native"
at
java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:392)
at
java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:674)
at java.base/java.lang.reflect.Method.invoke(Method.java:560)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1372)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1104)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1010)
at
org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:610)
at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:[593](https://github.com/apache/groovy/runs/8015134704?check_suite_focus=true#step:5:594))
at
org.codehaus.groovy.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:50)
at
org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
at Lab.<init>(Script1.groovy)
at
org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
at Script1.run(Script1.groovy:14)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:460)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:495)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:469)
at groovy.lang.GroovyShell$evaluate$0.call(Unknown Source)
at
groovy.test.GroovyShellTestCase.evaluate(GroovyShellTestCase.groovy:26)
at groovy.test.GroovyShellTestCase$evaluate.callCurrent(Unknown
Source)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
at
org.codehaus.groovy.transform.ImmutableTransformTest.testCloneableField(ImmutableTransformTest.groovy:113)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]