Clarifying record reflective support
chris.hegarty at oracle.com
Sun Dec 8 20:46:05 UTC 2019
Thank you all for a great discussion. We seem to have reached a
consensus. JDK-8235550 has been filed to track this issue, and I'll
bring it to code review soon.
> On 4 Dec 2019, at 20:57, forax at univ-mlv.fr wrote:
> De: "John Rose" <john.r.rose at oracle.com>
> À: "Maurizio Cimadamore" <maurizio.cimadamore at oracle.com>
> Cc: "Remi Forax" <forax at univ-mlv.fr>, "Brian Goetz" <brian.goetz at oracle.com>, "amber-spec-experts" <amber-spec-experts at openjdk.java.net>, "joe darcy" <joe.darcy at oracle.com>
> 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 <maurizio.cimadamore at oracle.com> wrote:
> On 04/12/2019 15:53,forax at univ-mlv.frwrote:
> 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.
More information about the amber-spec-experts