Community
Participate
Working Groups
This is weird: comment out *either* marked line, and the aspect works. But the &&! pointcut seems to convince pertarget that there is no target. Not true of AspectJ 1.2.1. (I can't believe it: it took me 2 hours to isolate this *smile*) ------------------------------------------------------------- package bugs; public class Temp { public static boolean passed; public static void main(String[] args) { SampleSeries me = new SampleSeries(); me.okSeries(); me.open(); me.close(); if (!passed) { throw new Error("failed to advise..."); } } static class SampleSeries { void open() {} void close() {} void okSeries() {open(); close();} } static aspect AAAA // comment this out, and !call(...) works pertarget(tracked()) { protected final pointcut tracked() : call(void SampleSeries.*()) // comment this out, and pertarget works... && !call(void SampleSeries.*Series()) ; before() : tracked() { Temp.passed = true; } } }
This was caused by some optimisations added for @AspectJ to try and narrow down the number of places the ajc$mightHaveAspect interface is added. In this case it generates an erroneous test like: (Temp.SampleSeries && !Temp.SampleSeries) the visitor that builds the tests wasn't quite careful enough when it came to negatation. Waiting on build...
fix now available