8255862: Remove @SuppressWarnings from sun.misc.Unsafe

Reviewed-by: shade, alanb, chegar
This commit is contained in:
Mandy Chung 2020-11-04 17:40:06 +00:00
parent 5348298f62
commit 2da9981e33

View file

@ -636,7 +636,6 @@ public final class Unsafe {
* @see #getInt(Object, long)
*/
@ForceInline
@SuppressWarnings("preview")
public long objectFieldOffset(Field f) {
if (f == null) {
throw new NullPointerException();
@ -646,7 +645,7 @@ public final class Unsafe {
throw new UnsupportedOperationException("can't get field offset on a hidden class: " + f);
}
if (declaringClass.isRecord()) {
throw new UnsupportedOperationException("can't get field offset on a record (preview): " + f);
throw new UnsupportedOperationException("can't get field offset on a record class: " + f);
}
return theInternalUnsafe.objectFieldOffset(f);
}
@ -669,7 +668,6 @@ public final class Unsafe {
* @see #getInt(Object, long)
*/
@ForceInline
@SuppressWarnings("preview")
public long staticFieldOffset(Field f) {
if (f == null) {
throw new NullPointerException();
@ -679,7 +677,7 @@ public final class Unsafe {
throw new UnsupportedOperationException("can't get field offset on a hidden class: " + f);
}
if (declaringClass.isRecord()) {
throw new UnsupportedOperationException("can't get field offset on a record (preview): " + f);
throw new UnsupportedOperationException("can't get field offset on a record class: " + f);
}
return theInternalUnsafe.staticFieldOffset(f);
}
@ -695,7 +693,6 @@ public final class Unsafe {
* this class.
*/
@ForceInline
@SuppressWarnings("preview")
public Object staticFieldBase(Field f) {
if (f == null) {
throw new NullPointerException();
@ -705,7 +702,7 @@ public final class Unsafe {
throw new UnsupportedOperationException("can't get base address on a hidden class: " + f);
}
if (declaringClass.isRecord()) {
throw new UnsupportedOperationException("can't get base address on a record (preview): " + f);
throw new UnsupportedOperationException("can't get base address on a record class: " + f);
}
return theInternalUnsafe.staticFieldBase(f);
}