Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] PointcutDesignator AST Support

> I need to compare two pointcuts or two advices. I'm using the AST for
> this, so it boils down to comparing two PointcutDesignators. I just
> had a look at the way the matching is done and came to the result that
> the recursive matching ends at DefaultTypePattern, or
> SignaturePattern, or DefaultPointcut. At that point, the
> AjASTMatcher.match(...) simply checks whether the two objects are of
> the same type. That doesn't really check, wether the two pointcuts
> are actually the same, right? Please tell me if I missed something.

The AST is incomplete for AspectJ elements - this comes up on the list
every now and again.  My answer is always that the intention is that
it is extended by those that want to use it and we are more than keen
to get contributions to flesh it out.  Several users have contributed
extensions and those have been shipped in base AspectJ
in the past.  Just raise an enhancement request with your changes in
and I will look to commit it.

> Is there an open bug for this? At least I didn't find one so I guess
> I'll open one.

I don't know of an open one, please open an enhancement yourself.

cheers,
Andy.

On 22/04/2008, Martin Görg <nimoth@xxxxxxxxxxxxxxx> wrote:
> Hi there,
>
>  I need to compare two pointcuts or two advices. I'm using the AST for
>  this, so it boils down to comparing two PointcutDesignators. I just
>  had a look at the way the matching is done and came to the result that
>  the recursive matching ends at DefaultTypePattern, or
>  SignaturePattern, or DefaultPointcut. At that point, the
>  AjASTMatcher.match(...) simply checks whether the two objects are of
>  the same type. That doesn't really check, wether the two pointcuts
>  are actually the same, right? Please tell me if I missed something.
>
>  I figure, I could do the matching using something like the String
>  representation built by the AjNaiveASTFlattener. Not too
>  sophisticated, though. The problem is that I'm a bit short on time.
>  Does anyone have a good idea on how to compare two
>  PointcutDesignators? What do DefaultTypePattern, DefaultPointcut, and
>  SignaturePattern consist of which could be compared? If not too
>  complex, I can provide an implementation for the matching. Is there an
>  open bug for this? At least I didn't find one so I guess I'll open
>  one.
>
>  Thanks for any helpful thoughts.
>
>  Cheers
>  Martin
>
>  Just out of curiosity: How would you call that design pattern the
>  matcher uses? Looks like one twisted sort of a recursive visitor.
>
>  _______________________________________________
>  aspectj-dev mailing list
>  aspectj-dev@xxxxxxxxxxx
>  https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>


Back to the top