Community
Participate
Working Groups
Get incorrect error "can't find pointcut ..." when declaring pertarget pointcut using pointcut declared outside the aspect. True of HEAD right now. Not true of pointcuts declared inside the aspect or issingleton aspects. I thought this was reported and fixed, but I couldn't find the bug. Sorry if it is a duplicate. ------------------------------------------------- package bugs; public class PerTargetSubaspectError { public static void main(String[] args) { C.run(); } static class C { static void run() {} } pointcut doit() : execution(void C.run()); // no error if not pertarget static aspect CPT pertarget(pc()){ // no error if doit() defined in CPT protected pointcut pc() : doit(); // unexpected CE before() : doit() {} // no CE } }
this is a recent regression - I have a dev build from 30th November that doesnt have this problem.
right, I've found it. Not soooo much of a regression as exposing a problem we always had. Sometimes during resolution we just 'defaulted' to persingleton as the perclause and used the right one later on. To solve a problem with parameterized pertypewithin clauses I made the code return the *right* perclause in every case - so now we concretize the pc() in the pertarget clause - and we don't check the outertype for the pointcut definition. I've fixed this to check the outertype - seems to work fine. waiting on build.
fix available.