Repository: tapestry-5 Updated Branches: refs/heads/master 5abb9685d -> 6a63c5166
TAP5-2340: Make proxies honor Java 8 default methods Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/6a63c516 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/6a63c516 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/6a63c516 Branch: refs/heads/master Commit: 6a63c51669e950f40410cd44b45d0f0315c36659 Parents: 5abb968 Author: Howard M. Lewis Ship <[email protected]> Authored: Fri Aug 1 11:57:48 2014 -0700 Committer: Howard M. Lewis Ship <[email protected]> Committed: Fri Aug 1 11:57:48 2014 -0700 ---------------------------------------------------------------------- .../tapestry5/internal/plastic/PlasticClassImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63c516/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java ---------------------------------------------------------------------- diff --git a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java index 2b0fc15..328d2db 100644 --- a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java +++ b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java @@ -1,5 +1,3 @@ -// Copyright 2011, 2012 The Apache Software Foundation -// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -15,7 +13,6 @@ package org.apache.tapestry5.internal.plastic; import org.apache.tapestry5.internal.plastic.asm.AnnotationVisitor; -import org.apache.tapestry5.internal.plastic.asm.ClassReader; import org.apache.tapestry5.internal.plastic.asm.Opcodes; import org.apache.tapestry5.internal.plastic.asm.Type; import org.apache.tapestry5.internal.plastic.asm.tree.*; @@ -811,6 +808,12 @@ public class PlasticClassImpl extends Lockable implements PlasticClass, Internal return new PlasticMethodImpl(this, methodNode); } + private boolean isDefaultMethod(Method method) + { + return method.getDeclaringClass().isInterface() && + (method.getModifiers() & (Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_ABSTRACT)) == Opcodes.ACC_PUBLIC; + } + private void createNewMethodImpl(MethodDescription methodDescription, MethodNode methodNode) { newBuilder(methodDescription, methodNode).returnDefaultValue(); @@ -1222,7 +1225,7 @@ public class PlasticClassImpl extends Lockable implements PlasticClass, Internal { MethodDescription description = new MethodDescription(m); - if (!isMethodImplemented(description)) + if (!isMethodImplemented(description) && !isDefaultMethod(m)) { introducedMethods.add(introduceMethod(m)); }
