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, fo...@univ-mlv.fr wrote: > > > > De: "John Rose" <john.r.r...@oracle.com> > À: "Maurizio Cimadamore" <maurizio.cimadam...@oracle.com> > Cc: "Remi Forax" <fo...@univ-mlv.fr>, "Brian Goetz" <brian.go...@oracle.com>, > "amber-spec-experts" <amber-spec-experts@openjdk.java.net>, "joe darcy" > <joe.da...@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.cimadam...@oracle.com> wrote: > > On 04/12/2019 15:53,forax@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. > > > 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 >