<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 13/09/2024 10:49, Zheka Kozlov wrote:<br>
<blockquote type="cite" cite="mid:CAF2POUf424DzVx=mL6BCh9n7RF8x7iC+PwXdOo3h24T4ceo7Pw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hello!</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">JEP 471 says
that 79 methods out of 87 have been deprecated in
sun.misc.Unsafe. However, I have a different number.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Deprecated
for removal in Java 18:</div>
<div class="gmail_default" style="font-size:small">1. public
long objectFieldOffset(Field f)<br>
2. public Object staticFieldBase(Field f)<br>
3. public long staticFieldOffset(Field f)<br>
</div>
</div>
</blockquote>
These three were ordinarily deprecated in JDK 18, then deprecated
for removal in JDK 23.<br>
<br>
I didn't check the numbers, the main thing with this JEP is that it
contains the roadmap for removal for everything except the 3
instance methods that you listed at the end. It's important that
developers maintaining libraries using Unsafe are looking at
VarHandle and FFM APIs.<br>
<br>
-Alan<br>
</body>
</html>