Re: Draft specification for java.lang.Record

2019-08-20 Thread Stuart Marks
It might be worth also saying something about finalization. I think the choices are to do nothing (be finalizer-agnostic) or to prohibit it. Generating a finalize() method for every record class seems like a non-starter. I'm leaning toward prohibiting finalization, for a couple reasons. First,

Re: Draft specification for java.lang.Record

2019-08-17 Thread Brian Goetz
Hi all, why Record is a class (an abstract class) and not an interface ? It's a fair question.  At this point, it could go either way, and both have pros and cons. Being an interface also means that we will be able to mix an inline type and a record, an inline record?, for free, and more g

Re: Draft specification for java.lang.Record

2019-08-17 Thread Remi Forax
> À: "amber-spec-experts" > Envoyé: Jeudi 15 Août 2019 19:06:02 > Objet: Draft specification for java.lang.Record > Draft spec, please comment. > /* * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * > DO > NOT ALTER OR REMOVE COPYRIGHT NOT

Re: Draft specification for java.lang.Record

2019-08-15 Thread Brian Goetz
/** * This is the common base class of all Java language record classes. Well, and /only/ record classes -- it can't be extended manually. It seems useful to understand both necessity and sufficiency, though I notice Enum also doesn't say this. Right, that's something for the JLS to

Re: Draft specification for java.lang.Record

2019-08-15 Thread Alex Buckley
On 8/15/2019 12:18 PM, Brian Goetz wrote: Cloning: if a record class was to implement Cloneable, then the inherited implementation of Object::clone would not preserve copy equality (because, yes, cloning is not the same as copying). Recommend not implementing Cloneable? We have an opportunit

Re: Draft specification for java.lang.Record

2019-08-15 Thread Alex Buckley
I am reading this javadoc from the POV of someone in 2034 (15 years hence, like we are 15 years from Enum) who doesn't know anything about Amber. On 8/15/2019 10:34 AM, Brian Goetz wrote: /**  * This is the common base class of all Java language record classes. I know this borrows from Enum

Re: Draft specification for java.lang.Record

2019-08-15 Thread Brian Goetz
Re-sending as plain text, since the formatting got mangled by mailers. /*  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.  *  * This code is free software; you can redistribute it and/or modify it  * und

Re: Draft specification for java.lang.Record

2019-08-15 Thread Tagir Valeev
Hello! equals() spec says: The implicitly provided implementation returns {@code true} if and * only if the argument is an instance of the same record type as this object, * and each component of this record is equal to the corresponding component * of the argument, according to

Re: Draft specification for java.lang.Record

2019-08-15 Thread Tagir Valeev
Hello! >a private static field corresponding to each component Final instead of static? With best regards, Tagir Valeev пт, 16 авг. 2019 г., 0:06 Brian Goetz : > Draft spec, please comment. > > > /* * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * > DO NOT ALTER OR R

Draft specification for java.lang.Record

2019-08-15 Thread Brian Goetz
Draft spec, please comment. /* * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License v