| 22 | import java.util.Properties; |
| 23 | |
| 24 | public abstract class System { |
| 25 | private static final long NanoTimeBaseInMillis = currentTimeMillis(); |
| 26 | |
| 27 | private static class Static { |
| 28 | public static Properties properties = makeProperties(); |
| 29 | } |
| 30 | |
| 31 | private static Map<String, String> environment; |
| 32 | |
| 33 | private static SecurityManager securityManager; |
| 34 | // static { |
| 35 | // loadLibrary("natives"); |
| 36 | // } |
| 37 | |
| 38 | public static final PrintStream out = new PrintStream |
| 39 | (new BufferedOutputStream(new FileOutputStream(FileDescriptor.out)), true); |
| 40 | |
| 41 | public static final PrintStream err = new PrintStream |
| 42 | (new BufferedOutputStream(new FileOutputStream(FileDescriptor.err)), true); |
| 43 | |
| 44 | public static final InputStream in |
| 45 | = new BufferedInputStream(new FileInputStream(FileDescriptor.in)); |
| 46 | |
| 47 | public static native void arraycopy(Object src, int srcOffset, Object dst, |
| 48 | int dstOffset, int length); |
| 49 | |
| 50 | public static String getProperty(String name) { |
| 51 | return (String) Static.properties.get(name); |
| 52 | } |
| 53 | |
| 54 | public static String getProperty(String name, String defaultValue) { |
| 55 | String result = getProperty(name); |
| 56 | if (result==null) { |
| 57 | return defaultValue; |
| 58 | } |
| 59 | return result; |
| 60 | } |
| 61 | |
| 62 | public static String setProperty(String name, String value) { |
| 63 | return (String) Static.properties.put(name, value); |
| 64 | } |
| 65 | |
| 66 | public static Properties getProperties() { |
| 67 | return Static.properties; |
| 68 | } |
| 69 | |
| 70 | private static Properties makeProperties() { |
| 71 | Properties properties = new Properties(); |
| 72 | |
| 73 | for (String p: getNativeProperties()) { |
| 74 | if (p == null) break; |
| 75 | int index = p.indexOf('='); |
| 76 | properties.put(p.substring(0, index), p.substring(index + 1)); |
| 77 | } |
| 78 | |
| 79 | for (String p: getVMProperties()) { |
| 80 | if (p == null) break; |
| 81 | int index = p.indexOf('='); |
nothing calls this directly
no test coverage detected