Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Getting source code positions for advice

Hi,

I doubt you are doing anything wrong.  We just never use the endline
(from BcelAdvice) for anything (as I recall) and so don't really
guarantee it is correct.  The structure model produced alongside the
compile is more likely to have correct information in it, as that is
used by AJDT.  Feel free to raise a bugzilla to sort out the
BcelAdvice end line if you like.

cheers
Andy

On 20 June 2011 11:25, Yoav A. <yoav_@xxxxxxxxxxx> wrote:
> I'm trying to extract source file information during the weaving process. I
> wrote the following code to fetch the beginning and end of an advice:
>
> public String getAdviceFormatString(BcelAdvice adv)
> {
>    ISourceLocation pos = adv.getSourceLocation(); int startLine =
> pos.getLine();
>    int endLine = pos.getEndLine(); // do the rest
> }
>
>
> I always get that startLine == endLine which correspond to the first line of
> the advice declaration. What am I doing wrong here?
>
>
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>


Back to the top