cushon / issues-import

0 stars 0 forks source link

getClass() is usually wrong for Annotations and Enums #242

Open cushon opened 10 years ago

cushon commented 10 years ago

Original issue created by lowasser@google.com on 2014-03-20 at 05:45 PM


Instances of an annotation interface generally return a random proxy class when getClass() is called on them; to get the actual annotation type you want .annotationType().

Enums with value-specific methods are a subclass of the actual enum type, and similarly, usually want getDeclaringClass().

cushon commented 10 years ago

Original comment posted by eaftan@google.com on 2014-04-07 at 10:22 PM


Louis will take a look at this.


Status: Accepted Owner: lowasser@google.com Labels: -Priority-Medium, Priority-Low