-
Bug
-
Resolution: Fixed
-
P2
-
9-repo-jigsaw
If 'exports' statement uses package name, then this package should contain file with package declaration due to assertion jigsaw-1.1.2-210:
If the named package is observable in the current module, then at least one compilation unit containing a declaration of the package must be observable in the current module, or a compile-time error occurs.
So compile-time error is expected if the only file is empty (has only comments). But no error occurs.
--------------------------
Minimal case:
Directory layout:
mod1/module-info.java
mod1/pack1/A.java
Code:
A.java:
{code}
// No package declaration here.
{/code}
If the named package is observable in the current module, then at least one compilation unit containing a declaration of the package must be observable in the current module, or a compile-time error occurs.
So compile-time error is expected if the only file is empty (has only comments). But no error occurs.
--------------------------
Minimal case:
Directory layout:
mod1/module-info.java
mod1/pack1/A.java
Code:
A.java:
{code}
// No package declaration here.
{/code}
- relates to
-
JDK-8144342 javac doesn't report errors if module exports non-existent package
- Resolved
-
JDK-8151613 exports statement uses empty observable package
- Closed