----- Original Message ----- > From: "liach" <d...@openjdk.java.net> > To: "core-libs-dev" <core-libs-...@openjdk.java.net>, "security-dev" > <security-dev@openjdk.java.net> > Sent: Tuesday, April 19, 2022 3:31:24 AM > Subject: Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes
> 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. yes, you are right, i should send the Lookup too. > > Also the "delegate" in your API would significantly benefit from > https://bugs.openjdk.java.net/browse/JDK-8282798 (#7744), too. I don't think i need the carrier API, the idea is to have only one field in the proxy, this field can be a value type (exactly a primitive class) in the future, so being expanded into multiple fields by the VM at runtime. > > ------------- > > PR: https://git.openjdk.java.net/jdk/pull/8278