Proxying default methods does not work with 5.5.0-beta-2

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Proxying default methods does not work with 5.5.0-beta-2

Oliver Kaiser
Hi everyone,

given something like this:

public interface Blub {
   public default String foo() {
     return "Default";
   }
}
public class BlubImpl implements Blub {
   @Override
   public String foo() {
     return "Impl";
   }
}

when calling "registry.getService(Blub.class).foo()" using beta-1 this
works as expected (BlubImpl is called); when using beta-2 only the
default method is called.

the log output of PlasticProxyFactory shows that the method is skipped
in the generated class

seems to be related to this commit
https://github.com/apache/tapestry-5/commit/709d282bfc626ce55cde07cbf909c0b86c2b4bcb#diff-89a017b694cffee07e15608bc316d0d7

now "proxyInterface(Class, PlasticMethod)" only
calls "introduceInterface(Class, PasticMethod)" (which skips the method
as "isDefaultMethod(m)" returns true); earlier versions had an
additional for-loop which handled this case (at least from stepping
though in a debugger it looks that way)


that's a regression, right?


btw: thanks to everyone who worked on the 5.4->5.5 transition; updating
was very smooth!


Regards,
Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Proxying default methods does not work with 5.5.0-beta-2

Thiago H de Paula Figueiredo
On Mon, May 6, 2019 at 2:35 PM Oliver Kaiser <[hidden email]>
wrote:

> Hi everyone,
>

Hello!


> the log output of PlasticProxyFactory shows that the method is skipped
> in the generated class
>
> seems to be related to this commit
>
> https://github.com/apache/tapestry-5/commit/709d282bfc626ce55cde07cbf909c0b86c2b4bcb#diff-89a017b694cffee07e15608bc316d0d7
>
> now "proxyInterface(Class, PlasticMethod)" only
> calls "introduceInterface(Class, PasticMethod)" (which skips the method
> as "isDefaultMethod(m)" returns true); earlier versions had an
> additional for-loop which handled this case (at least from stepping
> though in a debugger it looks that way)
>
> that's a regression, right?
>

Yes, it is. Thanks for spotting it!

--
Thiago
Reply | Threaded
Open this post in threaded view
|

Re: Proxying default methods does not work with 5.5.0-beta-2

Thiago H de Paula Figueiredo
In reply to this post by Oliver Kaiser
I've just committed a fix for this issue.

On Mon, May 6, 2019 at 2:35 PM Oliver Kaiser <[hidden email]>
wrote:

> Hi everyone,
>
> given something like this:
>
> public interface Blub {
>    public default String foo() {
>      return "Default";
>    }
> }
> public class BlubImpl implements Blub {
>    @Override
>    public String foo() {
>      return "Impl";
>    }
> }
>
> when calling "registry.getService(Blub.class).foo()" using beta-1 this
> works as expected (BlubImpl is called); when using beta-2 only the
> default method is called.
>
> the log output of PlasticProxyFactory shows that the method is skipped
> in the generated class
>
> seems to be related to this commit
>
> https://github.com/apache/tapestry-5/commit/709d282bfc626ce55cde07cbf909c0b86c2b4bcb#diff-89a017b694cffee07e15608bc316d0d7
>
> now "proxyInterface(Class, PlasticMethod)" only
> calls "introduceInterface(Class, PasticMethod)" (which skips the method
> as "isDefaultMethod(m)" returns true); earlier versions had an
> additional for-loop which handled this case (at least from stepping
> though in a debugger it looks that way)
>
>
> that's a regression, right?
>
>
> btw: thanks to everyone who worked on the 5.4->5.5 transition; updating
> was very smooth!
>
>
> Regards,
> Oliver
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Thiago
Reply | Threaded
Open this post in threaded view
|

Re: Proxying default methods does not work with 5.5.0-beta-2

Chris Poulsen
Hi

I've just gotten around to test our products against Tapestry 5.5
(master/HEAD) - Everything seems to work fine with the latest code, good
work!

Would it be possible to get a tagged beta (or rc) version published to some
repository that we can rely on for stable builds?

I can see several 5.4 beta/rc versions in central (
https://mvnrepository.com/artifact/org.apache.tapestry/tapestry-core ),
that would work well for us. I can see a single 5.4-beta on apache staging,
but it seems unclear how long we can expect things to be present in
"staging".

--
Chris

On Sat, Jun 22, 2019 at 3:43 AM Thiago H. de Paula Figueiredo <
[hidden email]> wrote:

> I've just committed a fix for this issue.
>
> On Mon, May 6, 2019 at 2:35 PM Oliver Kaiser <[hidden email]>
> wrote:
>
> > Hi everyone,
> >
> > given something like this:
> >
> > public interface Blub {
> >    public default String foo() {
> >      return "Default";
> >    }
> > }
> > public class BlubImpl implements Blub {
> >    @Override
> >    public String foo() {
> >      return "Impl";
> >    }
> > }
> >
> > when calling "registry.getService(Blub.class).foo()" using beta-1 this
> > works as expected (BlubImpl is called); when using beta-2 only the
> > default method is called.
> >
> > the log output of PlasticProxyFactory shows that the method is skipped
> > in the generated class
> >
> > seems to be related to this commit
> >
> >
> https://github.com/apache/tapestry-5/commit/709d282bfc626ce55cde07cbf909c0b86c2b4bcb#diff-89a017b694cffee07e15608bc316d0d7
> >
> > now "proxyInterface(Class, PlasticMethod)" only
> > calls "introduceInterface(Class, PasticMethod)" (which skips the method
> > as "isDefaultMethod(m)" returns true); earlier versions had an
> > additional for-loop which handled this case (at least from stepping
> > though in a debugger it looks that way)
> >
> >
> > that's a regression, right?
> >
> >
> > btw: thanks to everyone who worked on the 5.4->5.5 transition; updating
> > was very smooth!
> >
> >
> > Regards,
> > Oliver
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
> --
> Thiago
>