src/share/classes/sun/awt/DebugSettings.java

Print this page




 112     }
 113 
 114     /*
 115      * Load debug properties from file, then override
 116      * with any command line specified properties
 117      */
 118     private synchronized void loadProperties() {
 119         // setup initial properties
 120         java.security.AccessController.doPrivileged(
 121             new java.security.PrivilegedAction<Void>() {
 122                 public Void run() {
 123                     loadDefaultProperties();
 124                     loadFileProperties();
 125                     loadSystemProperties();
 126                     return null;
 127                 }
 128             });
 129 
 130         // echo the initial property settings to stdout
 131         if (log.isLoggable(PlatformLogger.FINE)) {
 132             log.fine("DebugSettings:\n{0}" + this);
 133         }
 134     }
 135 
 136     public String toString() {
 137         ByteArrayOutputStream bout = new ByteArrayOutputStream();
 138         PrintStream pout = new PrintStream(bout);
 139         for (String key : props.stringPropertyNames()) {
 140             String value = props.getProperty(key, "");
 141             pout.println(key + " = " + value);
 142         }
 143         return new String(bout.toByteArray());
 144     }
 145 
 146     /*
 147      * Sets up default property values
 148      */
 149     private void loadDefaultProperties() {
 150         // is there a more inefficient way to setup default properties?
 151         // maybe, but this has got to be close to 100% non-optimal
 152         try {




 112     }
 113 
 114     /*
 115      * Load debug properties from file, then override
 116      * with any command line specified properties
 117      */
 118     private synchronized void loadProperties() {
 119         // setup initial properties
 120         java.security.AccessController.doPrivileged(
 121             new java.security.PrivilegedAction<Void>() {
 122                 public Void run() {
 123                     loadDefaultProperties();
 124                     loadFileProperties();
 125                     loadSystemProperties();
 126                     return null;
 127                 }
 128             });
 129 
 130         // echo the initial property settings to stdout
 131         if (log.isLoggable(PlatformLogger.FINE)) {
 132             log.fine("DebugSettings:\n{0}", this);
 133         }
 134     }
 135 
 136     public String toString() {
 137         ByteArrayOutputStream bout = new ByteArrayOutputStream();
 138         PrintStream pout = new PrintStream(bout);
 139         for (String key : props.stringPropertyNames()) {
 140             String value = props.getProperty(key, "");
 141             pout.println(key + " = " + value);
 142         }
 143         return new String(bout.toByteArray());
 144     }
 145 
 146     /*
 147      * Sets up default property values
 148      */
 149     private void loadDefaultProperties() {
 150         // is there a more inefficient way to setup default properties?
 151         // maybe, but this has got to be close to 100% non-optimal
 152         try {