Repository: polygene-java Updated Branches: refs/heads/develop 98b50f20b -> e9cf109c6
POLYGENE-253 - The problem with the default method interception on Java 9 is solved. Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/e9cf109c Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/e9cf109c Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/e9cf109c Branch: refs/heads/develop Commit: e9cf109c68a96a7e631ad4def9df86893b6e0d60 Parents: 98b50f2 Author: niclas <nic...@hedhman.org> Authored: Sun May 6 21:54:04 2018 +0800 Committer: niclas <nic...@hedhman.org> Committed: Sun May 6 21:54:04 2018 +0800 ---------------------------------------------------------------------- .../runtime/composite/InterfaceDefaultMethodsMixin.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e9cf109c/core/runtime/src/main/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsMixin.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsMixin.java b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsMixin.java index 835f74b..d88d680 100644 --- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsMixin.java +++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsMixin.java @@ -30,6 +30,10 @@ import org.apache.polygene.api.composite.Composite; import org.apache.polygene.api.composite.DefaultMethodsFilter; import org.apache.polygene.api.injection.scope.This; +import static java.lang.invoke.MethodHandles.Lookup.PACKAGE; +import static java.lang.invoke.MethodHandles.Lookup.PRIVATE; +import static java.lang.invoke.MethodHandles.Lookup.PROTECTED; +import static java.lang.invoke.MethodHandles.Lookup.PUBLIC; import static org.apache.polygene.api.util.AccessibleObjects.accessible; @AppliesTo( { DefaultMethodsFilter.class } ) @@ -67,7 +71,7 @@ public class InterfaceDefaultMethodsMixin try { Constructor<MethodHandles.Lookup> constructor = MethodHandles.Lookup.class.getDeclaredConstructor( Class.class, int.class ); - MethodHandles.Lookup lookup = accessible( constructor ).newInstance( declaringClass, MethodHandles.Lookup.PRIVATE ); + MethodHandles.Lookup lookup = accessible( constructor ).newInstance( declaringClass, PRIVATE | PUBLIC | PROTECTED | PACKAGE); MethodHandle handle = lookup.unreflectSpecial( method, declaringClass ); return ( proxy, args ) -> handle.bindTo( proxy ).invokeWithArguments( args ); }