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 46 /** 47 * The <code>System</code> class contains several useful class fields 48 * and methods. It cannot be instantiated. 49 * 50 * <p>Among the facilities provided by the <code>System</code> class 51 * are standard input, standard output, and error output streams; 52 * access to externally defined properties and environment 53 * variables; a means of loading files and libraries; and a utility 54 * method for quickly copying a portion of an array. 55 * 56 * @author unascribed 57 * @since 1.0 58 */ 59 public final class System { 1222 return klass.casAnnotationType(oldType, newType); 1223 } 1224 public AnnotationType getAnnotationType(Class<?> klass) { 1225 return klass.getAnnotationType(); 1226 } 1227 public Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass) { 1228 return klass.getDeclaredAnnotationMap(); 1229 } 1230 public byte[] getRawClassAnnotations(Class<?> klass) { 1231 return klass.getRawAnnotations(); 1232 } 1233 public byte[] getRawClassTypeAnnotations(Class<?> klass) { 1234 return klass.getRawTypeAnnotations(); 1235 } 1236 public byte[] getRawExecutableTypeAnnotations(Executable executable) { 1237 return Class.getExecutableTypeAnnotationBytes(executable); 1238 } 1239 public <E extends Enum<E>> 1240 E[] getEnumConstantsShared(Class<E> klass) { 1241 return klass.getEnumConstantsShared(); 1242 } 1243 public void blockedOn(Thread t, Interruptible b) { 1244 t.blockedOn(b); 1245 } 1246 public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) { 1247 Shutdown.add(slot, registerShutdownInProgress, hook); 1248 } 1249 public int getStackTraceDepth(Throwable t) { 1250 return t.getStackTraceDepth(); 1251 } 1252 public StackTraceElement getStackTraceElement(Throwable t, int i) { 1253 return t.getStackTraceElement(i); 1254 } 1255 public String newStringUnsafe(char[] chars) { 1256 return new String(chars, true); 1257 } 1258 public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) { 1259 return new Thread(target, acc); 1260 } 1261 public void invokeFinalize(Object o) throws Throwable { | 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.function.Function; 39 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 46 /** 47 * The <code>System</code> class contains several useful class fields 48 * and methods. It cannot be instantiated. 49 * 50 * <p>Among the facilities provided by the <code>System</code> class 51 * are standard input, standard output, and error output streams; 52 * access to externally defined properties and environment 53 * variables; a means of loading files and libraries; and a utility 54 * method for quickly copying a portion of an array. 55 * 56 * @author unascribed 57 * @since 1.0 58 */ 59 public final class System { 1222 return klass.casAnnotationType(oldType, newType); 1223 } 1224 public AnnotationType getAnnotationType(Class<?> klass) { 1225 return klass.getAnnotationType(); 1226 } 1227 public Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass) { 1228 return klass.getDeclaredAnnotationMap(); 1229 } 1230 public byte[] getRawClassAnnotations(Class<?> klass) { 1231 return klass.getRawAnnotations(); 1232 } 1233 public byte[] getRawClassTypeAnnotations(Class<?> klass) { 1234 return klass.getRawTypeAnnotations(); 1235 } 1236 public byte[] getRawExecutableTypeAnnotations(Executable executable) { 1237 return Class.getExecutableTypeAnnotationBytes(executable); 1238 } 1239 public <E extends Enum<E>> 1240 E[] getEnumConstantsShared(Class<E> klass) { 1241 return klass.getEnumConstantsShared(); 1242 } 1243 public <D> D getGenericDerivative(Class<?> clazz, Object key, 1244 Function<Class<?>, ? extends D> function) { 1245 return clazz.getGenericDerivative(key, function); 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 { |