Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Using args(...) in a Pointcut
Using args(...) in a Pointcut [message #16871] Wed, 26 February 2003 19:40
George C. Hetrick is currently offline George C. HetrickFriend
Messages: 22
Registered: July 2009
Junior Member
The on-line AspectJ Programming Guide includes the following example on
page 11

aspect PointBoundsChecking {
...
pointcut setY(int y):
(call(void FigureElement.setXY(int, int)) && args(*, y))
|| (call(void Point.setY(int)) && args(y));
...
before(int y): setY(y) {
if ( y < MIN_Y || y > MAX_Y )
throw new IllegalArgumentException("y is out of bounds.");
}
}

The PDF manual has (note how args is done)

aspect PointBoundsChecking {
...
pointcut setY(int y):
(call(void FigureElement.setXY(int, int)) ||
call(void Point.setY(int)))
&& args(y, ..));

...
before(int y): setY(y) {
if ( y < MIN_Y || y > MAX_Y )
throw new IllegalArgumentException("y is out of bounds.");
}
}

I can't see how the Aspect compiler could possibly know which argument to
setXY() was 'y'. Is the PDF manual simply wrong, and should I do things as
in the on-line manual?
Previous Topic:AspectJ-->Ant-->Eclipse
Next Topic:Using args(...) in a Pointcut
Goto Forum:
  


Current Time: Mon Dec 22 15:08:25 GMT 2014

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

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