Community
Participate
Working Groups
This error occurs in both 1.1.0 and in the head of CVS as of 9/8/03. The compiler crash output from the CVS head version is at the end. It may be related to 42739, but they may be distinct problems. Sample source: /* * Created on Sep 8, 2003 * * Copyright (c) 2003 New Aspects of Security. All Rights Reserved. */ aspect Library { public pointcut executionsThrowingChecked() : execution(* *(..) throws (Exception+ && !RuntimeException)); } public aspect SampleExceptionHandling { public pointcut scope() : within(org.atrack.model..*); public pointcut executionsThrowingChecked() : Library.executionsThrowingChecked() && scope(); declare error : executionsThrowingChecked(): "no checked exceptions"; } sample compile: C:\eclipse\workspace\atrack>ajc src\SampleExceptionHandling.java java.lang.Exception: Stack trace at java.lang.Thread.dumpStack(Thread.java:1071) at org.aspectj.weaver.patterns.ReferencePointcut.concretize1 (ReferencePo intcut.java:215) at org.aspectj.weaver.patterns.AndPointcut.concretize1 (AndPointcut.java: 88) at org.aspectj.weaver.patterns.ReferencePointcut.concretize1 (ReferencePo intcut.java:272) at org.aspectj.weaver.patterns.AndPointcut.concretize1 (AndPointcut.java: 88) at org.aspectj.weaver.patterns.ReferencePointcut.concretize1 (ReferencePo intcut.java:272) at org.aspectj.weaver.patterns.Pointcut.concretize(Pointcut.java:127) at org.aspectj.weaver.patterns.Pointcut.concretize(Pointcut.java:120) at org.aspectj.weaver.Checker.concretize(Checker.java:37) at org.aspectj.weaver.CrosscuttingMembers.addShadowMunger (CrosscuttingMe mbers.java:78) at org.aspectj.weaver.CrosscuttingMembers.addDeclare (CrosscuttingMembers .java:102) at org.aspectj.weaver.CrosscuttingMembers.addDeclares (CrosscuttingMember s.java:92) at org.aspectj.weaver.ResolvedTypeX.collectCrosscuttingMembers (ResolvedT ypeX.java:332) at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect (Crosscut tingMembersSet.java:50) at org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration.buildInterTy peAndPerClause(AspectDeclaration.java:754) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.buildIn terTypeAndPerClause(AjLookupEnvironment.java:124) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.complet eTypeBindings(AjLookupEnvironment.java:91) at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile (Compiler.ja va:310) at org.eclipse.jdt.internal.compiler.Compiler.compile (Compiler.java:324) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilat ion(AjBuildManager.java:373) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild (AjBuild Manager.java:125) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild (AjBu ildManager.java:70) at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:99) at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:53) at org.aspectj.tools.ajc.Main.run(Main.java:217) at org.aspectj.tools.ajc.Main.runMain(Main.java:155) at org.aspectj.tools.ajc.Main.main(Main.java:72) C:\eclipse\workspace\atrack\src\SampleExceptionHandling.java:15 circular pointcu t declaration involving: executionsThrowingChecked() 1 error
If you change the pointcut in the library aspect to have a different name, then the compiler fails to see that pointcut at all: C:\eclipse\workspace\atrack>ajc src\SampleExceptionHandling.java C:\eclipse\workspace\atrack\src\SampleExceptionHandling.java:15 can't find point cut 'execs' on SampleExceptionHandling 1 error /* * Created on Sep 8, 2003 * * Copyright (c) 2003 New Aspects of Security. All Rights Reserved. */ aspect Library { public pointcut execs() : execution(* *(..) throws (Exception+ && !RuntimeException)); } public aspect SampleExceptionHandling { public pointcut scope() : within(org.atrack.model..*); public pointcut executionsThrowingChecked() : Library.execs() && scope(); declare error : executionsThrowingChecked(): "no checked exceptions"; }
An even more minimal test case: /* * Created on Sep 8, 2003 * * Copyright (c) 2003 New Aspects of Security. All Rights Reserved. */ aspect Library { public pointcut execs(): within(*); } public aspect SampleExceptionHandling { public pointcut executionsThrowingChecked() : Library.execs(); declare error : executionsThrowingChecked(): "no checked exceptions"; } output: C:\eclipse\workspace\atrack>ajc src\SampleExceptionHandling.java C:\eclipse\workspace\atrack\src\SampleExceptionHandling.java:11 can't find point cut 'execs' on SampleExceptionHandling 1 error
Hi Ron. I'd like to include the test cases you've submitted here and for other bug reports in the AspectJ test suite; however, I'm uncomfortable doing that with the copyright all rights reserved notice that you've put on them. Can you please resubmit your test cases either with no copyright or with the full eclipse CPL header? Thanks.
Contributing the sources per the CPL: /** @author Ron Bodkin */ aspect Library { public pointcut executionsThrowingChecked() : execution(* *(..) throws (Exception+ && !RuntimeException)); } /** @author Ron Bodkin */ public aspect SampleExceptionHandling { public pointcut scope() : within(org.atrack.model..*); public pointcut executionsThrowingChecked() : Library.executionsThrowingChecked() && scope(); declare error : executionsThrowingChecked(): "no checked exceptions"; } --- /** @author Ron Bodkin */ aspect Library { public pointcut execs(): within(*); } /** @author Ron Bodkin */ public aspect SampleExceptionHandling { public pointcut executionsThrowingChecked() : Library.execs(); declare error : executionsThrowingChecked(): "no checked exceptions"; }
the test provided below is now in the tree under bugs/declareBinding this bug is also fixed in cvs head
fixing target milestone