Re: Field order from traits

2019-12-02 Thread Cédric Champeau
Independently of reflection or not, the compiler should be reproducible. So same sources -> same output, whatever the OS, whatever the time. This is important for trust and cache-ability. On this specific issue, the default mechanism is to use ASM which is reproducible. Le lun. 2 déc. 2019 à

Re: Field order from traits

2019-12-02 Thread Andres Almiray
I need consistent field order to get around this problem -> https://github.com/gradle/gradle/issues/11522 I'm aware that reflection does not guarantee order. I was under the impression that the compiler would use the AST which would have the correct order but that only works if the trait is

Re: Field order from traits

2019-12-01 Thread Jochen Theodorou
Hi Andres, I think your expectations are wrong. To understand why it is important I wonder though what you need it for bye Jochen On 01.12.19 19:02, Andres Almiray wrote: Hello everyone, I've encountered a "problem" when using traits. Say you have a couple of traits that define fileds in

Re: Field order from traits

2019-12-01 Thread Jochen Theodorou
On 02.12.19 01:51, Remko Popma wrote: On Mon, Dec 2, 2019 at 9:31 Milles, Eric (TR Tech, Content & Ops) mailto:eric.mil...@thomsonreuters.com>> wrote: Trait fields for properties are added by TraitComposer as it encounters the getter methods (around line 250).  Methods are

Re: Field order from traits

2019-12-01 Thread Remko Popma
rned from ClassNode#getDeclaredMethods, which uses a HashSet. > Should that be changed to a LinkedHashSet? > > *From:* Andres Almiray > *Sent:* Sunday, December 1, 2019 12:02 PM > *To:* Groovy_Developers > *Subject:* Field order from traits > > > > Hello everyone, > > >

Field order from traits

2019-12-01 Thread Andres Almiray
Hello everyone, I've encountered a "problem" when using traits. Say you have a couple of traits that define fileds in the following order @CompileStatic trait CompartmentIdAwareTrait implements PathAware, ProjectAware { @Internal final Property compartmentId =