Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.4
-
None
-
None
Description
MyInterface.java:
public interface MyInterface { default int compute() { return 42; } }
PlasticSpec.groovy:
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 } }
Tested with 5.4-beta-6.