|
I had a closer look at your test case and the problem here are the synthetic methods created by AspectJ. ClassMate ignores any synthetic methods during type resolution, so after invoking ResolvedTypeWithMembers#getMemberMethods() the array of methods may actually not contain the methods we expect in case they are marked as synthetic.
Ideally we'd implement the override check so it also works for synthetic methods. But given that ClassMate ignores those, I don't see a feasible way of doing this. But maybe we can avoid the situation of dealing with synthetic methods in overrides() altogether. During meta-data retrieval we ignore synthetic methods ourselves already, so I think the only situation where the issue can show up is when overrides() is called by ValidationExtension#replaceWithOverriddenOrInterfaceMethod().
I think we can exclude synthetic methods there as well as e.g. in case of bridge methods we'll process the actual method anyways. I tus don't believe there is a case where we'd need to replace synthetic methods with their overridden counterpart in ValidationExtension#determineConstrainedMethod(). Any thoughts, Hardy Ferentschik?
|