getAnnotationsByType

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Feb 20 17:12:00 PST 2013


We cannot make the methods be default methods in the short term because 
of the JDK bootstrap requirements.

-- Jon

On 02/20/2013 04:24 PM, Joe Darcy wrote:
> Hi Jon,
>
> On 2/20/2013 2:30 PM, Jonathan Gibbons wrote:
>> Joe,
>>
>> With the proposed new javax.lang.model API for type annotationns, I 
>> get compilation errors in jaxws.
>>
>> Is this to be expected, and do we have a plan to address this?
>
> I suppose this is to be expected since we are in effect adding several 
> annotation-reading methods to the TypeMirror interface that this 
> nominal implementation in jaxws doesn't have.
>
> As a stop-gap measure to get the build going, we can make the methods 
> in AnnotatedConstruct be default methods, but once we know what API we 
> want, we should have the jax-ws team implement those methods in this 
> marker object and then revert the default methods to normal one. (As a 
> matter of policy, we cannot use default methods in javax.lang.model 
> since the API has to be runnable on Java SE 7/JDK 7. [1])
>
> As an aside, should the need arise I'll note that by using annotation 
> processors it is possible to generate a compile-time 
> JDK-version-specific source for an implementation of an interface.
>
> Cheers,
>
> -Joe
>
> [1] http://hg.openjdk.java.net/jdk8/tl/langtools/rev/09f65aad4759
>
>
>>
>> -- Jon
>>
>> /w/jjg/work/type-annos/type-annotations/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java:365: 
>> error: <anonymous com.sun.tools.internal.jxc.model.nav.ApNavigator$1> 
>> is not abstract and does not override abstract method 
>> <A>getAnnotationsByType(Class<A>) in AnnotatedConstruct
>>     private static final TypeMirror DUMMY = new TypeMirror() {
>>
>



More information about the type-annotations-dev mailing list