Clarifying record reflective support

forax at forax at
Wed Dec 4 20:57:21 UTC 2019

> De: "John Rose" <john.r.rose at>
> À: "Maurizio Cimadamore" <maurizio.cimadamore at>
> Cc: "Remi Forax" <forax at>, "Brian Goetz" <brian.goetz at>,
> "amber-spec-experts" <amber-spec-experts at>, "joe darcy"
> <joe.darcy at>
> Envoyé: Mercredi 4 Décembre 2019 20:20:46
> Objet: Re: Clarifying record reflective support

> On Dec 4, 2019, at 7:59 AM, Maurizio Cimadamore < [
> mailto:maurizio.cimadamore at | maurizio.cimadamore at ] >
> wrote:

>> On 04/12/2019 15:53, [ mailto:forax at | forax at ] wrote:

>>> Like getEnumConstants(), this is an argument i can agree upon.

>> Yes, that is the important precedent here.

> +1; getEnumX getRecordX are clearly partial functions (like getComponentType
> als0),
> while the others that always return non-null are clearly total functions.

> I.e., get[Declared][Fields,Methods,Classes,…] apply evenly to all classes, not
> just some kinds.

I'm convinced. 

Furthermore, I've taken a look to the code of my students have written for the lab that uses record last month, it's a small sample, 15 students, but all of them are using getRecordComponents() either after a call to isRecord() or after an instanceof java.lang.Record so i suppose, Maurizio is right that getRecordX implicitly means that the class has to be a record. 

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

More information about the amber-spec-experts mailing list