--- 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.