src/share/classes/sun/misc/VM.java

Print this page




 201     // behaviour.
 202     //
 203     private static boolean defaultAllowArraySyntax = false;
 204     private static boolean allowArraySyntax = defaultAllowArraySyntax;
 205 
 206     // The allowArraySyntax boolean is initialized during system initialization
 207     // in the saveAndRemoveProperties method.
 208     //
 209     // It is initialized based on the value of the system property
 210     // "sun.lang.ClassLoader.allowArraySyntax".  If the system property is not
 211     // provided, the default for 1.5 is "true".  In 1.6, the default will be
 212     // "false".  If the system property is provided, then the value of
 213     // allowArraySyntax will be equal to "true" if Boolean.parseBoolean()
 214     // returns "true".   Otherwise, the field will be set to "false".
 215     //
 216     public static boolean allowArraySyntax() {
 217         return allowArraySyntax;
 218     }
 219 
 220     /**








 221      * Returns the system property of the specified key saved at
 222      * system initialization time.  This method should only be used
 223      * for the system properties that are not changed during runtime.
 224      * It accesses a private copy of the system properties so
 225      * that user's locking of the system properties object will not
 226      * cause the library to deadlock.
 227      *
 228      * Note that the saved system properties do not include
 229      * the ones set by sun.misc.Version.init().
 230      *
 231      */
 232     public static String getSavedProperty(String key) {
 233         if (savedProps.isEmpty())
 234             throw new IllegalStateException("Should be non-empty if initialized");
 235 
 236         return savedProps.getProperty(key);
 237     }
 238 
 239     // TODO: the Property Management needs to be refactored and
 240     // the appropriate prop keys need to be accessible to the




 201     // behaviour.
 202     //
 203     private static boolean defaultAllowArraySyntax = false;
 204     private static boolean allowArraySyntax = defaultAllowArraySyntax;
 205 
 206     // The allowArraySyntax boolean is initialized during system initialization
 207     // in the saveAndRemoveProperties method.
 208     //
 209     // It is initialized based on the value of the system property
 210     // "sun.lang.ClassLoader.allowArraySyntax".  If the system property is not
 211     // provided, the default for 1.5 is "true".  In 1.6, the default will be
 212     // "false".  If the system property is provided, then the value of
 213     // allowArraySyntax will be equal to "true" if Boolean.parseBoolean()
 214     // returns "true".   Otherwise, the field will be set to "false".
 215     //
 216     public static boolean allowArraySyntax() {
 217         return allowArraySyntax;
 218     }
 219 
 220     /**
 221      * Returns true if the given class loader is in the system domain
 222      * in which all permissions are granted.
 223      */
 224     public static boolean isSystemDomainLoader(ClassLoader loader) {
 225         return loader == null;
 226     }
 227 
 228     /**
 229      * Returns the system property of the specified key saved at
 230      * system initialization time.  This method should only be used
 231      * for the system properties that are not changed during runtime.
 232      * It accesses a private copy of the system properties so
 233      * that user's locking of the system properties object will not
 234      * cause the library to deadlock.
 235      *
 236      * Note that the saved system properties do not include
 237      * the ones set by sun.misc.Version.init().
 238      *
 239      */
 240     public static String getSavedProperty(String key) {
 241         if (savedProps.isEmpty())
 242             throw new IllegalStateException("Should be non-empty if initialized");
 243 
 244         return savedProps.getProperty(key);
 245     }
 246 
 247     // TODO: the Property Management needs to be refactored and
 248     // the appropriate prop keys need to be accessible to the