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.StringTokenizer; 34 import java.util.Map; 35 import java.security.AccessController; 36 import java.security.PrivilegedAction; 37 import java.security.AllPermission; 38 import java.nio.channels.Channel; 39 import java.nio.channels.spi.SelectorProvider; 40 import sun.nio.ch.Interruptible; 41 import sun.reflect.CallerSensitive; 42 import sun.reflect.Reflection; 43 import sun.security.util.SecurityConstants; 44 import sun.reflect.annotation.AnnotationType; 45 import jdk.internal.HotSpotIntrinsicCandidate; 46 import jdk.internal.misc.JavaLangAccess;; 47 import jdk.internal.misc.SharedSecrets;; 48 49 /** 50 * The <code>System</code> class contains several useful class fields 51 * and methods. It cannot be instantiated. 52 * 53 * <p>Among the facilities provided by the <code>System</code> class 54 * are standard input, standard output, and error output streams; 55 * access to externally defined properties and environment 56 * variables; a means of loading files and libraries; and a utility 57 * method for quickly copying a portion of an array. 1233 } 1234 public byte[] getRawClassAnnotations(Class<?> klass) { 1235 return klass.getRawAnnotations(); 1236 } 1237 public byte[] getRawClassTypeAnnotations(Class<?> klass) { 1238 return klass.getRawTypeAnnotations(); 1239 } 1240 public byte[] getRawExecutableTypeAnnotations(Executable executable) { 1241 return Class.getExecutableTypeAnnotationBytes(executable); 1242 } 1243 public <E extends Enum<E>> 1244 E[] getEnumConstantsShared(Class<E> klass) { 1245 return klass.getEnumConstantsShared(); 1246 } 1247 public void blockedOn(Thread t, Interruptible b) { 1248 t.blockedOn(b); 1249 } 1250 public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) { 1251 Shutdown.add(slot, registerShutdownInProgress, hook); 1252 } 1253 public int getStackTraceDepth(Throwable t) { 1254 return t.getStackTraceDepth(); 1255 } 1256 public StackTraceElement getStackTraceElement(Throwable t, int i) { 1257 return t.getStackTraceElement(i); 1258 } 1259 public String newStringUnsafe(char[] chars) { 1260 return new String(chars, true); 1261 } 1262 public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) { 1263 return new Thread(target, acc); 1264 } 1265 public void invokeFinalize(Object o) throws Throwable { 1266 o.finalize(); 1267 } 1268 public void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) { 1269 Long.formatUnsignedLong(val, shift, buf, offset, len); 1270 } 1271 public void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) { 1272 Integer.formatUnsignedInt(val, shift, buf, offset, len); 1273 } 1274 }); 1275 } 1276 } | 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.StringTokenizer; 36 import java.util.Map; 37 import java.nio.channels.Channel; 38 import java.nio.channels.spi.SelectorProvider; 39 import sun.nio.ch.Interruptible; 40 import sun.reflect.CallerSensitive; 41 import sun.reflect.Reflection; 42 import sun.security.util.SecurityConstants; 43 import sun.reflect.annotation.AnnotationType; 44 import jdk.internal.HotSpotIntrinsicCandidate; 45 import jdk.internal.misc.JavaLangAccess;; 46 import jdk.internal.misc.SharedSecrets;; 47 48 /** 49 * The <code>System</code> class contains several useful class fields 50 * and methods. It cannot be instantiated. 51 * 52 * <p>Among the facilities provided by the <code>System</code> class 53 * are standard input, standard output, and error output streams; 54 * access to externally defined properties and environment 55 * variables; a means of loading files and libraries; and a utility 56 * method for quickly copying a portion of an array. 1232 } 1233 public byte[] getRawClassAnnotations(Class<?> klass) { 1234 return klass.getRawAnnotations(); 1235 } 1236 public byte[] getRawClassTypeAnnotations(Class<?> klass) { 1237 return klass.getRawTypeAnnotations(); 1238 } 1239 public byte[] getRawExecutableTypeAnnotations(Executable executable) { 1240 return Class.getExecutableTypeAnnotationBytes(executable); 1241 } 1242 public <E extends Enum<E>> 1243 E[] getEnumConstantsShared(Class<E> klass) { 1244 return klass.getEnumConstantsShared(); 1245 } 1246 public void blockedOn(Thread t, Interruptible b) { 1247 t.blockedOn(b); 1248 } 1249 public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) { 1250 Shutdown.add(slot, registerShutdownInProgress, hook); 1251 } 1252 public String newStringUnsafe(char[] chars) { 1253 return new String(chars, true); 1254 } 1255 public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) { 1256 return new Thread(target, acc); 1257 } 1258 public void invokeFinalize(Object o) throws Throwable { 1259 o.finalize(); 1260 } 1261 public void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) { 1262 Long.formatUnsignedLong(val, shift, buf, offset, len); 1263 } 1264 public void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) { 1265 Integer.formatUnsignedInt(val, shift, buf, offset, len); 1266 } 1267 }); 1268 } 1269 } |