Inspectopedia
 
2024.3

Module exports/opens package to itself

Warning
New
Last modified: 03 December 2024

Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from module-info.java.

Example:

After the quick-fix is applied:

This inspection depends on the Java feature 'Modules', which is available since Java 9.