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

classic Classic list List threaded Threaded
2 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