In a module, it's possible for types to be exposed even though they aren't accessible. This is most likely not the intended behavior, and should therefore result in an -Xlint warning like:
com.foo.impl
type X is exposed by member Y of accessible type Z
JUSTIFICATION :
Exposure of inaccessible types is most likely not intended (I can't readily think of use cases where this would be an appropriate thing to do).
I have already proposed this enhancement on the jigsaw mailing list [1], and there seemed to be consensus that this would be a fine thing to have.
There was some discussion on whether this should be an error or a (-Xlint) warning. I believe this should be an -Xlint warning for the reasons described in [2]
[1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-March/007014.html
[2] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-March/007043.html
- relates to
-
JDK-8167187 Exported elements referring to inaccessible types in jdk.jsobject
- Resolved
-
JDK-8167176 Exported elements referring to inaccessible types in java.desktop
- Resolved
-
JDK-8167178 Exported elements referring to inaccessible types in java.naming
- Resolved
-
JDK-8167180 [JVMCI] Exported elements referring to inaccessible types in jdk.vm.ci
- Resolved
-
JDK-8167181 Exported elements referring to inaccessible types in jdk.security.jgss
- Resolved
-
JDK-8167182 Exported elements referring to inaccessible types in jdk.accessibility
- Resolved
-
JDK-8167185 JShell API: Exported elements referring to inaccessible types in jdk.jshell
- Closed
-
JDK-8161376 Introduce -Xlint:exports
- Closed