Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Retaining original StackTrace

Hi,

I'm afraid we don't provide any built in support to filter these stack
traces.  XnoInline is likely to make things worse rather than better
as it promotes the use of extra (closure) classes.  Regardless of the
names seen in the stack traces the filenames and line numbers should
all be correct so that clicking on entries or navigating in some other
way should take you to the right place relevant to what gave rise to
the stack trace.

If you used annotation style advice you would be able to choose the
names of some of these extra entries as the name of the method used to
represent the advice would be used rather than a generated name that
we create for code style aspects (since advice is kind of
'anonymous').  I don't think you can change the _aroundBodyX name (it
could perhaps have a better, more intuitive, name than that)

You could filter the traces yourself by removing ajc$ prefixed
entries, but I would find that losing some of the story as the app
ran, possibly leading to confusion later as it would be non-obvious
how the code got from A to B if a key advice call had been taken out.

On further thinking I guess we could try a more active inlining
strategy in some situations (if the user requested) where the advice
call isn't inserted but instead the advice completely dumped into the
target.  This is deliberately not done right now as we like to
preserve the modularity - if my advice body changes I don't have to
recompile all the affected types right now, just the aspect.  It also
keeps code sizes down if advice is large as that chunk of code isn't
duplicated everywhere.

cheers
Andy

On 3 January 2012 18:30, rakesh sharma <rakesh_sharma66@xxxxxxxxxxx> wrote:
> Hi All,
>
> I am quite new to AspectJ and trying to us it in one of my projects. Also, I
> am sure that I am not the first one to face this problem and looking for
> some guidance to solve this problem. I am  using AspectJ 1.6.12 with LTW. My
> exception stack trace looks quite different than the stack trace without
> aspectj advice. I see two problems:
>
> 1. The advised method name is getting suffixed with _aroundBodyx (where x is
> a number).
> 2. There are some extra lines in stack trace related to pointcuts and
> advice.
>
> Both of them would create confusion when others are looking at the exception
> stack trace. I would like to see the original exception
> stack trace. What are my options here? I have already tried
> -XnoInline option that did not help.
>
> It will be very tough to use it in my project without getting this problem
> fixed. Any guidance will be highly appreciated.
>
> -RS
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top