Community
Participate
Working Groups
fyi, unisolated but repeating bug... Using AJDT 1.2.0 M3 with AspectJ 1.5.0M2 and the following code, when I rename the aspect to "Logging", I get the BCException below. Not true of simpler scenarios, and the entire code is a bit much for now. Appeared to result from reference to renamed type in "within(..)". Sorry for no test case. ---------------------------- static aspect Logging { pointcut logAdvice() : Pointcuts.logging() && adviceexecution() && within(!Logging) && cflow(execution(void WrapMain.runMain(String[]))) && !cflow(adviceexecution() && within(Logging)) ; pointcut logTests() : Pointcuts.logging() && (execution(void WrapMain.runMain(String[])) || execution(static void main(String[])) || execution(void AComposite.recurse(..)) ); // todo @SuppressAjWarnings; before() : logAdvice() { log(""+thisJoinPoint); } // todo @SuppressAjWarnings; before() : logTests() { log(thisJoinPoint + " this: " + thisJoinPoint.getThis() + " targ: " + thisJoinPoint.getTarget() + " args: " + LangUtil.flatten(thisJoinPoint.getArgs()) ); } after(WrapMain me) returning (List<Object> list) : Pointcuts.logging() && args(me) && execution(static * MainAssembler.PackageDir.packageChildren(WrapMain)) { log(me + " kids " + list); } } --------------------------- java.lang.ClassCastException: org.aspectj.weaver.ResolvedMember at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:933) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(AjCompilerAdapter.java:244) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCompiling(AjCompilerAdapter.java:119) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:385) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:683) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:168) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:102) at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:122) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:165)
Problem actually occurs because some advice is not matching - this is probably because of the rename. Here is a standalone program that blows up in the same way: aspect Logging { before(): call(* *(..)) && cflow(execution(* *(..)) {} } The problem is a line of code assuming shadow mungers are of a certain class, this is the code that puts out the 'advice did not match warning' (this message is only put out if -1.5 option is specified for compilation). Some features of the AJ language are implemented by creating other classes of shadow munger - for example, the cflow() above. In these cases the code attempts to cast a munger to an invalid type and BANG. This is fixed in the latest dev build.
Should mention the other bug, bug 93345 fixed this. Will close in a few days if no update...
Fixed, grab the latest dev build.