mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 20:14:43 +02:00
8255862: Remove @SuppressWarnings from sun.misc.Unsafe
Reviewed-by: shade, alanb, chegar
This commit is contained in:
parent
5348298f62
commit
2da9981e33
1 changed files with 3 additions and 6 deletions
|
@ -636,7 +636,6 @@ public final class Unsafe {
|
||||||
* @see #getInt(Object, long)
|
* @see #getInt(Object, long)
|
||||||
*/
|
*/
|
||||||
@ForceInline
|
@ForceInline
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public long objectFieldOffset(Field f) {
|
public long objectFieldOffset(Field f) {
|
||||||
if (f == null) {
|
if (f == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
|
@ -646,7 +645,7 @@ public final class Unsafe {
|
||||||
throw new UnsupportedOperationException("can't get field offset on a hidden class: " + f);
|
throw new UnsupportedOperationException("can't get field offset on a hidden class: " + f);
|
||||||
}
|
}
|
||||||
if (declaringClass.isRecord()) {
|
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);
|
return theInternalUnsafe.objectFieldOffset(f);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +668,6 @@ public final class Unsafe {
|
||||||
* @see #getInt(Object, long)
|
* @see #getInt(Object, long)
|
||||||
*/
|
*/
|
||||||
@ForceInline
|
@ForceInline
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public long staticFieldOffset(Field f) {
|
public long staticFieldOffset(Field f) {
|
||||||
if (f == null) {
|
if (f == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
|
@ -679,7 +677,7 @@ public final class Unsafe {
|
||||||
throw new UnsupportedOperationException("can't get field offset on a hidden class: " + f);
|
throw new UnsupportedOperationException("can't get field offset on a hidden class: " + f);
|
||||||
}
|
}
|
||||||
if (declaringClass.isRecord()) {
|
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);
|
return theInternalUnsafe.staticFieldOffset(f);
|
||||||
}
|
}
|
||||||
|
@ -695,7 +693,6 @@ public final class Unsafe {
|
||||||
* this class.
|
* this class.
|
||||||
*/
|
*/
|
||||||
@ForceInline
|
@ForceInline
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public Object staticFieldBase(Field f) {
|
public Object staticFieldBase(Field f) {
|
||||||
if (f == null) {
|
if (f == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
|
@ -705,7 +702,7 @@ public final class Unsafe {
|
||||||
throw new UnsupportedOperationException("can't get base address on a hidden class: " + f);
|
throw new UnsupportedOperationException("can't get base address on a hidden class: " + f);
|
||||||
}
|
}
|
||||||
if (declaringClass.isRecord()) {
|
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);
|
return theInternalUnsafe.staticFieldBase(f);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue