[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-dev] is there a algorithm to compute whether two different pointcut expressions can share a join point?
|
Hi guys, is there a algorithm to compute
whether two different pointcut expressions can share a join point ?
For example, we know these following two
pointcut expressions may share a join point.
call( Object java.util.Iterator.*(..) );
call( * java.util.Iterator.next(..) );
While these two pointcut expressions
definitely won’t share a join point
call( boolean
java.util.Iterator.hasNext(..) )
call(Object java.util.Iterator.next())
It first seems that the unification
algorithm used in prolog can resolve this problem. But the cflow operator
changes this as the cflow( call(boolean java.util.Iterator.hasNext(..)) ) and
cflow( call( boolean java.util.Iterator.hasNext(..) ) ) maybe share a join
point. If we drop the cflow operator, can the unification solve this issue?
Maybe this thing seems meaningless to
aspectj as the compiler only compiles concrete code. And it is easy to find a
shared join point in concrete code. But it maybe a good hint to notify that the
user writes a wrong pointcut as it does not select any join point no matter
what the code is. For example, the pointcut:
call( boolean
java.util.Iterator.hasNext(..) ) && call(Object
java.util.Iterator.next()).
If we cannot find an algorithm to resolve
this problem given the complexity of pointcut, is there a subset of pointcut
operators which we can handle?
--
Best regards,
Xian Zhang