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.
-Chris. > On 4 Dec 2019, at 20:57, [email protected] wrote: > > > > De: "John Rose" <[email protected]> > À: "Maurizio Cimadamore" <[email protected]> > Cc: "Remi Forax" <[email protected]>, "Brian Goetz" <[email protected]>, > "amber-spec-experts" <[email protected]>, "joe darcy" > <[email protected]> > 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 > <[email protected]> wrote: > > On 04/12/2019 15:53,[email protected]: > 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. > > > okay, > 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. > > Rémi >
