ModuleInfo extends AnnotatedElement

joe.darcy at oracle.com joe.darcy at oracle.com
Thu Apr 22 16:50:07 PDT 2010



On 4/20/2010 10:54 PM, Mandy Chung wrote:
> Hi Joe,
>
> Thanks for the feedback.   I revise the ModuleInfo interface not to 
> extend the AnnotatedElement interface but instead just adds the 
> isAnnotationPresent and getAnnotation method:
> http://cr.openjdk.java.net/~mchung/jigsaw/annotations/api/java/lang/module/ModuleInfo.html
>
>>
>> Dealing with annotation types whose methods are declared to return 
>> Class objects is problematic in this mixed environment and should be 
>> avoided.
>
> Agree.  I follow the way that the 
> javax.lang.model.Element.getAnnotation method specifies so that an 
> exception will be will be thrown when it attempts to read a Class 
> object by invoking the relevant method on the returned annotation.  I 
> added a new exception java.lang.module.UnsupportedElementTypeException 
> for such purpose.
>

Looks fine.

-Joe



More information about the jigsaw-dev mailing list