< prev index next >

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

Print this page

 470      * @throws     IndexOutOfBoundsException  if copying would cause
 471      *             access of data outside array bounds.
 472      * @throws     ArrayStoreException  if an element in the {@code src}
 473      *             array could not be stored into the {@code dest} array
 474      *             because of a type mismatch.
 475      * @throws     NullPointerException if either {@code src} or
 476      *             {@code dest} is {@code null}.
 477      */
 478     @IntrinsicCandidate
 479     public static native void arraycopy(Object src,  int  srcPos,
 480                                         Object dest, int destPos,
 481                                         int length);
 482 
 483     /**
 484      * Returns the same hash code for the given object as
 485      * would be returned by the default method hashCode(),
 486      * whether or not the given object's class overrides
 487      * hashCode().
 488      * The hash code for the null reference is zero.
 489      *















 490      * @param x object for which the hashCode is to be calculated
 491      * @return  the hashCode
 492      * @since   1.1
 493      * @see Object#hashCode
 494      * @see java.util.Objects#hashCode(Object)
 495      */
 496     @IntrinsicCandidate
 497     public static native int identityHashCode(Object x);
 498 
 499     /**
 500      * System properties.
 501      *
 502      * See {@linkplain #getProperties getProperties} for details.
 503      */
 504     private static Properties props;
 505 
 506     /**
 507      * Determines the current system properties.
 508      * <p>
 509      * The current set of system properties for use by the

2012             }
2013             public Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass) {
2014                 return klass.getDeclaredAnnotationMap();
2015             }
2016             public byte[] getRawClassAnnotations(Class<?> klass) {
2017                 return klass.getRawAnnotations();
2018             }
2019             public byte[] getRawClassTypeAnnotations(Class<?> klass) {
2020                 return klass.getRawTypeAnnotations();
2021             }
2022             public byte[] getRawExecutableTypeAnnotations(Executable executable) {
2023                 return Class.getExecutableTypeAnnotationBytes(executable);
2024             }
2025             public int getClassFileAccessFlags(Class<?> klass) {
2026                 return klass.getClassFileAccessFlags();
2027             }
2028             public <E extends Enum<E>>
2029             E[] getEnumConstantsShared(Class<E> klass) {
2030                 return klass.getEnumConstantsShared();
2031             }
2032             public int classFileVersion(Class<?> clazz) {
2033                 return clazz.getClassFileVersion();
2034             }
2035             public void blockedOn(Interruptible b) {
2036                 Thread.currentThread().blockedOn(b);
2037             }
2038             public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
2039                 Shutdown.add(slot, registerShutdownInProgress, hook);
2040             }
2041             @SuppressWarnings("removal")
2042             public void invokeFinalize(Object o) throws Throwable {
2043                 o.finalize();
2044             }
2045             public ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl) {
2046                 return cl.createOrGetClassLoaderValueMap();
2047             }
2048             public Class<?> defineClass(ClassLoader loader, String name, byte[] b, ProtectionDomain pd, String source) {
2049                 return ClassLoader.defineClass1(loader, name, b, 0, b.length, pd, source);
2050             }
2051             public Class<?> defineClass(ClassLoader loader, Class<?> lookup, String name, byte[] b, ProtectionDomain pd,
2052                                         boolean initialize, int flags, Object classData) {
2053                 return ClassLoader.defineClass0(loader, lookup, name, b, 0, b.length, pd, initialize, flags, classData);
2054             }

 470      * @throws     IndexOutOfBoundsException  if copying would cause
 471      *             access of data outside array bounds.
 472      * @throws     ArrayStoreException  if an element in the {@code src}
 473      *             array could not be stored into the {@code dest} array
 474      *             because of a type mismatch.
 475      * @throws     NullPointerException if either {@code src} or
 476      *             {@code dest} is {@code null}.
 477      */
 478     @IntrinsicCandidate
 479     public static native void arraycopy(Object src,  int  srcPos,
 480                                         Object dest, int destPos,
 481                                         int length);
 482 
 483     /**
 484      * Returns the same hash code for the given object as
 485      * would be returned by the default method hashCode(),
 486      * whether or not the given object's class overrides
 487      * hashCode().
 488      * The hash code for the null reference is zero.
 489      *
 490      * <div class="preview-block">
 491      *      <div class="preview-comment">
 492      *          The "identity hash code" of a {@linkplain Class#isValue() value object}
 493      *          is computed by combining the identity hash codes of the value object's fields recursively.
 494      *      </div>
 495      * </div>
 496      * @apiNote
 497      * <div class="preview-block">
 498      *      <div class="preview-comment">
 499      *          Note that, like ==, this hash code exposes information about a value object's
 500      *          private fields that might otherwise be hidden by an identity object.
 501      *          Developers should be cautious about storing sensitive secrets in value object fields.
 502      *      </div>
 503      * </div>
 504      *
 505      * @param x object for which the hashCode is to be calculated
 506      * @return  the hashCode
 507      * @since   1.1
 508      * @see Object#hashCode
 509      * @see java.util.Objects#hashCode(Object)
 510      */
 511     @IntrinsicCandidate
 512     public static native int identityHashCode(Object x);
 513 
 514     /**
 515      * System properties.
 516      *
 517      * See {@linkplain #getProperties getProperties} for details.
 518      */
 519     private static Properties props;
 520 
 521     /**
 522      * Determines the current system properties.
 523      * <p>
 524      * The current set of system properties for use by the

2027             }
2028             public Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass) {
2029                 return klass.getDeclaredAnnotationMap();
2030             }
2031             public byte[] getRawClassAnnotations(Class<?> klass) {
2032                 return klass.getRawAnnotations();
2033             }
2034             public byte[] getRawClassTypeAnnotations(Class<?> klass) {
2035                 return klass.getRawTypeAnnotations();
2036             }
2037             public byte[] getRawExecutableTypeAnnotations(Executable executable) {
2038                 return Class.getExecutableTypeAnnotationBytes(executable);
2039             }
2040             public int getClassFileAccessFlags(Class<?> klass) {
2041                 return klass.getClassFileAccessFlags();
2042             }
2043             public <E extends Enum<E>>
2044             E[] getEnumConstantsShared(Class<E> klass) {
2045                 return klass.getEnumConstantsShared();
2046             }



2047             public void blockedOn(Interruptible b) {
2048                 Thread.currentThread().blockedOn(b);
2049             }
2050             public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
2051                 Shutdown.add(slot, registerShutdownInProgress, hook);
2052             }
2053             @SuppressWarnings("removal")
2054             public void invokeFinalize(Object o) throws Throwable {
2055                 o.finalize();
2056             }
2057             public ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl) {
2058                 return cl.createOrGetClassLoaderValueMap();
2059             }
2060             public Class<?> defineClass(ClassLoader loader, String name, byte[] b, ProtectionDomain pd, String source) {
2061                 return ClassLoader.defineClass1(loader, name, b, 0, b.length, pd, source);
2062             }
2063             public Class<?> defineClass(ClassLoader loader, Class<?> lookup, String name, byte[] b, ProtectionDomain pd,
2064                                         boolean initialize, int flags, Object classData) {
2065                 return ClassLoader.defineClass0(loader, lookup, name, b, 0, b.length, pd, initialize, flags, classData);
2066             }
< prev index next >