RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2]
Jan Lahoda
jlahoda at openjdk.org
Thu Jan 25 19:57:43 UTC 2024
On Wed, 24 Jan 2024 01:26:01 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> @jddarcy ?
>
> 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?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1466897048
More information about the compiler-dev
mailing list