Files
javademos/unsafe-migration/output/02-compile-warnings.txt
T
2026-11-06 21:43:48 +05:30

35 lines
3.0 KiB
Plaintext

$ javac src/UnsafeAccess.java broken/Probe.java (openjdk version "25.0.5" 2026-10-20 LTS)
src/UnsafeAccess.java:2: warning: Unsafe is internal proprietary API and may be removed in a future release
broken/Probe.java:1: warning: Unsafe is internal proprietary API and may be removed in a future release
src/UnsafeAccess.java:8: warning: Unsafe is internal proprietary API and may be removed in a future release
src/UnsafeAccess.java:10: warning: Unsafe is internal proprietary API and may be removed in a future release
src/UnsafeAccess.java:12: warning: Unsafe is internal proprietary API and may be removed in a future release
broken/Probe.java:9: warning: Unsafe is internal proprietary API and may be removed in a future release
broken/Probe.java:12: warning: [removal] allocateMemory(long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:13: warning: [removal] putLong(long,long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:14: warning: [removal] getLong(long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:15: warning: [removal] freeMemory(long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:21: warning: [removal] allocateMemory(long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:22: warning: [removal] putLong(long,long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:23: warning: [removal] getLong(long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:24: warning: [removal] freeMemory(long) in Unsafe has been deprecated and marked for removal
14 warnings
$ javac src/UnsafeAccess.java broken/Probe.java (openjdk version "21.0.12.1" 2026-08-18)
src/UnsafeAccess.java:2: warning: Unsafe is internal proprietary API and may be removed in a future release
broken/Probe.java:1: warning: Unsafe is internal proprietary API and may be removed in a future release
src/UnsafeAccess.java:8: warning: Unsafe is internal proprietary API and may be removed in a future release
src/UnsafeAccess.java:10: warning: Unsafe is internal proprietary API and may be removed in a future release
src/UnsafeAccess.java:12: warning: Unsafe is internal proprietary API and may be removed in a future release
broken/Probe.java:9: warning: Unsafe is internal proprietary API and may be removed in a future release
6 warnings
$ javac -Xlint:removal -Werror src/UnsafeAccess.java broken/Probe.java (openjdk version "25.0.5" 2026-10-20 LTS)
error: warnings found and -Werror specified
broken/Probe.java:12: warning: [removal] allocateMemory(long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:13: warning: [removal] putLong(long,long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:14: warning: [removal] getLong(long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:15: warning: [removal] freeMemory(long) in Unsafe has been deprecated and marked for removal
broken/Probe.java:21: warning: [removal] allocateMemory(long) in Unsafe has been deprecated and marked for removal
exit=1