Issue Details (XML | Word | Printable)

Key: SJC-220
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Chris Beams
Reporter: Chris Beams
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring JavaConfig
SJC-215

Dynamically add @Aspect annotation bytecode to CGLIB-generated @Configuration subclasses

Created: 20/Oct/08 08:14 PM   Updated: 29/Oct/08 08:43 PM   Resolved: 29/Oct/08 08:43 PM
Component/s: AOP
Affects Version/s: None
Fix Version/s: 1.0.0.M4

Time Tracking:
Not Specified


 Description  « Hide
@Aspect is not @Inherited, thus @Configuration subclasses fail conditional tests as to whether a @Configuration bean is annotated with @Aspect. This means that as SJC-191 (remove all aop functionality other than @AspectJAutoProxy) is implemented, @Aspect-annotated @Configurations (aka inline advice methods) ceases to function.

The goal of this task is to see if we can dynamically introduce the bytecode (via ASM) to the generated subclass to make the following assertion pass:

    assert cglibSubclass.isAnnotationPresent(Aspect.class);
    
The other option here would be to actually get @Aspect to be marked with @Inherited. Andy Clement is looking into this, but that may naturally take some time as it's a change to the AspectJ codebase.

Chris Beams added a comment - 29/Oct/08 08:43 PM
@Aspect is now added on-the-fly to all CGLIB-generated @Configuration subclasses. See CglibConfigurationEnhancer for details.

Note: The AspectJ team have (for now) rejected the idea of making @Aspect inherited, so this workaround approach will continue for the forseeable future.