Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Newbie -- Syntax error with field get/set pointcut

Change your set pointcut to:

pointcut setMessage(String m) : set(String HelloWorld.message) && args(m);


On Fri, Apr 25, 2008 at 1:56 PM, kkraft <kkraft@xxxxxxxxxxx> wrote:


I am using AspectJ in Eclipse with the AJDT plug-in.

I have a basic class with a String attribute called
"message". I was able to define a working execution pointcut on
getMessage(), but when I attempt to define a get or set pointcut on the
message field Eclipse reports a syntax error:

   Syntax error on token ";", invalid allowable token in pointcut or type

Here are my attempts at defining the get/set pointcuts::

   pointcut getMessage() : get(String HelloWorld.message);
   pointcut setMessage(String m) : set(String HelloWorld.message);

I have tried all kinds of signatures inside the get/set calls, e.g. "String
message", "* message", "String *", but I always get the syntax error. One
other odd note it that the syntax error always appears at the end of the
last pointcut (e.g. "setMessage()", in the above case). Also, the error only
appears when I try to reference the pointcut in advice.

Can anybody tell me what's going on here?

Many thanks,

View this message in context:
Sent from the AspectJ - users mailing list archive at

aspectj-users mailing list

Back to the top