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

Joe Darcy darcy at openjdk.org
Wed Jan 24 01:28:30 UTC 2024


On Tue, 23 Jan 2024 23:56:47 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> src/java.compiler/share/classes/javax/lang/model/util/Types.java line 241:
>> 
>>> 239:      * @param extendsBound  the extends (upper) bound, or {@code null} if none
>>> 240:      * @param superBound    the super (lower) bound, or {@code null} if none
>>> 241:      * @throws IllegalArgumentException if bounds are not valid
>> 
>> Should annotation also be preserved (and also documented to be preserved) for `getDeclaredType`?
>
> @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.

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

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


More information about the compiler-dev mailing list