Component deprecation

Brian Goetz brian.goetz at
Fri Jan 10 22:29:23 UTC 2020

>     The Deprecated attribute is, effectively, Deprecated.  So I'm not
>     interested in giving it any life support. 
> I think there is a confusion somewhere.
> The JVMS has no word about deprecating the attribute Deprecated, javac 
> 14 is using it, so i don't understand.
> For me, a record component is at the same level as a field or a 
> method, by example, they all have their own sub-attributes.
> Given that both a field and a method are using the attribute 
> Deprecated, it is logical that a record component also uses the 
> attribute Deprecated.
> The current state seems like a gratuitous discrepancy.
> So perhaps in the future, we may deprecate the attribute Deprecated 
> but that's another story, for another time.

Nope.  We have zero interest in keeping this attribute on life 
support.   (And my remaining attention budget for this entire topic is 
about 5m, so it's mostly used just writing this mail.)

>     However, it is reasonable to allow the @Deprecated annotation on
>     record components.  And, you can apply it there now!  And if you
>     do, it will get propagated to fields, accessors, and constructor
>     parameters, and reflection will reflect the right thing -- because
>     its an annotation. 
> yes, but it will not be stored as a runtime visible annotation on a 
> record component in the bytecode.

WHy not?  It is a runtime-visible annotation:

@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PACKAGE, ElementType.MODULE, ElementType.PARAMETER, ElementType.TYPE})
public @interface Deprecated {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the amber-spec-experts mailing list