> A trySetAccessible is possible although a @CS variant of accessCheck (like in > MH.Lookup) might be more general. I think we need to be cautious about adding > APIs here and so would be interesting to get some performance data here (I > > don't think I've seen the bulk setAccessible used very often, it's almost > always the instance method).
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.