test failures
Jonathan Gibbons
jonathan.gibbons at oracle.com
Mon Jan 21 08:29:18 PST 2013
On 01/18/2013 05:28 PM, Werner Dietl wrote:
> I tried integrating AnnotatedType more widely, but am running into
> problems. I think it would be best if somebody more familiar with
> XXXType and type resolution takes a closer look.
Werner,
Joel and I had a discussion on this, earlier this morning.
We believe that we can get away without using the delegation model
of AnnotatedType, and can instead use the anonymous subtype model
used by javac.code.Type.constType(). In other words, the proposal
is to put a method called annotatedType(??) on Type, where ?? stands
for the annotations to be added. This will return a new Type such that
Type.getAnnotations will return the appropriate list. The default impl
of Type.getAnnotations will return an empty list.
This approach should integrate better into the existing type system,
as no new TypeKinds are added -- we just use anonymous subtypes
of existing types to override default "return empty list" impls.
Joel has said he will try and have a patch for this by the end of today
(his time). We agreed he would be a good person to work on this
because he also understands the requirements of the javax.lang.model
API and can take that into account here.
The only (minor) complexity with this approach is that the same technique
of anonymous subtypes is also used for constant values. But, our sense
is that the complexity is manageable, and less than I initially feared,
since
most types do not support constant values anyway.
-- Jon
More information about the type-annotations-dev
mailing list