Community
Participate
Working Groups
To test this in AJDT install the bean example, add a new interface called I and then add the following line to BoundPoint.aj: declare parents: hasmethod(* set*(..)) implements I; Now open the AspectJ Compiler preference page and select "Has Member" on the advanced tab. Click OK, rebuild and if the option was working the project would build correctly. As it stands there is an error: the type pattern hasmethod(* set*(..)) can only be used when the -XhasMember option is set
Some hints perhaps ... I would follow through another option that you know gets through, when the path is identified, do the same for hasMember. It is the kind of option that is set on the world and then accessed throughout the weaver - I think possibly notReweavable or lazyTjp might behave in a similar way, so try tracing those. You *could* create a testcase for this - it probably won't look like a normal one though because the option needs passing in the same way AJDT passes it, since if you pass it in the standard testcase way it works (see entries in ajc150.xml). As a base for the testcase you could do something like MultiProjectIncrementalTests.testPr92837() - but you'll need to puzzle through how to get the option passed. Or look at some of the subtypes of AjdeTestcase - which are also confusing ;)
A simplified testcase is the following: -------------------------------------------------------------------- public class PR102479 { public void myMethod1() { } } interface I { } aspect A { declare parents: hasmethod(* myMethod*(..)) implements I; } ----------------------------------------------------------------- The fix is to set -XhasMember in the AjBuildConfig.installGlobals(..) method in the same way that -XlazyTjp is set. Currently writing a testcase to fit in with the aspectj testsuite before attaching a patch.
Created attachment 28738 [details] patch containing fix This is a patch containing the fix and should be applied to the org.aspectj.ajdt.core project
Created attachment 28739 [details] patch containing test This is a patch containing the test and should be applied to the ajde project.
fix committed waiting on build.
fix available