On 20/10/2016 15:27, Stephen Felts wrote:
:
Jython seems to be doing a setAccessible on a lot of methods. It catches
SecurityException and ignores it. Of course, JDK9 throws a different exception
so the code is broken.
Further, the new exception is JDK9 only so the code needs to change to catch
and ignore RuntimeException.
Comment from Jython:
Set public methods on package protected classes accessible so
that reflected calls to the method in subclasses of the
package protected class will succeed. Yes, it's convoluted.
Yeah, it seems to be hacking into a few sun.* classes during startup
(only seen with -Dsun.reflect.debugModuleAccessChecks=true) but it seems
to continue without side effect after that.
java.lang.reflect.InaccessibleObjectException: Unable to make public
abstract java.io.FileDescriptor sun.nio.ch.SelChImpl.getFD() accessible:
module java.base does not "exports sun.nio.ch" to unnamed module @31dadd46
at
java.base/jdk.internal.reflect.Reflection.throwInaccessibleObjectException(Reflection.java:414)
at
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:198)
at
java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:192)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:186)
at jnr.posix.JavaLibCHelper.<clinit>(JavaLibCHelper.java:92)
at jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:37)
at jnr.posix.MacOSPOSIX.<init>(MacOSPOSIX.java:11)
at jnr.posix.POSIXFactory.loadMacOSPOSIX(POSIXFactory.java:99)
at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:66)
at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:38)
at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:35)
at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:31)
at jnr.posix.LazyPOSIX.isatty(LazyPOSIX.java:205)
at org.python.core.Py.isInteractive(Py.java:1548)
at org.python.util.jython.run(jython.java:255)
at org.python.util.jython.main(jython.java:142)
java.lang.reflect.InaccessibleObjectException: Unable to make field
private final java.io.FileDescriptor sun.nio.ch.FileChannelImpl.fd
accessible: module java.base does not "exports private sun.nio.ch" to
unnamed module @31dadd46
at
java.base/jdk.internal.reflect.Reflection.throwInaccessibleObjectException(Reflection.java:414)
at
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:198)
at
java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:171)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:165)
at jnr.posix.JavaLibCHelper.<clinit>(JavaLibCHelper.java:109)
at jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:37)
at jnr.posix.MacOSPOSIX.<init>(MacOSPOSIX.java:11)
at jnr.posix.POSIXFactory.loadMacOSPOSIX(POSIXFactory.java:99)
at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:66)
at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:38)
at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:35)
at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:31)
at jnr.posix.LazyPOSIX.isatty(LazyPOSIX.java:205)
at org.python.core.Py.isInteractive(Py.java:1548)
at org.python.util.jython.run(jython.java:255)
at org.python.util.jython.main(jython.java:142)