[JSR308] An implementation of Subtyping for Annotations

Michael Ernst mernst at cs.washington.edu
Tue Sep 1 13:28:26 EDT 2009


Christian-

> This is just to inform the list that we have updated our patch to the 
> release of the JSR 308 compiler from 21/8. So the patch is now 
> compatible with the JSR 308 compiler. The updated patch is still 
> available from here:
> 
> Server:   http://www.aicas.de/customers/JCP_JSR308
> Name:     JCP_JSR308
> Password: 308

Thanks for this start.  I noticed some problems with this.


The zip file doesn't have any documentation (not even a README file).


The zip file contains no specification to explain what the code is intended
to do, nor is there any evidence of a design or design rationale.  It would
be good to start with the one in section D.3.1 of the Type Annotations
Specification:
  http://types.cs.washington.edu/jsr308/specification/java-annotation-design.html#inheritance-among-annotations

As one example that is already pointed out in that section, the design
needs to specify how the APIs and interfaces, both for compilation time and
reflection, are intended to work; an example is getAnnotation(Class).
Suppose that annotation types Sub1 and Sub2 are direct subtypes of Super,
whose value field has type int.  What is the behavior of
getAnnotation(Super.class) when called on these locations?

 * a location that is annotated with @Sub1(1)
 * a location that is annotated with @Super(0) and @Sub1(1)
 * a location that is annotated with @Sub1(0) and @Sub2(0)
 * a location that is annotated with @Sub1(1) and @Sub2(2)


The zip file contains some input files that might be useful for testing,
but there is no indication of how to run them, nor any build file.
Furthermore, there are no tests:  there are .java files but no indication
of the expected output.


Do you have any experience using the implementation?


I do not want to be discouraging, especially after you have made a start
(and when so many people on this mailing list have made good contributions
in other respects).  But I'm afraid that right now I don't have time to
take on the maintenance and documentation of undocumented, unspecified,
testless code.  If you want to continue working in order to produce
something that will be solid enough to go in the OpenJDT compiler by way of
the Type Annotations compiler, then that is great and will be very welcome.

Thanks a lot!

                    -Mike



More information about the JSR308 mailing list