Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] is there a algorithm to compute whether two different pointcut expressions can share a join point?

On 4 July 2010 04:45, Sandy Zhang <nudt.zhangxian@xxxxxxxxx> wrote:
> Actually, this problem is different from the issue the pointcut doc try to
> resolve. We want to know whether two pointcut select one common join point
> independent of the application (of course, we should know the necessary
> information referred in pointcut, but we don’t need the shadow information).
> That is to say, we care about the shared join point’s existence, instead of
> judging whether a concrete shadow belongs to both pointcuts.

But isn't that impossible? Pointcut matching requires knowledge of the
program's type hierarchy, for example. For instance take this:

call(* ArrayList.clear()) && !call(* Collection.clear())

If you know that ArrayList is a subtype of Collection then you know
that this pointcut can never match. But if you don't know this, then
you cannot decide whether the pointcut can match.

> call( boolean java.util.Iterator.hasNext(..) )
>
> call(Object java.util.Iterator.next()).

Ok I can see now that there are some trivial cases where can tell that
an intersection must be empty.

> The abc project (eric is familiar) actually implements a unify method for
> PointCut class. It implements the function I want, but it does not seem
> finish the whole work .

You are welcome to conribute improvements to this function. Abc should
be easy to extend :-)

Best wishes,
Eric


Back to the top