Clarifying record reflective support

forax at univ-mlv.fr forax at univ-mlv.fr
Wed Dec 4 20:57:21 UTC 2019


> 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 < [
> mailto:maurizio.cimadamore at oracle.com | maurizio.cimadamore at oracle.com ] >
> wrote:

>> On 04/12/2019 15:53, [ mailto:forax at univ-mlv.fr | forax at univ-mlv.fr ] 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.

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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20191204/378bec57/attachment.html>


More information about the amber-spec-experts mailing list