equal
deleted
inserted
replaced
28 * java.management |
28 * java.management |
29 * @run main GetPutInt |
29 * @run main GetPutInt |
30 */ |
30 */ |
31 |
31 |
32 import java.lang.reflect.Field; |
32 import java.lang.reflect.Field; |
33 import jdk.test.lib.unsafe.UnsafeHelper; |
|
34 import jdk.internal.misc.Unsafe; |
33 import jdk.internal.misc.Unsafe; |
35 import static jdk.test.lib.Asserts.*; |
34 import static jdk.test.lib.Asserts.*; |
36 |
35 |
37 public class GetPutInt { |
36 public class GetPutInt { |
38 public static void main(String args[]) throws Exception { |
37 public static void main(String args[]) throws Exception { |
39 Unsafe unsafe = UnsafeHelper.getUnsafe(); |
38 Unsafe unsafe = Unsafe.getUnsafe(); |
40 Test t = new Test(); |
39 Test t = new Test(); |
41 Field field = Test.class.getField("i"); |
40 Field field = Test.class.getField("i"); |
42 |
41 |
43 long offset = unsafe.objectFieldOffset(field); |
42 long offset = unsafe.objectFieldOffset(field); |
44 assertEquals(-1, unsafe.getInt(t, offset)); |
43 assertEquals(-1, unsafe.getInt(t, offset)); |