On Thu, 7 Apr 2022 19:33:28 GMT, Phil Race <p...@openjdk.org> wrote: >> Thank you for your clarification. > > You have to include it in the list, else it would not be a permitted > sub-class, and then you couldn't use the new syntax at all. > > the javadoc doesn't mention it - it still just says > public sealed class GroupLayout.ParallelGroup > extends [GroupLayout.Group] > > My recollection is that if there are also public classes the generated > javadocs cites the public one and appends the text "and others" ,, to mean > the private ones .. I don't know why it does that but it still doesn't expose > the internal class
The motivation for that wording is discussed in JEP 409; it indicates the public list of classes is not exhaustive. So for pattern matching (JEP 406), if the pattern matching cases for the switch expressoin are not exhaustive, a default clause on the switch is required. HTH ------------- PR: https://git.openjdk.java.net/jdk/pull/8082