Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Newbie -- Syntax error with field get/set pointcut
Newbie -- Syntax error with field get/set pointcut [message #596854] Thu, 24 April 2008 23:08
Eclipse UserFriend
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::

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.
Here is what that looks like:

before : getMessage() {
System.out.println("RUNNING ADVICE BEFORE " + thisJoinPoint);
}

Can anybody tell me what's going on here?

Many thanks.
Previous Topic:Latest 3.4 I-build breaks AJDT
Next Topic:Newbie -- Syntax error with field get/set pointcut
Goto Forum:
  


Current Time: Sat Apr 20 15:37:34 GMT 2024

Powered by FUDForum. Page generated in 0.02799 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top