Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Circular dependencies for modules: "requires circular <module-name>".

Owen_Jan 14 2023

I think there should be a "circular" clause of the requires statement for a module. My rationale for making this assertion is because I would like to seal classes that sit on different modules, and I cannot do this as things currently stand.
If the keyword "circular" appears as specified, the compiler will check to see if the module already appears in the dependency graph and produce an error if this is not the case. The compiler can further use this relationship to ensure that a class from one module that extends a sealed class from another is one that appears in the sealed classes permits clause.
What say the Java community?

Comments
Post Details
Added on Jan 14 2023
0 comments
347 views