[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] if (false) pointcut and the empty set

AspectJ has a mechanism for specifying that a pointcut matches nothing. You specify no body at all, i.e.
pointcut pc();

There have been complaints that this is confusing to people because it looks too much like an abstract pointcut declaration. For 1.2, we will consider providing a guarantee that if(false) will always be optimized away as matching nothing; however, I'm always concerned about having two roughly equivalent ways of saying the same thing in a programming language.


Dean Wampler wrote:
I don't understand the internals of ajc, but the error messages also indicate to me that "if (false)" still results in some sort of evaluation at all join points and hence it still imposes a lot of overhead during the build. True? If so, a way to really turn it off "completely" would be nice (or some sort of alternative mechanism ....)


Macneil Shonle wrote:

Hi all,

This is a minor feature request, but something I'd like to see. Sometimes
I want to disable a pointcut in my development (essentially commenting it
out). I used to do this by making the pointcut be "if (false)" but this
creates errors for after advice when expection handlers are present: