RFR: 8320001: javac crashes while adding type annotations to constructor's return type

Vicente Romero vromero at openjdk.org
Wed Nov 22 00:07:04 UTC 2023


On Tue, 21 Nov 2023 23:39:44 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java line 2335:
>> 
>>> 2333:             }
>>> 2334:             mt.thrown = thrown.toList();
>>> 2335:             /* possible information loss if the type of the method is void then we can't add type
>> 
>> @vicente-romero-oracle Could we open a follow-up issue to add a standard way to retrieve these type annotations?
>> Type use annotations on constructors are valid Java >= 8 syntax and they are stored in the classfiles, so it would be nice to also get the annotations out of a classfile.
>
> That seems worth considering to me as a potential follow-up. One note is that as far as I can tell the current `javax.lang.model` implementation doesn't allow retrieving type annotations on constructors, I don't think this issue is specific to class loading.

yes makes total sense, I will create a follow-up

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16774#discussion_r1401348445


More information about the compiler-dev mailing list