Experience with sealed classes & the "same package" rule
John Rose
john.r.rose at oracle.com
Wed Jun 9 22:29:40 UTC 2021
On Jun 9, 2021, at 2:42 PM, Dan Smith <daniel.smith at oracle.com<mailto:daniel.smith at oracle.com>> wrote:
Here's some late feedback on the sealed classes preview. Probably actionable before 17 GA, if that's what people want to do, or potentially a change that can come in a future release. (Or you can just tell me that this inconvenience isn't a big deal, live with it.)
When I read this the first time I thought, “that’s a
sharp edge that will make sealed classes harder to use”.
It has the laudable effect of nudging users towards
modules, but that’s not (IMO) the job of such a
language features.
I agree it should not be coupled to modules. It’s
up to users to decide what are their maintenance
boundaries. It seems very desirable, to me, that
adding modularity should subtract permissions
only, and not accidentally add some, as in this
report.
(Also on the same hit-list: The restriction against
using local sealed hierarchies. The restriction
doesn’t make any sense, logically. And it is a
sharp edge when you copy-and-paste a hierarchy
as a unit.)
— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20210609/809f73ac/attachment-0001.htm>
More information about the amber-spec-experts
mailing list