Community
Participate
Working Groups
This is a regression from 1.0. Used to work fine in 1.0. public class Test { int foo() { return 0; } } abstract aspect FaultToreranceAspect { abstract pointcut retryOperations(); Object around() : retryOperations() { // retry... etc... return proceed(); } } aspect MySystemFaultToreranceAspect extends FaultToreranceAspect { // let's temporarily disable fault tolerance behavior pointcut retryOperations() : if(false); } F:\aspectj\bugs\1.1\rc1\if-false>ajc Test.java F:\aspectj\bugs\1.1\rc1\if-false\Test.java:10 around on initialization not supported (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:16 around on initialization not supported (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:10 around on pre-initialization not suppo rted (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:16 around on pre-initialization not suppo rted (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:10 around on initialization not supported (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:7 around on initialization not supported (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:10 around on pre-initialization not suppo rted (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:7 around on pre-initialization not suppor ted (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:10 around on initialization not supported (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:1 around on initialization not supported (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:10 around on pre-initialization not suppo rted (compiler limitation) F:\aspectj\bugs\1.1\rc1\if-false\Test.java:1 around on pre-initialization not suppor ted (compiler limitation) 12 errors If I change the pointcut definition as follows, the compilation error goes away: pointcut retryOperations() : if(false) && call(Object fake()); This is a kludgy workaround.
This is not a bug. if(false) is not as well optimized in the 1.1 compiler as it was in the 1.0 one (in return for better separate compilation properties). If you want to state that a pointcut matches nothing, you should use: pointcut retryOperations(); This syntax was provided explictly to enable this case of overriding an abstract pointcut to indicate that no join points should be matched.