Bug 288577

Summary: after() returning(Object o) : set() is not working
Product: [Tools] AspectJ Reporter: Simone Gianni <simoneg>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: DEVELOPMENT   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Simone Gianni CLA 2009-09-03 17:23:16 EDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2009010218 Gentoo Firefox/3.0.5
Build Identifier: 20090619-0625

While it is quite pointless to use a returning clause on an after advice on a set() pointcut, there are situations (the simplest one is tracing) where writing a single advice for a composed pointcut is quite handy, and the fact that "after returning" is not triggered for the set() pointcut creates an annoying corner case.

Moreover, documentation states that after() returning(Object o) works on methods returning void (and in fact it does), but there is no mention that it does not work for set(), so the average user will expect it to work, setting "o" (the returned Object) to null.

after() without the returning clause works as expected, and there is no other pointcut expression to capture the return value to write a generic advice that works also on set().

Reproducible: Always

Steps to Reproduce:
To specific steps.