interceptors (but, of course, injection is ... troublesome in this
On 26 Nov, 12:04, Alen Vrečko <
alen_vre...@yahoo.com> wrote:
> Maybe you have already solved this. If not...This is what happens:
>
> After the return null happens the invocation chain goes one step back
> since there is no proceed call. The index-- happens[1]. Then the
> thread invokes proceed but the index is at -1. It just calls invoke on
> method interceptor again. This repeats and repeats...
>
> The most simple solution is to manually increment the chain position
> to compensate for the return null. In the thread do
>
> Field field = methodInvocation.getClass().getDeclaredField("index");
> field.setAccessible(true);
> field.setInt(methodInvocation,field.getInt(methodInvocation)+1);
>
> before calling proceed
>
> I can think of one more solution with invokespecial but that is
> another story.
>
> Cheers
> Alen
>