< prev index next >

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

Print this page
*** 37,10 ***
--- 37,11 ---
  import java.lang.annotation.Annotation;
  import java.lang.foreign.MemorySegment;
  import java.lang.invoke.MethodHandle;
  import java.lang.invoke.MethodType;
  import java.lang.module.ModuleDescriptor;
+ import java.lang.reflect.ClassFileFormatVersion;
  import java.lang.reflect.Executable;
  import java.lang.reflect.Method;
  import java.net.URI;
  import java.nio.channels.Channel;
  import java.nio.channels.spi.SelectorProvider;

*** 476,10 ***
--- 477,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)

*** 2304,10 ***
--- 2320,14 ---
                                                        ContinuationScope contScope,
                                                        Continuation continuation) {
                  return StackWalker.newInstance(options, null, contScope, continuation);
              }
  
+             public int classFileFormatVersion(Class<?> clazz) {
+                 return clazz.getClassFileVersion();
+             }
+ 
              public String getLoaderNameID(ClassLoader loader) {
                  return loader != null ? loader.nameAndId() : "null";
              }
  
              @Override
< prev index next >