Summary: | declare error fails on pointcuts composed from multiple classes | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Ron Bodkin <rbodkin+LISTS> |
Component: | Compiler | Assignee: | Jim Hugunin <jim-aj> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P1 | ||
Version: | 1.1.0 | ||
Target Milestone: | 1.1.1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Ron Bodkin
2003-09-08 22:47:35 EDT
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 |