-
Bug
-
Resolution: Fixed
-
P3
-
15
-
b27
With JEP 384 intergated the specification for j.l.Record still says:
"A record class has the following mandated members: a public canonical constructor, whose descriptor is the same as the record descriptor"
However as experiments show, canonical constructor may not be public.
The following code since JDK15 b24
public class Test {
public static void main(String[] args) {
System.err.println( R.class.getConstructors().length);
System.err.println( PubR.class.getConstructors().length);
}
record R(int i) { }
public record PubR(int i) {}
}
started to print
0
1
"A record class has the following mandated members: a public canonical constructor, whose descriptor is the same as the record descriptor"
However as experiments show, canonical constructor may not be public.
The following code since JDK15 b24
public class Test {
public static void main(String[] args) {
System.err.println( R.class.getConstructors().length);
System.err.println( PubR.class.getConstructors().length);
}
record R(int i) { }
public record PubR(int i) {}
}
started to print
0
1
- csr for
-
JDK-8246629 j.l.Record need to mention that canonical constructor may not be public
-
- Closed
-