Bug 125475 - [@AspectJ] ajc cannot compile empty @Pointcut
Summary: [@AspectJ] ajc cannot compile empty @Pointcut
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-27 09:38 EST by Matthew Webster CLA
Modified: 2006-02-10 08:41 EST (History)
0 users

See Also:


Attachments
Testcase (combined with 125480) (9.60 KB, application/octet-stream)
2006-01-27 09:53 EST, Matthew Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.