< prev index next >

src/java.base/share/classes/java/net/Inet6Address.java

Print this page
rev 17358 : 8182487: Add Unsafe.objectFieldOffset(Class, String)
Reviewed-by: dsimms

@@ -578,18 +578,14 @@
 
     private static final long FIELDS_OFFSET;
     private static final jdk.internal.misc.Unsafe UNSAFE;
 
     static {
-        try {
             jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe();
             FIELDS_OFFSET = unsafe.objectFieldOffset(
-                    Inet6Address.class.getDeclaredField("holder6"));
+                Inet6Address.class, "holder6");
             UNSAFE = unsafe;
-        } catch (ReflectiveOperationException e) {
-            throw new Error(e);
-        }
     }
 
     /**
      * restore the state of this object from stream
      * including the scope information, only if the
< prev index next >