<div dir="ltr">I would also be very happy if this were backported to earlier JDKs.<div>The pluggable type system frameworks I work on mostly have work-arounds for this issue, but it would be much nicer to have correct type-use annotation information from javac directly.</div><div>I also agree with Chris's comment on having a positive feedback loop. Any positive change has some danger of breaking existing code. This shouldn't stop us from fixing bugs, improving the type-use annotation infrastructure, and enabling more adoption.</div><div><br></div><div>Best,</div><div>cu, WMD.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2024 at 11:22 AM Chris Povirk <<a href="mailto:cpovirk@google.com">cpovirk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"><div dir="ltr">Manu spoke about the ability to annotate different positions (e.g., type-parameter bounds) for improved nullness checking. I'd also call out that this affects even users who use nullness annotations on "basic" locations like fields, parameters, and return types: Unless tools use internal javac APIs, type-use annotations in even these basic locations in class files are invisible until JDK 22. (And as Josiah points out, this affects more tools than just "nullness checkers." We've also seen it with <a href="https://github.com/google/auto/blob/main/value/userguide/index.md" target="_blank">AutoValue</a>.) This means that type-use annotations are worse than declaration annotations in some ways, even as they're better in others. As a result, users can't confidently pick even a set of nullness annotations without evaluating the tradeoffs. It would be great to be able to tell users "Use type-use annotations" without waiting for them all to update to JDK 22.</div><div dir="ltr"><br></div><div dir="ltr">Plus: Even if the fix is backported today, experience shows that users will also have to wait for some annotation processors to be enhanced to start looking for type-use annotations _at all_. I'd be happy to see us continue to drive that positive feedback loop: As type-use annotations become more visible to annotation processors, tools increasingly get modified to recognize them, leading to more adoption of type-use annotations and more opportunity to identify and iron out remaining wrinkles.<br><br>Thanks,<br>Chris</div></div>
</div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><a href="https://ece.uwaterloo.ca/~wdietl/" target="_blank">https://ece.uwaterloo.ca/~wdietl/</a></div>