heads up: type annos issue
wdietl at gmail.com
Fri Nov 30 14:12:02 PST 2012
Hi Jon, Bhavesh,
On Fri, Nov 30, 2012 at 11:17 AM, Jonathan Gibbons
<jonathan.gibbons at oracle.com> wrote:
> Yesterday, Bhavesh reported that while working on type annotations support
> for javadoc, he noted that when he put a type annotation on a wildcard bound
> (which may have been Object), it ended up on *all* instances of Object, and
> thus showed up throughout the javadoc for the class. We suspect this is due
> to the type annotation being stored in the wrong place. Bhavesh will be
> following up with detailed evidence, but in the meantime, have you seen
> anything like this?
No, I've not seen such behavior. If you could send a small example
program I can investigate.
We do have test cases that annotations on the wildcard and its bound
are stored correctly, for example see
"methodParamAsWildcard()". That method has annotations on the wildcard
and the String bound and a later use of String does not seem to have
an extra annotation. But maybe the behavior is different for Object.
> Would it help to to have a type/symbol printer that pretty prints the
> type/symbol showing all annotations? That way we can (a) take javadoc out
> of the loop here, (b) write test cases more easily/
Yes, having better testing support for this would be helpful. The
referenceinfos tests work from the classfile information, if I
remember correctly. Having tests that work directly on the attributed
AST would be good.
More information about the type-annotations-dev