[External] : Re: RFR: 8231436: Fix the applicability of a no- at Target annotation type

Alex Buckley alex.buckley at oracle.com
Sat Feb 6 01:56:12 UTC 2021


On 2/5/2021 5:13 PM, Liam Miller-Cushon wrote:
> If I was writing a CSR for this I'd probably estimate the compatibility 
> impact as 'low'--I think it's more than 'minimal', and it may deserve a 
> release note, but it's likely not prohibitively high. Does that sound right?

Yes. The real issue is that _any_ open-ended definition, even the 
middle-ground "all declaration contexts" one, can lead to 
incompatibilities in processors when annotations are applied in places 
newer than the processor. (Consider a no- at Target @Foo annotation being 
applied to a record component declaration, and thus showing up as a 
declaration annotation on both the corresponding component field and 
accessor method, versus an annotation processor that assumed @Foo would 
only ever appear on class declarations.)  We accept the low risk of 
incompatibilities because open-ended definitions are simple and because 
programmers can easily opt out by giving their desired applicability.

> [1] https://www.hyrumslaw.com/ 

a.k.a. Martin Buchholz's "Every change is an incompatible change."


More information about the compiler-dev mailing list