RFR: 8283706: Add final or sealed modifier to appropriate javax.swing API classes

Joe Darcy darcy at openjdk.java.net
Thu Apr 7 22:22:02 UTC 2022


On Thu, 7 Apr 2022 19:33:28 GMT, Phil Race <prr at 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



More information about the client-libs-dev mailing list