-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b150
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.accessibility, the warnings are:
---
.../jdk9/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java:219: warning: [exports] class AWTEventsListener in module jdk.accessibility is not accessible to clients that require this module
static protected AWTEventsListener awtListener = new AWTEventsListener();
^
error: warnings found and -Werror specified
.../jdk9/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java:66: warning: [exports] class AccessibilityEventListener in module jdk.accessibility is not accessible to clients that require this module
static protected final AccessibilityEventListener accessibilityListener =
^
.../jdk9/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java:74: warning: [exports] class SwingEventListener in module jdk.accessibility is not accessible to clients that require this module
static protected final SwingEventListener swingListener = new SwingEventListener();
^
1 error
3 warnings
---
The lint will be disabled for jdk.accessibility. Please check if the warnings can be fixed, or needs to be suppressed.
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.accessibility, the warnings are:
---
.../jdk9/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java:219: warning: [exports] class AWTEventsListener in module jdk.accessibility is not accessible to clients that require this module
static protected AWTEventsListener awtListener = new AWTEventsListener();
^
error: warnings found and -Werror specified
.../jdk9/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java:66: warning: [exports] class AccessibilityEventListener in module jdk.accessibility is not accessible to clients that require this module
static protected final AccessibilityEventListener accessibilityListener =
^
.../jdk9/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java:74: warning: [exports] class SwingEventListener in module jdk.accessibility is not accessible to clients that require this module
static protected final SwingEventListener swingListener = new SwingEventListener();
^
1 error
3 warnings
---
The lint will be disabled for jdk.accessibility. Please check if the warnings can be fixed, or needs to be suppressed.
Thanks.
- relates to
-
JDK-8153362 Add javac -Xlint warning to list exposed types which are not accessible
-
- Closed
-