-
Bug
-
Resolution: Done
-
Major
-
3.0.4.Final
-
None
If a decorator overrides, among others, a method from the decorated interface which has no override in the actual bean class, a call to that method gets decorated.
However, if you create an abstract decorator which only overrides (decorates) a method from the interface with a default implementation and no override in the actual bean class, the calls to that method do not get decorated.
Expected behaviour would be that calls to decorated methods always get decorated, whether or not they have a default implementation and how many methods actually get overridden in the decorator.
See the attached test case, which is a modification of the already existing DecoratedInteraceWithDefaultMethodTest.
Note:
It looks like the decorator does not get picked up if it does not decorate any business method which has an impl in the actual bean class. If it does override such a method, the calls to the default method do get intercepted. It does not matter whether the actual bean class overrides the method with a default impl or not, as long as the decorator overrides at least one method which has an impl in the bean class it works as intended.
I'm unsure if it makes a difference to have an impl in an abstract superclass of the concrete bean class.