Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsNewbie -- Syntax error with field get/set pointcut
https://www.eclipse.org/forums/index.php/mv/msg/188146/596854/#msg_596854
Originally posted by: kkraft.mcn-inc.com
Hi,
I'm not sure if this is the right forum, but I didn't see anything else
AspectJ-related.
I am using AspectJ in Eclipse with the AJDT plug-in.
I have a basic HelloWorld.java 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
pattern
Here are my attempts at defining the get/set pointcuts::
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.
Here is what that looks like:
before : getMessage() {
System.out.println("RUNNING ADVICE BEFORE " + thisJoinPoint);
}