< prev index next >

src/java.base/share/classes/java/lang/System.java

Print this page
@@ -485,10 +485,25 @@
       * would be returned by the default method hashCode(),
       * whether or not the given object's class overrides
       * hashCode().
       * The hash code for the null reference is zero.
       *
+      * <div class="preview-block">
+      *      <div class="preview-comment">
+      *          The "identity hash code" of a {@linkplain Class#isValue() value object}
+      *          is computed by combining the identity hash codes of the value object's fields recursively.
+      *      </div>
+      * </div>
+      * @apiNote
+      * <div class="preview-block">
+      *      <div class="preview-comment">
+      *          Note that, like ==, this hash code exposes information about a value object's
+      *          private fields that might otherwise be hidden by an identity object.
+      *          Developers should be cautious about storing sensitive secrets in value object fields.
+      *      </div>
+      * </div>
+      *
       * @param x object for which the hashCode is to be calculated
       * @return  the hashCode
       * @since   1.1
       * @see Object#hashCode
       * @see java.util.Objects#hashCode(Object)

@@ -2027,13 +2042,10 @@
              }
              public <E extends Enum<E>>
              E[] getEnumConstantsShared(Class<E> klass) {
                  return klass.getEnumConstantsShared();
              }
-             public int classFileVersion(Class<?> clazz) {
-                 return clazz.getClassFileVersion();
-             }
              public void blockedOn(Interruptible b) {
                  Thread.currentThread().blockedOn(b);
              }
              public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
                  Shutdown.add(slot, registerShutdownInProgress, hook);
< prev index next >