On Mon, 18 Apr 2022 20:42:48 GMT, Remi Forax <fo...@univ-mlv.fr> wrote:

> The third parameter of defineProxy() is a lambda which is called for each 
> method that can be overriden, either toString/equals/hashCode but also any 
> default methods,
if the lambda return true, the method is overriden, otherwise the default 
implementation is used.

Not quite, I mean calling default implementations in the super interface, 
consider:

interface Root { void cleanUp(); }
interface FeatureOne extends Root { default void cleanUp() { /* do something */ 
} }
interface FeatureTwo extends Root { default void cleanUp() { /* do something */ 
} }

My proxy implements both feature one and two, but in your API, there is no way 
for my `cleanUp` to call both `FeatureOne.super.cleanUp();` and 
`FeatureTwo.super.cleanUp();`. You should probably expose the lookup in your 
linker too, especially that you enabled nest access and you can just use that 
lookup to resolve, say, an implementation static method in the proxy user class.

Also the "delegate" in your API would significantly benefit from 
https://bugs.openjdk.java.net/browse/JDK-8282798 (#7744), too.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8278

Reply via email to