Bug 83423 - Can't refer to an binary annotation from a source file
Summary: Can't refer to an binary annotation from a source file
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-21 12:18 EST by Andrew Clement CLA
Modified: 2005-01-25 15:22 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 Andrew Clement CLA 2005-01-21 12:18:44 EST
The compiler currently can't cope with annotation types originating in class
files.  So you can't define an annotation and refer to
@Inherited/@Retention/etc.  You also can't build your own annotation with javac
and then refer to it in source you pass to ajc as that is the same issue - the
annotation you are referring to will originate from a class file.  

The problem is the compiler attempting resolution when a scope is null.  It
appears to be related to our modifying of BinaryTypeBinding to subclass
SourceTypeBinding - this causes the compiler (in various places) to call
getAnnotationBits() (which does the resolution) on BinaryTypeBindings because
they extend SourceTypeBinding.  I *think* in the case of a binary type binding
they are always already resolved - and so the solution is one line in
BinaryTypeBinding ctor to ensure the tagbits is marked appropriately as
annotation resolved - so we don't attempt it later.

This stab at a fix passes the tests and passes my tiny testcase for the problem
- it needs a ton more testing - but I will check it in so people on the lists
can try it.  First go at this fix will be a direct hack on jdtcore rather than a
change in shadows and a rebuild of jdtcore as I don't have the bandwidth from
where I am to do all that - I will do things properly on Monday depending on
peoples findings with this small hack...
Comment 1 Andrew Clement CLA 2005-01-24 06:22:03 EST
Fix checked in - initial hack tested by Pepe from the lasts as working ok.
Waiting for build before closing.
Comment 2 Andrew Clement CLA 2005-01-25 15:21:53 EST
confirmed fixed in AspectJ and new AJDT builds.
Comment 3 Andrew Clement CLA 2005-01-25 15:22:31 EST
oops, forgot to also change its state to fixed when added last comment !