<div dir="ltr"><div dir="ltr"><div dir="ltr">On Fri, Feb 5, 2021 at 6:45 AM Joel Borggren-Franck <<a href="mailto:joel.p.borggren-franck@oracle.com" target="_blank">joel.p.borggren-franck@oracle.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">An alternative would be to adopt your original proposal, “all current and future declaration contextsâ€, and adding an ElementType corresponding to this default. This way the question “where are annotations applicable?†would be solved, the user can easily and with brevity opt in to all contexts by using something like “@Target({DECLARATIONS, TYPE_USE})" and the backward compatibility risk is lower. The downside is It would mean more work for us in implementing this.</blockquote></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 5, 2021 at 12:15 PM Alex Buckley <<a href="mailto:alex.buckley@oracle.com" target="_blank">alex.buckley@oracle.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">Encouraging the owner to specify @Target by offering an <br>
ElementType.DECLARATIONS constant that means "all [current and future] <br>
declaration contexts" is a good idea, balancing how ElementType.TYPE_USE <br>
means "all [current and future] type contexts".<br></blockquote><div><br></div><div>I had a similar thought while updating the affected tests: `@Target(DECLARATIONS)` would have been useful for a number of them.<br><br>I don't have a strong opinion either way about whether this change is worth pursuing, or worth pursuing now. The simplicity of @Target-less annotations applying to everything is appealing. I also think there's going to be some noticeable compatibility impact, due to the number of annotations that will start appearing in type contexts, and the number of tools that process annotations that will need to become more robust in their handling of type annotations.<br><br>If there's a tentative agreement that making @Target-less annotations apply to everything together with introducing ElementType.DECLARATIONS is a reasonable path forward, I can work on a proposal for that.</div></div></div>