Re: record components as a first class reflection element

2019-09-25 Thread Chris Hegarty
On 25/09/2019 15:46, Remi Forax wrote: ... The other thing is that the return of getMethods() is in any order while i hope that the return of getRecordComponent() be to in the order of declaration (the order of the RecordComponent attribute for the VM). As was discussed in a parallel thread

Re: record components as a first class reflection element

2019-09-25 Thread Remi Forax
- Mail original - > De: "Brian Goetz" > À: "Vicente Romero" , "John Rose" > > Cc: "amber-spec-experts" > Envoyé: Mercredi 25 Septembre 2019 16:40:31 > Objet: Re: record components as a first class reflection element >

Re: record components as a first class reflection element

2019-09-25 Thread Remi Forax
- Mail original - > De: "Vicente Romero" > À: "John Rose" > Cc: "amber-spec-experts" > Envoyé: Mercredi 25 Septembre 2019 16:15:22 > Objet: Re: record components as a first class reflection element > On 9/24/19 8:38 PM, John Rose wrote

Re: record components as a first class reflection element

2019-09-25 Thread Brian Goetz
I think what John is saying is that once we have a reflective object to describe the component, there's no need to actually go from there to the method if we want to operate on it; we can just expose a `get()` method right on the component. If we did this, then we'd want to also support Looku

Re: record components as a first class reflection element

2019-09-25 Thread Vicente Romero
On 9/24/19 8:38 PM, John Rose wrote: On Sep 24, 2019, at 1:47 PM, Vicente Romero wrote: On 9/24/19 4:07 PM, Maurizio Cimadamore wrote: Question - should RecordComponent extend java.lang.reflect.Member (after all, it has a name and a type). Not 100% sure. good question, I would say yes, w

Re: record components as a first class reflection element

2019-09-24 Thread John Rose
On Sep 24, 2019, at 1:47 PM, Vicente Romero wrote: > > > On 9/24/19 4:07 PM, Maurizio Cimadamore wrote: >> Question - should RecordComponent extend java.lang.reflect.Member (after >> all, it has a name and a type). Not 100% sure. > > good question, I would say yes, we can say that record compo

Re: record components as a first class reflection element

2019-09-24 Thread Vicente Romero
On 9/24/19 4:07 PM, Maurizio Cimadamore wrote: Question - should RecordComponent extend java.lang.reflect.Member (after all, it has a name and a type). Not 100% sure. good question, I would say yes, we can say that record components are members of the class, but I'm not 100% sure either

Re: record components as a first class reflection element

2019-09-24 Thread Vicente Romero
On 9/24/19 3:33 PM, Alex Buckley wrote: At first glance, this is sensible because of the first-class status in the JLS of record components and their mapping to accessors. Based on a check of other implementations of AnnotatedElement, consider `boolean isVarArgs()` (IIRC a varargs component

Re: record components as a first class reflection element

2019-09-24 Thread Maurizio Cimadamore
Question - should RecordComponent extend java.lang.reflect.Member (after all, it has a name and a type). Not 100% sure. Maurizio On 24/09/2019 20:33, Alex Buckley wrote: At first glance, this is sensible because of the first-class status in the JLS of record components and their mapping to acc

Re: record components as a first class reflection element

2019-09-24 Thread Alex Buckley
At first glance, this is sensible because of the first-class status in the JLS of record components and their mapping to accessors. Based on a check of other implementations of AnnotatedElement, consider `boolean isVarArgs()` (IIRC a varargs component will be allowed) and `String toGenericStri

record components as a first class reflection element

2019-09-24 Thread Vicente Romero
Hi amber experts, We are considering our next move in the reflection area for records. It will be hoisting record components to a first class status in the reflection engine. Our current proposal is to define a new class named: java.lang.reflect.RecordComponent which will will be roughly defin