Bug 30676 - Extended Aspect does not result in advice, introduction, or error declarations
Summary: Extended Aspect does not result in advice, introduction, or error declarations
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-30 17:36 EST by Eric Simmerman CLA
Modified: 2003-03-11 14:46 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Simmerman CLA 2003-01-30 17:36:39 EST
I defined an abstract aspect (SingletonAspect) that introduced methods and
members on a marker interface (SingletonPattern). SingletonAspect also gave
after advice to the staticinitializer on SingletonPattern and declared several
errors pertaining to the use of SingletonPattern. Then I extended the abstract
SingleAspect with an empty class (SingletonAspectImpl). Things worked as expected.
Next, I jar'ed my compiled classes
(SingletonPattern.class,SingletonAspect.class, and a helper class generated by
ajc) and included the jar in the compile time class path of a new source tree
where I again extended SingletonAspect with an empty class
(SingletonAspectImpl). This time, everything compiles, but nothing works as
expected. No methods or members are introduced, the error declarations are not
enforced, and the advice is not present. In short, the abstract aspect's SOURCE
must be present in the sourcetree for the aspect to function properly. This
defeats Aspect extension outside of the present sourcetree.
Comment 1 Wes Isberg CLA 2003-02-07 02:52:36 EST
It should work if you put the aspect library jar on the aspectpath.
(The compiler does not weave aspects from the classpath.)
If it does work, feel free to close this bug.
Comment 2 Eric Simmerman CLA 2003-02-07 11:02:52 EST
I know the compiler was never intended to weave Aspects that reside in the
classpath, it only weaves Aspects with source in the compile path (source tree).
However, it is strange to me that the compiler will not weave the inherited
portions of a super aspect when the super aspect's source is not in the compile
path. In otherwords, I have to have the source of the super aspect as well as
the source of the child aspect in the compile path in order to see expected
inheritance results. I feel this severly restricts Aspect inheritance, as I have
to have the source of any Aspects I want to extend in my source tree at compile
time. If this is known and accepted I will invalidate this bug. 
Comment 3 Jim Hugunin CLA 2003-02-11 16:41:42 EST
To confirm, this is definitely a bug.  A major goal of 1.1 is to allow you to 
provide compiled abstract aspects on the classpath that can be concretized for 
your specific system.  You should also be able to provide concrete aspects 
completely in binary form (using aspectpath).  This is a hard bug to fix, but 
it will be addressed for the next release.
Comment 4 Jim Hugunin CLA 2003-03-10 20:55:47 EST
This bug is mostly fixed and will be resolved in the upcoming release.  
However, it would still be helpful if you could submit a small self-contained 
test case of the problem as you see it.  This will help to verify the solution 
on an independent test case.
Comment 5 Jim Hugunin CLA 2003-03-11 14:46:58 EST
fixed in current tree, tests in BinaryFormsTestCase unit test