Files
openide/java/java-impl/resources/inspectionDescriptions/Java9RedundantRequiresStatement.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

16 lines
905 B
HTML

<html>
<body>
Reports redundant <code>requires</code> directives in Java Platform Module System <code>module-info.java</code> files.
A <code>requires</code> directive is redundant when a module <code>A</code> requires a module <code>B</code>,
but the code in module <code>A</code> doesn't import any packages or classes from <code>B</code>.
Furthermore, all modules have an implicitly declared dependence on the <code>java.base</code> module,
therefore a <code>requires java.base;</code> directive is always redundant.
<p>
The quick-fix deletes the redundant <code>requires</code> directive.
If the deleted dependency re-exported modules that are actually used, the fix adds a <code>requires</code> directives for these modules.
</p>
<!-- tooltip end -->
<p>This inspection only reports if the language level of the project or module is 9 or higher.</p>
<p><small>New in 2017.1</small>
</body>
</html>