Bug 125475

Summary: [@AspectJ] ajc cannot compile empty @Pointcut
Product: [Tools] AspectJ Reporter: Matthew Webster <matthew_webster>
Component: CompilerAssignee: Andrew Clement <aclement>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: DEVELOPMENT   
Target Milestone: 1.5.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Testcase (combined with 125480) none

Description Matthew Webster CLA 2006-01-27 09:38:58 EST
I get this error:

C:\temp\ajcSandbox\ajcTest27856.tmp\TestEmptyPointcutAtAspect.java:8:0::0 Method annotated with @Pointcut() for abstract pointcut must be abstract

when compiling this aspect with ajc (it's fine with javac):

@Aspect
public class TestEmptyPointcutAtAspect {

	@Pointcut("")
	protected void scope () {}
}
Comment 1 Matthew Webster CLA 2006-01-27 09:53:06 EST
Created attachment 33703 [details]
Testcase (combined with 125480)
Comment 2 Andrew Clement CLA 2006-01-27 10:11:58 EST
I presume you are trying to define an empty (matches nothing but overridable) scope pointcut rather than an abstract scope pointcut?
Comment 3 Matthew Webster CLA 2006-01-30 04:19:03 EST
The testcase tries to implement an inherited abstract pointcut defined in a parent code-style aspect.
Comment 4 Andrew Clement CLA 2006-01-30 05:27:32 EST
Another way to express this is of course:

@Pointcut
protected void scope () {}

which doesnt work either.

I see in the patch several files duplicated in a tests/ltw directory that are also in the tests/bugs151/pr125480 directory.  I'm ignoring the ones in the tests/ltw directory - they don't seem to be referenced from the test XML.  I'm assuming they are just leftover after moving the code to the bugs folder.

The basic problem here seems to be @AJ doesnt understand empty matches nothing pointcut expressions.  I've rectified this - it isn't as clean as it could be but it works ok (the tests for 125475 and 125480 work for me).

Comment 5 Andrew Clement CLA 2006-02-10 08:41:45 EST
fix available.