roterdam / crystalsaf

Automatically exported from code.google.com/p/crystalsaf
0 stars 0 forks source link

AnnotationDatabase.getAnnosForType() returns the same annotations for every local class #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you have a program with multiple local classes, like the one attached, 
calling AnnotationDatabase.getAnnosForType() will return the same 
annotation information for every local class.

The reason is the AnnotationDatabase uses ITypeBinding.getQualifiedName() 
as the key for types. However, getQualifiedName() returns the empty string 
for all anonymous and local classes. This is also a problem for annotated 
fields and methods of these classes, since the resolveVariableBinding 
method of AnnotationDatabase uses the getQualifiedName() method on the 
declaring type.

I will probably switch the key to, ITypeBinding.getKey().

Original issue reported on code.google.com by nels.bec...@gmail.com on 16 Sep 2008 at 8:24

GoogleCodeExporter commented 9 years ago
Fixed in revision 86.

Original comment by nels.bec...@gmail.com on 16 Sep 2008 at 10:25