diff options
author | aclement <aclement> | 2005-07-18 08:27:44 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-07-18 08:27:44 +0000 |
commit | bba9c50768a1db72fc8606a80762333d4b12d140 (patch) | |
tree | aa0c0a10eef3dc986ff04a560cb37604177da8bb /tests/bugs150 | |
parent | 732539ab4bd740ac660983776ff5790459c58af6 (diff) | |
download | aspectj-bba9c50768a1db72fc8606a80762333d4b12d140.tar.gz aspectj-bba9c50768a1db72fc8606a80762333d4b12d140.zip |
Fix for pr103266: allow for nulls in the visitor (can happen if there are syntax errors)
Diffstat (limited to 'tests/bugs150')
-rw-r--r-- | tests/bugs150/pr103266.aj | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/bugs150/pr103266.aj b/tests/bugs150/pr103266.aj new file mode 100644 index 000000000..8b72a2799 --- /dev/null +++ b/tests/bugs150/pr103266.aj @@ -0,0 +1,51 @@ +abstract aspect WorkerExample { + + after() returning (RequestContext newContext) : call(RequestContext+.new(..)) { + System.out.println("constructing "+newContext+" at "+thisJoinPoint.toLongString()+" from "+thisEnclosingJoinPointStaticPart+":"); + } + + abstract class RequestContext { + public final Object execute() { + return doExecute(); + } + + /** template method */ + public abstract Object doExecute(); + } + + public static void main(String args[]) { + new Runnable() { + public void run() {} + }.run(); + }; +} + +aspect ConcreteAlpha extends WorkerExample { + + Object around(final Object runnable) : execution(void Runnable.run()) && this(runnable) { + System.out.println("monitoring operation: "+runnable+" at "+thisJoinPoint+", for "+thisJoinPoint.getThis()); + RequestContext requestContext = new RequestContext() { + public Object doExecute() { + return proceed(runnable); + } + + }; + return requestContext.execute(); + } + +} + +aspect ConcreteBeta extends WorkerExample { + + Object around() : call(void awqeyuwqer()) { + RequestContext requestContext = new ConnectionRequestContext() { + public Object doExecute() { + return proceed(); + } + + }; + return requestContext.execute(); + } + + +}
\ No newline at end of file |