Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widening permitted subclasses #12

Open
liach opened this issue Sep 16, 2021 · 3 comments
Open

Widening permitted subclasses #12

liach opened this issue Sep 16, 2021 · 3 comments

Comments

@liach
Copy link

liach commented Sep 16, 2021

In Java 17, released a few days ago, sealed classes officially become a feature. It seems this library is a good place to support the functionality of adding more permitted subclasses to a sealed class (or destroy the seal altogether), since sealed class status is described together with being final, both as restrictions on inheritance.

Note: in practice, this may be less useful because the permitted subclasses must be in the same package (in an unnamed module) or in the same named module. Since Minecraft distributions run as unnamed modules, it may be interesting to see their usage of sealed classes once they update to Java 17 (little reason not to do so as 17 is a LTS release)

@ZekerZhayard
Copy link
Contributor

Isn't #11 done?

@ghost
Copy link

ghost commented Sep 16, 2021

That only allows you to remove the sealed modifier, not add additional classes to be permitted.

@liach
Copy link
Author

liach commented Sep 16, 2021

but goig back to the note, adding additional permissions can only work for same package/module, so the feasibility is subject to discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants