-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b148
-
Not verified
Under JDK-8153362:
Add javac -Xlint warning to list exposed types which are not accessible
A new lint for javac is developed that warns about exported elements that refer to types that are potentially inaccessible to the client of the API (like package private or not exported types).
For jdk.jshell, the warnings are:
---
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java:195: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
public static void detectJDIExitEvent(VirtualMachine vm, Consumer<String> unbiddenExitHandler) {
^
error: warnings found and -Werror specified
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIExecutionControl.java:64: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
protected abstract VirtualMachine vm() throws EngineTerminationException;
^
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIExecutionControl.java:105: warning: [exports] interface ReferenceType in module jdk.jdi is not indirectly exported using requires public
protected ReferenceType referenceType(VirtualMachine vm, String name) {
^
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIExecutionControl.java:105: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
protected ReferenceType referenceType(VirtualMachine vm, String name) {
^
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java:253: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
protected synchronized VirtualMachine vm() throws EngineTerminationException {
^
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIInitiator.java:92: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
public VirtualMachine vm() {
^
1 error
6 warnings
---
The lint will be disabled for jdk.jshell. Should jdk.jshell "requires public jdk.jdi"? Or we can suppress the warnings.
Thanks.
Add javac -Xlint warning to list exposed types which are not accessible
A new lint for javac is developed that warns about exported elements that refer to types that are potentially inaccessible to the client of the API (like package private or not exported types).
For jdk.jshell, the warnings are:
---
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java:195: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
public static void detectJDIExitEvent(VirtualMachine vm, Consumer<String> unbiddenExitHandler) {
^
error: warnings found and -Werror specified
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIExecutionControl.java:64: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
protected abstract VirtualMachine vm() throws EngineTerminationException;
^
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIExecutionControl.java:105: warning: [exports] interface ReferenceType in module jdk.jdi is not indirectly exported using requires public
protected ReferenceType referenceType(VirtualMachine vm, String name) {
^
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIExecutionControl.java:105: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
protected ReferenceType referenceType(VirtualMachine vm, String name) {
^
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java:253: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
protected synchronized VirtualMachine vm() throws EngineTerminationException {
^
.../jdk9/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIInitiator.java:92: warning: [exports] interface VirtualMachine in module jdk.jdi is not indirectly exported using requires public
public VirtualMachine vm() {
^
1 error
6 warnings
---
The lint will be disabled for jdk.jshell. Should jdk.jshell "requires public jdk.jdi"? Or we can suppress the warnings.
Thanks.
- relates to
-
JDK-8153362 Add javac -Xlint warning to list exposed types which are not accessible
-
- Closed
-