Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] after advice and try catch statement

If you use the 'after returning' advice (instead of the plain 'after'), you should be able to avoid the try/catch block.

-Ramnivas

2009/7/1 Holger Hoffstätte <holger.hoffstaette@xxxxxxxxxxxxxx>
antofmr wrote:
> I am using the after advice to insert some code into the end of a method.
> When I de-compile the method I see that the aspectj compiler has inserted a
> try catch statement into the method. The try is the very first line and the
> catch is at the end of the method. Is there anyway of inserting the code
> without this try catch clause been added or is this the only way that the
> after advice works.

This is just how "after" must work by necessity, otherwise you would end
up having to specify a potentially limitless number of additional conditions.
If you want to control the execution of your advice at the end of the
method, use around/proceed and then decide what to do.

-h
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev


Back to the top