(Properties props)
| 269 | // |
| 270 | // This method can only be invoked during system initialization. |
| 271 | public static void saveAndRemoveProperties(Properties props) { |
| 272 | if(org.opensourcephysics.js.JSUtil.isJS)return; |
| 273 | if (booted) |
| 274 | throw new IllegalStateException("System initialization has completed"); |
| 275 | |
| 276 | savedProps.putAll(props); |
| 277 | |
| 278 | // Set the maximum amount of direct memory. This value is controlled |
| 279 | // by the vm option -XX:MaxDirectMemorySize=<size>. |
| 280 | // The maximum amount of allocatable direct buffer memory (in bytes) |
| 281 | // from the system property sun.nio.MaxDirectMemorySize set by the VM. |
| 282 | // The system property will be removed. |
| 283 | String s = (String)props.remove("sun.nio.MaxDirectMemorySize"); |
| 284 | if (s != null) { |
| 285 | if (s.equals("-1")) { |
| 286 | // -XX:MaxDirectMemorySize not given, take default |
| 287 | directMemory = Runtime.getRuntime().maxMemory(); |
| 288 | } else { |
| 289 | long l = Long.parseLong(s); |
| 290 | if (l > -1) |
| 291 | directMemory = l; |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | // Check if direct buffers should be page aligned |
| 296 | s = (String)props.remove("sun.nio.PageAlignDirectMemory"); |
| 297 | if ("true".equals(s)) |
| 298 | pageAlignDirectMemory = true; |
| 299 | |
| 300 | // Set a boolean to determine whether ClassLoader.loadClass accepts |
| 301 | // array syntax. This value is controlled by the system property |
| 302 | // "sun.lang.ClassLoader.allowArraySyntax". |
| 303 | s = props.getProperty("sun.lang.ClassLoader.allowArraySyntax"); |
| 304 | allowArraySyntax = (s == null |
| 305 | ? defaultAllowArraySyntax |
| 306 | : Boolean.parseBoolean(s)); |
| 307 | |
| 308 | // Remove other private system properties |
| 309 | // used by java.lang.Integer.IntegerCache |
| 310 | props.remove("java.lang.Integer.IntegerCache.high"); |
| 311 | |
| 312 | // used by java.util.zip.ZipFile |
| 313 | props.remove("sun.zip.disableMemoryMapping"); |
| 314 | |
| 315 | // used by sun.launcher.LauncherHelper |
| 316 | props.remove("sun.java.launcher.diag"); |
| 317 | |
| 318 | // used by sun.misc.URLClassPath |
| 319 | props.remove("sun.cds.enableSharedLookupCache"); |
| 320 | } |
| 321 | |
| 322 | // Initialize any miscellenous operating system settings that need to be |
| 323 | // set for the class libraries. |
nothing calls this directly
no test coverage detected