The following example shows that 'compiler.warn.sun.proprietary' diagnostics are not emitted if --system is configured to an earlier JDK version. I expected the diagnostics to be emitted for both configurations.
The diagnostics are consistently emitted for different configurations of --release.
cat A.java
class A {
sun.misc.Unsafe theUnsafe;
}
$JAVA21_HOME/bin/java -fullversion
openjdk full version "21.0.2+13-58"
$JAVA11_HOME/bin/java -fullversion
openjdk full version "11.0.16+8"
$JAVA21_HOME/bin/javac --system $JAVA21_HOME A.java
A.java:2: warning: Unsafe is internal proprietary API and may be removed in a future release
sun.misc.Unsafe theUnsafe;
^
1 warning
$JAVA21_HOME/bin/javac --system $JAVA11_HOME A.java
...
no diagnostics
The diagnostics are consistently emitted for different configurations of --release.
cat A.java
class A {
sun.misc.Unsafe theUnsafe;
}
$JAVA21_HOME/bin/java -fullversion
openjdk full version "21.0.2+13-58"
$JAVA11_HOME/bin/java -fullversion
openjdk full version "11.0.16+8"
$JAVA21_HOME/bin/javac --system $JAVA21_HOME A.java
A.java:2: warning: Unsafe is internal proprietary API and may be removed in a future release
sun.misc.Unsafe theUnsafe;
^
1 warning
$JAVA21_HOME/bin/javac --system $JAVA11_HOME A.java
...
no diagnostics
- is cloned by
-
JDK-8332744 [REDO] 'internal proprietary API' diagnostics if --system is configured to an earlier JDK version
- Resolved
- relates to
-
JDK-8332740 [BACKOUT] JDK-8331081 'internal proprietary API' diagnostics if --system is configured to an earlier JDK version
- Resolved