11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package java.lang;
26
27 import java.io.*;
28 import java.lang.reflect.Executable;
29 import java.lang.annotation.Annotation;
30 import java.security.AccessControlContext;
31 import java.security.AccessController;
32 import java.security.PrivilegedAction;
33 import java.util.Properties;
34 import java.util.PropertyPermission;
35 import java.util.Map;
36 import java.nio.channels.Channel;
37 import java.nio.channels.spi.SelectorProvider;
38 import java.util.Objects;
39 import java.util.ResourceBundle;
40 import java.util.function.Supplier;
41 import sun.nio.ch.Interruptible;
42 import sun.reflect.CallerSensitive;
43 import sun.reflect.Reflection;
44 import sun.security.util.SecurityConstants;
45 import sun.reflect.annotation.AnnotationType;
46 import jdk.internal.HotSpotIntrinsicCandidate;
47 import jdk.internal.misc.JavaLangAccess;;
48 import jdk.internal.misc.SharedSecrets;;
49 import jdk.internal.logger.LoggerFinderLoader;
50 import jdk.internal.logger.LazyLoggers;
51 import jdk.internal.logger.LocalizedLoggerWrapper;
52
53 /**
54 * The <code>System</code> class contains several useful class fields
55 * and methods. It cannot be instantiated.
1878 return klass.getDeclaredAnnotationMap();
1879 }
1880 public byte[] getRawClassAnnotations(Class<?> klass) {
1881 return klass.getRawAnnotations();
1882 }
1883 public byte[] getRawClassTypeAnnotations(Class<?> klass) {
1884 return klass.getRawTypeAnnotations();
1885 }
1886 public byte[] getRawExecutableTypeAnnotations(Executable executable) {
1887 return Class.getExecutableTypeAnnotationBytes(executable);
1888 }
1889 public <E extends Enum<E>>
1890 E[] getEnumConstantsShared(Class<E> klass) {
1891 return klass.getEnumConstantsShared();
1892 }
1893 public void blockedOn(Thread t, Interruptible b) {
1894 t.blockedOn(b);
1895 }
1896 public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
1897 Shutdown.add(slot, registerShutdownInProgress, hook);
1898 }
1899 public String newStringUnsafe(char[] chars) {
1900 return new String(chars, true);
1901 }
1902 public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) {
1903 return new Thread(target, acc);
1904 }
1905 public void invokeFinalize(Object o) throws Throwable {
1906 o.finalize();
1907 }
1908 public void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) {
1909 Long.formatUnsignedLong(val, shift, buf, offset, len);
1910 }
1911 public void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) {
1912 Integer.formatUnsignedInt(val, shift, buf, offset, len);
1913 }
1914 });
1915 }
1916 }
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package java.lang;
26
27 import java.io.*;
28 import java.lang.reflect.Executable;
29 import java.lang.annotation.Annotation;
30 import java.security.AccessControlContext;
31 import java.util.Properties;
32 import java.util.PropertyPermission;
33 import java.util.Map;
34 import java.security.AccessController;
35 import java.security.PrivilegedAction;
36 import java.nio.channels.Channel;
37 import java.nio.channels.spi.SelectorProvider;
38 import java.util.Objects;
39 import java.util.ResourceBundle;
40 import java.util.function.Supplier;
41 import sun.nio.ch.Interruptible;
42 import sun.reflect.CallerSensitive;
43 import sun.reflect.Reflection;
44 import sun.security.util.SecurityConstants;
45 import sun.reflect.annotation.AnnotationType;
46 import jdk.internal.HotSpotIntrinsicCandidate;
47 import jdk.internal.misc.JavaLangAccess;;
48 import jdk.internal.misc.SharedSecrets;;
49 import jdk.internal.logger.LoggerFinderLoader;
50 import jdk.internal.logger.LazyLoggers;
51 import jdk.internal.logger.LocalizedLoggerWrapper;
52
53 /**
54 * The <code>System</code> class contains several useful class fields
55 * and methods. It cannot be instantiated.
1878 return klass.getDeclaredAnnotationMap();
1879 }
1880 public byte[] getRawClassAnnotations(Class<?> klass) {
1881 return klass.getRawAnnotations();
1882 }
1883 public byte[] getRawClassTypeAnnotations(Class<?> klass) {
1884 return klass.getRawTypeAnnotations();
1885 }
1886 public byte[] getRawExecutableTypeAnnotations(Executable executable) {
1887 return Class.getExecutableTypeAnnotationBytes(executable);
1888 }
1889 public <E extends Enum<E>>
1890 E[] getEnumConstantsShared(Class<E> klass) {
1891 return klass.getEnumConstantsShared();
1892 }
1893 public void blockedOn(Thread t, Interruptible b) {
1894 t.blockedOn(b);
1895 }
1896 public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
1897 Shutdown.add(slot, registerShutdownInProgress, hook);
1898 }
1899 public int getStackTraceDepth(Throwable t) {
1900 return t.getStackTraceDepth();
1901 }
1902 public StackTraceElement getStackTraceElement(Throwable t, int i) {
1903 return t.getStackTraceElement(i);
1904 }
1905 public String newStringUnsafe(char[] chars) {
1906 return new String(chars, true);
1907 }
1908 public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) {
1909 return new Thread(target, acc);
1910 }
1911 public void invokeFinalize(Object o) throws Throwable {
1912 o.finalize();
1913 }
1914 public void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) {
1915 Long.formatUnsignedLong(val, shift, buf, offset, len);
1916 }
1917 public void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) {
1918 Integer.formatUnsignedInt(val, shift, buf, offset, len);
1919 }
1920 });
1921 }
1922 }
|