RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3]

Jonathan Gibbons jjg at openjdk.org
Thu Jan 18 01:04:19 UTC 2024


On Thu, 18 Jan 2024 00:30:32 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 115:
>> 
>>> 113:                           new NameToAnnotationEntry("BasicAnnoTests.TB",   BasicAnnoTests.TB.class),
>>> 114:                           new NameToAnnotationEntry("BasicAnnoTests.TC",   BasicAnnoTests.TC.class),
>>> 115:                           new NameToAnnotationEntry("BasicAnnoTests.TCs",  BasicAnnoTests.TCs.class));
>> 
>> You could maybe simplify this by obtaining the name from the class parameter.
>
> Might be a case a premature optimization, but I wanted to avoid the repeated reflective operations here.

Yeah, the map isn't bad in itself, I just have a knee-jerk reaction to mutable static fields ;-)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456689039


More information about the compiler-dev mailing list