jdk/src/share/classes/sun/misc/Unsafe.java
changeset 13591 db0d8946475b
parent 13589 da4cb574f4a6
parent 13423 17843fff200d
child 14342 8435a30053c1
--- a/jdk/src/share/classes/sun/misc/Unsafe.java	Mon Aug 27 10:23:43 2012 +0800
+++ b/jdk/src/share/classes/sun/misc/Unsafe.java	Mon Aug 27 10:58:40 2012 -0700
@@ -678,6 +678,14 @@
     public native Object staticFieldBase(Field f);
 
     /**
+     * Detect if the given class may need to be initialized. This is often
+     * needed in conjunction with obtaining the static field base of a
+     * class.
+     * @return false only if a call to {@code ensureClassInitialized} would have no effect
+     */
+    public native boolean shouldBeInitialized(Class<?> c);
+
+    /**
      * Ensure the given class has been initialized. This is often
      * needed in conjunction with obtaining the static field base of a
      * class.