Yes, it is safe to remove those overrides from DMH. You can count me as a reviewer. I like the test; it should be forward-ported to 9 if we don't already have something like it. — John
> On Nov 12, 2015, at 11:46 AM, Chuck Rasbold <rasb...@google.com> wrote: > > Proposed fix for: https://bugs.openjdk.java.net/browse/JDK-8142882 > > http://cr.openjdk.java.net/~rasbold/8142882/webrev.00/ > > Don't pre-dispatch the receiver of a DirectMethodHandle, as it may allow a > protected method to be accessed. > > This fix is a subset of the change for JDK-8050166 > <https://bugs.openjdk.java.net/browse/JDK-8050166>, which is already in > jdk8 and jdk9. > > The change causes the an NPE to be thrown when a protected MethodHandle is > called via invoke(). > An additional backport of JDK-8016839 > <https://bugs.openjdk.java.net/browse/JDK-8016839> is needed, if it is > desired to that a proper IllegalAccessError is thrown instead of an NPE, as > happens with jdk8 / jdk9.