You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Daniel Sun <su...@apache.org> on 2021/06/13 09:07:01 UTC

About the tests failed on JDK16

Hi all,

   I created a branch[1] to try running tests with JDK16, and I found 39 tests failed[2]. If somebody have some spare time, let's look into the issues and try to fix them together.

[1] https://github.com/apache/groovy/tree/danielsun/tweak-build
[2] https://travis-ci.com/github/apache/groovy/jobs/513334181

Cheers,
Daniel Sun

Re: About the tests failed on JDK16

Posted by Daniel Sun <su...@apache.org>.
> In JDK 17 the illegal-access flag is ignored and you can't open the internals anymore. So you need a long term solution.

Thanks for your reminder. JDK 16+ should be supported if the following PR is accepted:
https://github.com/apache/groovy/pull/1598

Cheers,
Daniel Sun
On 2021/06/13 12:37:57, Uwe Schindler <us...@apache.org> wrote: 
> Hi,
> 
> In JDK 17 the illegal-access flag is ignored and you can't open the internals anymore. So you need a long term solution.
> 
> Uww
> 
> Am June 13, 2021 9:22:17 AM UTC schrieb Daniel Sun <su...@apache.org>:
> >FYI. "the default value of the launcher option --illegal-access is now
> >deny rather than permit"
> >
> >See also
> >https://www.oracle.com/java/technologies/javase/16-all-relnotes.html
> >
> >➜ JEP 396: Strongly Encapsulate JDK Internals by Default
> >Strongly encapsulate all internal elements of the JDK by default,
> >except for critical internal APIs such as sun.misc.Unsafe. Allow end
> >users to choose the relaxed strong encapsulation that has been the
> >default since JDK 9.
> >
> >With this change, the default value of the launcher option
> >--illegal-access is now deny rather than permit. As a consequence,
> >existing code that uses most internal classes, methods, or fields of
> >the JDK will fail to run. Such code can be made to run on JDK 16 by
> >specifying --illegal-access=permit. That option will, however, be
> >removed in a future release.
> >
> >On 2021/06/13 09:07:01, Daniel Sun <su...@apache.org> wrote: 
> >> Hi all,
> >> 
> >>    I created a branch[1] to try running tests with JDK16, and I found
> >39 tests failed[2]. If somebody have some spare time, let's look into
> >the issues and try to fix them together.
> >> 
> >> [1] https://github.com/apache/groovy/tree/danielsun/tweak-build
> >> [2] https://travis-ci.com/github/apache/groovy/jobs/513334181
> >> 
> >> Cheers,
> >> Daniel Sun
> >> 
> 

Re: About the tests failed on JDK16

Posted by Uwe Schindler <us...@apache.org>.
Hi,

In JDK 17 the illegal-access flag is ignored and you can't open the internals anymore. So you need a long term solution.

Uww

Am June 13, 2021 9:22:17 AM UTC schrieb Daniel Sun <su...@apache.org>:
>FYI. "the default value of the launcher option --illegal-access is now
>deny rather than permit"
>
>See also
>https://www.oracle.com/java/technologies/javase/16-all-relnotes.html
>
>➜ JEP 396: Strongly Encapsulate JDK Internals by Default
>Strongly encapsulate all internal elements of the JDK by default,
>except for critical internal APIs such as sun.misc.Unsafe. Allow end
>users to choose the relaxed strong encapsulation that has been the
>default since JDK 9.
>
>With this change, the default value of the launcher option
>--illegal-access is now deny rather than permit. As a consequence,
>existing code that uses most internal classes, methods, or fields of
>the JDK will fail to run. Such code can be made to run on JDK 16 by
>specifying --illegal-access=permit. That option will, however, be
>removed in a future release.
>
>On 2021/06/13 09:07:01, Daniel Sun <su...@apache.org> wrote: 
>> Hi all,
>> 
>>    I created a branch[1] to try running tests with JDK16, and I found
>39 tests failed[2]. If somebody have some spare time, let's look into
>the issues and try to fix them together.
>> 
>> [1] https://github.com/apache/groovy/tree/danielsun/tweak-build
>> [2] https://travis-ci.com/github/apache/groovy/jobs/513334181
>> 
>> Cheers,
>> Daniel Sun
>> 

Re: About the tests failed on JDK16

Posted by Daniel Sun <su...@apache.org>.
FYI. "the default value of the launcher option --illegal-access is now deny rather than permit"

See also https://www.oracle.com/java/technologies/javase/16-all-relnotes.html

➜ JEP 396: Strongly Encapsulate JDK Internals by Default
Strongly encapsulate all internal elements of the JDK by default, except for critical internal APIs such as sun.misc.Unsafe. Allow end users to choose the relaxed strong encapsulation that has been the default since JDK 9.

With this change, the default value of the launcher option --illegal-access is now deny rather than permit. As a consequence, existing code that uses most internal classes, methods, or fields of the JDK will fail to run. Such code can be made to run on JDK 16 by specifying --illegal-access=permit. That option will, however, be removed in a future release.

On 2021/06/13 09:07:01, Daniel Sun <su...@apache.org> wrote: 
> Hi all,
> 
>    I created a branch[1] to try running tests with JDK16, and I found 39 tests failed[2]. If somebody have some spare time, let's look into the issues and try to fix them together.
> 
> [1] https://github.com/apache/groovy/tree/danielsun/tweak-build
> [2] https://travis-ci.com/github/apache/groovy/jobs/513334181
> 
> Cheers,
> Daniel Sun
> 

Re: About the tests failed on JDK16

Posted by Daniel Sun <su...@apache.org>.
FYI. "All proxy classes are not open for reflective access in Java SE 16."

See also https://www.oracle.com/java/technologies/javase/16-relnotes.html

core-libs/java.lang:reflect
➜ Proxy Classes Are Not Open for Reflective Access
All proxy classes are not open for reflective access in Java SE 16.

Prior to Java SE 16, if java.lang.reflect.Proxy was used to implement only public exported proxy interfaces, the proxy class was generated in an unnamed module which was open for reflective access. In Java SE 16, the proxy class is generated in an exported package in a named module. Programs that assume the private members of a proxy class can be made accessible via setAccessible(true) will fail with InaccessibleObjectException. Proxy classes are already defined in dynamic modules in other cases since Java SE 9. Such programs would already fail when it calls setAccessible(true) to those proxy classes prior to this change.

On 2021/06/13 09:07:01, Daniel Sun <su...@apache.org> wrote: 
> Hi all,
> 
>    I created a branch[1] to try running tests with JDK16, and I found 39 tests failed[2]. If somebody have some spare time, let's look into the issues and try to fix them together.
> 
> [1] https://github.com/apache/groovy/tree/danielsun/tweak-build
> [2] https://travis-ci.com/github/apache/groovy/jobs/513334181
> 
> Cheers,
> Daniel Sun
>