Details
Description
Sample code to reproduce:
public interface SampleService { static String sampleStaticMethod() { return "whatever"; } String sampleMethod(); }
public class SampleServiceImpl implements SampleService { @Override public String sampleMethod() { return "whatever"; } }
public class AppModule { public static void bind(ServiceBinder binder) { binder.bind(SampleService.class, SampleServiceImpl.class); } @Match("*SampleService") public static void adviseSampleService(MethodAdviceReceiver receiver) { receiver.adviseAllMethods(MethodInvocation::proceed); } ... }
The code will fail with the following exception:
... Caused by: java.lang.RuntimeException: Exception constructing service 'SampleService': Unable to ... at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:76) ~[tapestry-ioc-5.5.0.jar:?] at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:55) ~[tapestry-ioc-5.5.0.jar:?] ... Caused by: java.lang.IllegalArgumentException: Unable to introduce method 'public static java.lang.String sampleStaticMethod()' into class $SampleService_24850593ea4b7: introduced methods may not be static. at org.apache.tapestry5.internal.plastic.PlasticClassImpl.createNewMethod(PlasticClassImpl.java:984) ~[plastic-5.5.0.jar:?] at org.apache.tapestry5.internal.plastic.PlasticClassImpl.introduceMethod(PlasticClassImpl.java:938) ~[plastic-5.5.0.jar:?] at org.apache.tapestry5.internal.plastic.PlasticClassImpl.introduceMethod(PlasticClassImpl.java:966) ~[plastic-5.5.0.jar:?] at org.apache.tapestry5.ioc.internal.services.PlasticProxyFactoryImpl$1.transform(PlasticProxyFactoryImpl.java:138) ~[beanmodel-5.5.0.jar:?] at org.apache.tapestry5.plastic.PlasticManager.createProxy(PlasticManager.java:287) ~[plastic-5.5.0.jar:?] ...
I guess PlasticProxyFactoryImpl#createProxy (around lines 136-138 for 5.5.0 and 5.6.2, 138-141 for 5.7.0) should exclude the static interface methods.