New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-3118: MessagingGW: Don't proxy default methods #3119
Conversation
While this generally makes sense; it's a severely breaking change and, at least, it needs to be an option at the class or method level. Consider public interfact Foo {
String bar(String baz);
default String qux(String fiz) {
throw new UnsupportedOperationException();
}
} A user might reasonably expect to be able to override Furthermore, someone might already be using it that way. |
Oh! I didn't think it that way. "How an unusual behavior can be OK?!" 😄 So, Is this OK? |
Yes; that would be sufficient (and false by default is ok too). Do we really need all that |
No, because there is no The |
After more thinking I treat this issue as a |
Fixes spring-projects#3118 The `GatewayProxyFactoryBean` proxies all the methods in the provided interface, including `default` and `static`. This is not what is expected from end-users. * Proxy only `abstract` methods from the provided interface * Introduce a `DefaultMethodInvokingMethodInterceptor` to call `default` method on the interface using a `MethodHandle` approach for those methods calling
restore a previous behavior * Handle a new property from XML, annotations & DSL configurations * Ensure that the property works in various tests * Document the feature
OK. Introduced a Thanks |
* GH-3118: MessagingGW: Don't proxy default methods Fixes #3118 The `GatewayProxyFactoryBean` proxies all the methods in the provided interface, including `default` and `static`. This is not what is expected from end-users. * Proxy only `abstract` methods from the provided interface * Introduce a `DefaultMethodInvokingMethodInterceptor` to call `default` method on the interface using a `MethodHandle` approach for those methods calling * * Introduce a `proxyDefaultMethods` option to let to restore a previous behavior * Handle a new property from XML, annotations & DSL configurations * Ensure that the property works in various tests * Document the feature * * Fix typo in the `build.gradle`
Fixes #3118
The
GatewayProxyFactoryBean
proxies all the methods in the provided interface,including
default
andstatic
.This is not what is expected from end-users.
abstract
methods from the provided interfaceDefaultMethodInvokingMethodInterceptor
to calldefault
method on the interface using a
MethodHandle
approach for those methodscalling