Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Using args(...) in a Pointcut
Using args(...) in a Pointcut [message #564376] Wed, 26 February 2003 19:40
George C. Hetrick is currently offline George C. HetrickFriend
Messages: 24
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:Using args(...) in a Pointcut
Next Topic:4 senior developer positions at UK Java tools company
Goto Forum:
  


Current Time: Thu Sep 26 03:53:50 GMT 2024

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

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

Back to the top