groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Sadedin <>
Subject Re: Can we get rid of illegal reflective access operation warnings?
Date Fri, 12 Oct 2018 23:24:36 GMT
> Hi,
> It's long overdue, but the status quo is not really nice. Running Groovy
> on Java 9+ gives warnings like this:
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by
> org.codehaus.groovy.vmplugin.v7.Java7$1
> (file:/tmp/groovy-2.5.3/target/groovy-2.5.3/lib/groovy-2.5.3.jar) to
> constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
> WARNING: Please consider reporting this to the maintainers of
> org.codehaus.groovy.vmplugin.v7.Java7$1

I am curious if the approach utilising sun.misc.Unsafe discussed in this
stack overflow thread has been considered?

It's definitely a hack and may not work on all JVMs or in the future.
Nonetheless, I still consider it superior to having these warnings emitted,
and it fairly cleanly just turns off logging of these messages. The main
downside is it turns them off globally so non-groovy related warnings and
maybe other messages of interest from the same logger would also not be



View raw message