| Method from java.lang.System Detail: |
public static void arraycopy(Object src,
int srcPos,
Object dest,
int destPos,
int length) {
VMMemoryManager.arrayCopy(src, srcPos, dest, destPos, length);
}
|
public static String clearProperty(String key) {
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPermission(new PropertyPermission(key, "write"));
} else if (key.length() == 0) {
throw new IllegalArgumentException("key is empty");
}
Properties props = getPropertiesUnsecure();
return (String)props.remove(key);
}
|
public static long currentTimeMillis() {
return VMExecutionEngine.currentTimeMillis();
}
|
static void execShutdownSequence() {
Runtime.getRuntime().execShutdownSequence();
}
Initiaies the VM shutdown sequence. |
public static void exit(int status) {
Runtime.getRuntime().exit(status);
}
|
public static void gc() {
Runtime.getRuntime().gc();
}
|
public static Properties getProperties() {
if (securityManager != null) {
securityManager.checkPropertiesAccess();
}
return getPropertiesUnsecure();
}
|
public static String getProperty(String key) {
return getProperty(key, null);
}
|
public static String getProperty(String key,
String def) {
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPropertyAccess(key);
} else if (key.length() == 0) {
throw new IllegalArgumentException("key is empty");
}
Properties props = getPropertiesUnsecure();
return props.getProperty(key, def);
}
|
static String getPropertyUnsecure(String key) {
return getPropertiesUnsecure().getProperty(key);
}
|
public static SecurityManager getSecurityManager() {
return securityManager;
}
|
public static Map<String, String> getenv() {
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPermission(RuntimePermissionCollection.GETENV_PERMISSION);
}
return Environment.getenv();
}
|
public static String getenv(String name) {
if (name == null) {
throw new NullPointerException("name should not be null");
}
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPermission(new RuntimePermission("getenv." + name));
}
return Environment.getenv(name);
}
|
public static int identityHashCode(Object object) {
// if (VMHelper.isVMMagicPackageSupported()) {
// return GCHelper.get_hashcode(object);
// } else {
// return VMMemoryManager.getIdentityHashCode(object);
// }
return VMMemoryManager.getIdentityHashCode(object);
}
|
public static Channel inheritedChannel() throws IOException {
//XXX:does it mean the permission of the "access to the channel"?
//If YES then this checkPermission must be removed because it should be presented into java.nio.channels.spi.SelectorProvider.inheritedChannel()
//If NO then some other permission name (which one?) should be used here
//and the corresponding constant should be placed within org.apache.harmony.lang.RuntimePermission class:
if (securityManager != null) {
securityManager.checkPermission(new RuntimePermission("inheritedChannel")); //see java.nio.channels.spi.SelectorProvider.inheritedChannel() spec
}
return SelectorProvider.provider().inheritedChannel();
}
|
public static void load(String filename) {
Runtime.getRuntime().load0(
filename,
VMClassRegistry.getClassLoader(VMStack.getCallerClass(0)),
true);
}
|
public static void loadLibrary(String libname) {
Runtime.getRuntime().loadLibrary0(
libname,
VMClassRegistry.getClassLoader(VMStack.getCallerClass(0)),
true);
}
|
public static String mapLibraryName(String libname) {
if (libname == null) {
throw new NullPointerException("libname should not be empty");
}
return VMExecutionEngine.mapLibraryName(libname);
}
|
public static long nanoTime() {
return VMExecutionEngine.nanoTime();
}
|
static native void rethrow(Throwable tr)
Helps to throw an arbitrary throwable without mentioning within
throw clause and so bypass
exception checking by a compiler. |
public static void runFinalization() {
Runtime.getRuntime().runFinalization();
}
|
public static void runFinalizersOnExit(boolean value) {
Runtime.runFinalizersOnExit(value);
} Deprecated!
|
public static void setErr(PrintStream err) {
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPermission(RuntimePermissionCollection.SET_IO_PERMISSION);
}
setErrUnsecure(err);
}
|
public static void setIn(InputStream in) {
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPermission(RuntimePermissionCollection.SET_IO_PERMISSION);
}
setInUnsecure(in);
}
|
public static void setOut(PrintStream out) {
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPermission(RuntimePermissionCollection.SET_IO_PERMISSION);
}
setOutUnsecure(out);
}
|
public static void setProperties(Properties props) {
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPropertiesAccess();
}
systemProperties = props;
}
|
public static String setProperty(String key,
String value) {
if (key.length() == 0) {
throw new IllegalArgumentException("key is empty");
}
SecurityManager sm = securityManager;
if (sm != null) {
sm.checkPermission(new PropertyPermission(key, "write"));
}
Properties props = getPropertiesUnsecure();
return (String)props.setProperty(key, value);
}
|
public static synchronized void setSecurityManager(SecurityManager sm) {
if (securityManager != null) {
securityManager
.checkPermission(RuntimePermissionCollection.SET_SECURITY_MANAGER_PERMISSION);
}
if (sm != null) {
// before the new manager assumed office, make a pass through
// the common operations and let it load needed classes (if any),
// to avoid infinite recursion later on
try {
sm.checkPermission(new SecurityPermission("getProperty.package.access"));
} catch (Exception ignore) {}
try {
sm.checkPackageAccess("java.lang");
} catch (Exception ignore) {}
}
securityManager = sm;
}
|