RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2]

Joe Darcy darcy at openjdk.org
Thu Jan 25 21:35:54 UTC 2024


On Thu, 25 Jan 2024 19:54:53 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> I don't think it is preserved in that case as much as a lookup/construction process is done based on the TypeElement, etc.
>> 
>> So I think leaving the annotation behavior unspecified is okay.
>
> The `getDeclaredType` accepts `TypeMirror`s as the type arguments. I tried to invoke the method when this `TypeMirror` has an annotation, and the annotation is in the resulting `DeclaredType` as well. I don't mind this behavior, but my reading of the class' javadoc is that there should be no annotations, unless otherwise stated. And there does not seem to be anything in the `getDeclaredType` javadoc related to annotations on the type arguments, so the class' javadoc would apply. But maybe I miss something/read something wrong?

Ah, right; the type arguments. I was thinking of the root return type. Specification and tests updated. Thanks.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1466983878


More information about the compiler-dev mailing list