Summary: | !cflowbelow(within(A)) causes ExceptionInitializerError | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Adrian Powell <apowell> |
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 1.2 | ||
Target Milestone: | 1.2.1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Adrian Powell
2004-09-24 01:00:03 EDT
Strange as it may seem, this program is working as designed! Here's what's going on: * You have pointcut that matches EVERY join point that is NOT in the control flow below a join point in TraceClass. * One join point matched by this pointcut is the staticinitialization join point for SomeClass (the very first join point in the program execution). * In order to put into effect the before advice at this join point, the aspect TraceClass needs to be called. * This causes the TraceClass aspect to be loaded, giving rise to a staticinitialization join point. * The staticinitialization join point for TraceClass itself is also matched by the pointcut - so you have an aspect trying to advise its own initialization. * This is the situation that leads to the "NoAspectBoundException" (there is no instance of the aspect bound at the point at which the advice should execute). * Since the NoAspectBoundException is thrown during initialization of the SomeClass class, you get the "ExceptionInInitializer" error. The short summary is that an aspect can't advise its own static initialization. Fix released as part of AspectJ 1.2.1 |