----- Mail original ----- > De: "Brian Goetz" <brian.go...@oracle.com> > À: "Remi Forax" <fo...@univ-mlv.fr> > Cc: "John Rose" <john.r.r...@oracle.com>, "amber-spec-experts" > <amber-spec-experts@openjdk.java.net> > Envoyé: Jeudi 5 Septembre 2019 23:48:08 > Objet: Re: Draft JLS spec for records
>> It's not what i'm saying. > > Maybe you could tell us what you are saying? from the same mail: "the canonical constructor should follow the same rule as the default constructor". examples: record Bar { } // the constructor is public, it's a top level record class Foo { private record Bar(int x) {} // the constructor is private, internal class has their canonical constructor with the same visibility as the record itself } interface Foo { record Bar(int x) {} // the constructor is public, because inside an interface members are public by default } and you have not answer to: Also why having the constructor public helps to make the record instantiatable, a constructor to be accessible by reflection requires that both the class and the constructor to be public. So following your point, does it means that all record have to be public too ? Rémi