[records] New draft spec for JEP 359
amaembo at gmail.com
Fri Jan 10 16:30:19 UTC 2020
Woo-hoo, a new year present, spec update!
I don't see any changes regarding the variable arity mismatch between
the canonical constructor and record header. See my e-mail . Was
this suggestion rejected or overlooked?
Also, a cosmetic suggestion in 8.10.1:
It can be seen that the production for RecordComponent is identical in
content to the production for FormalParameter (8.4.1), except a record
component can not have a final modifier.
The following productions from 8.4.1, 8.3 and 4.3 are shown here for
Now, if we don't allow any modifiers anymore, displaying here
FormalParameter, VariableArityParameter and VariableModifier don't add
any convenience and probably adds only some confusion (one may see
VariableModifier production and mistakenly assume that 'final' is
allowed). I would leave here only productions referenced from the
record header grammar: VariableDeclaratorId and Dims.
Finally, a minor nitpick regarding 8.1.4 Superclasses and subclasses:
> It is a compile-time error if the ClassType names the class Enum or any invocation of Enum (8.9).
> It is a compile-time error if the ClassType names the class Record (8.10).
Here Enum and Record are referred by simple name while in other places
of the spec they are referred via fully-qualified name. I feel this
adds some ambiguity, though it's a minor point.
Everything else looks great to me, and I'm happy to see that most of
our recent discussions are crystallized in the spec now. Thank you!
With best regards,
On Fri, Jan 10, 2020 at 8:32 PM Gavin Bierman <gavin.bierman at oracle.com> wrote:
> Happy new year everyone! An updated version of the records spec is available at:
> (which currently points to http://cr.openjdk.java.net/~gbierman/jep359/jep359-20200110/specs/records-jls.html)
> This addresses:
> * Removes `final` modifier on record components
> * Adding missing annotation target PARAMETER
> * Corrects discussion of @SafeVarargs annotation
> * Forbids capture of local variables in a local record
> * Clarifies implicit formal parameter list in a compact constructor
More information about the amber-spec-experts