You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/08/01 20:59:39 UTC
[jira] [Commented] (TAP5-2340) Make proxies honor Java 8 default
methods
[ https://issues.apache.org/jira/browse/TAP5-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082756#comment-14082756 ]
ASF subversion and git services commented on TAP5-2340:
-------------------------------------------------------
Commit 6a63c51669e950f40410cd44b45d0f0315c36659 in tapestry-5's branch refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=6a63c51 ]
TAP5-2340: Make proxies honor Java 8 default methods
> Make proxies honor Java 8 default methods
> -----------------------------------------
>
> Key: TAP5-2340
> URL: https://issues.apache.org/jira/browse/TAP5-2340
> Project: Tapestry 5
> Issue Type: Improvement
> Components: plastic
> Affects Versions: 5.4
> Reporter: Peter Niederwieser
> Assignee: Howard M. Lewis Ship
> Attachments: plastic_default_methods.patch
>
>
> MyInterface.java:
> {code}
> public interface MyInterface {
> default int compute() { return 42; }
> }
> {code}
> PlasticSpec.groovy:
> {code}
> class PlasticSpec extends Specification {
> def "plastic proxy for interface with default method"() {
> def manager = PlasticManager.withClassLoader(getClass().classLoader).create()
> def proxy = manager.createProxy(MyInterface, {})
> def impl = proxy.newInstance()
> expect:
> impl.compute() == 42 // fails; actual: 0
> }
> def "manual implementation of interface with default method"() {
> def impl = new MyInterface() {}
> expect:
> impl.compute() == 42 // passes
> }
> }
> {code}
> Tested with 5.4-beta-6.
--
This message was sent by Atlassian JIRA
(v6.2#6252)