/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Internal class that manages sun.awt.Debug settings.
* Settings can be specified on a global, per-package,
* or per-class level.
*
* Properties affecting the behaviour of the Debug class are
* loaded from the awtdebug.properties file at class load
* time. The properties file is assumed to be in the
* user.home directory. A different file can be used
* by setting the awtdebug.properties system property.
* e.g. java -Dawtdebug.properties=foo.properties
*
* Only properties beginning with 'awtdebug' have any
* meaning-- all other properties are ignored.
*
* You can override the properties file by specifying
* 'awtdebug' props as system properties on the command line.
* e.g. java -Dawtdebug.trace=true
* Properties specific to a package or a class can be set
* by qualifying the property names as follows:
* awtdebug.<property name>.<class or package name>
* So for example, turning on tracing in the com.acme.Fubar
* class would be done as follows:
* awtdebug.trace.com.acme.Fubar=true
*
* Class settings always override package settings, which in
* turn override global settings.
*
* Addition from July, 2007.
*
* After the fix for 4638447 all the usage of DebugHelper
* classes in Java code are replaced with the corresponding
* Java Logging API calls. This file is now used only to
* control native logging.
*
* To enable native logging you should set the following
* system property to 'true': sun.awt.nativedebug. After
* the native logging is enabled, the actual debug settings
* are read the same way as described above (as before
* the fix for 4638447).
*/
final class DebugSettings {
/* standard debug property key names */
/* default property settings */
"awtdebug.assert=true",
"awtdebug.trace=false",
"awtdebug.on=true",
"awtdebug.ctrace=false"
};
/* global instance of the settings object */
static void init() {
return;
}
instance = new DebugSettings();
}
private DebugSettings() {
return null;
}
}.run();
}
/*
* Load debug properties from file, then override
* with any command line specified properties
*/
private synchronized void loadProperties() {
// setup initial properties
{
return null;
}
});
// echo the initial property settings to stdout
}
}
while (enum_.hasMoreElements()) {
}
}
/*
* Sets up default property values
*/
private void loadDefaultProperties() {
// is there a more inefficient way to setup default properties?
// maybe, but this has got to be close to 100% non-optimal
try {
}
} catch(IOException ioe) {
}
}
/*
* load properties from file, overriding defaults
*/
private void loadFileProperties() {
// check if the user specified a particular settings file
// otherwise get it from the user's home directory
}
try {
} catch ( FileNotFoundException fne ) {
println("Did not find settings file.");
} catch ( IOException ioe ) {
}
}
/*
* load properties from system props (command line spec'd usually),
* overriding default or file properties
*/
private void loadSystemProperties() {
// override file properties with system properties
while ( enum_.hasMoreElements() ) {
// copy any "awtdebug" properties over
}
}
}
/**
* Gets named boolean property
* @param key Name of property
* @param defval Default value if property does not exist
* @return boolean value of the named property
*/
}
/**
* Gets named integer property
* @param key Name of property
* @param defval Default value if property does not exist
* @return integer value of the named property
*/
}
/**
* Gets named String property
* @param key Name of property
* @param defval Default value if property does not exist
* @return string value of the named property
*/
//println(actualKeyName+"="+value);
return value;
}
// remove global prefix from property names
while ( enum_.hasMoreElements() ) {
}
}
}
}
private void loadNativeSettings() {
boolean ctracingOn;
//
//
while ( enum_.hasMoreElements() ) {
}
}
// sort traces list so file-level traces will be before line-level ones
//
// Setup the trace points
//
while ( enumTraces.hasMoreElements() ) {
boolean enabled;
// parse out the filename and linenumber from the property name
//System.out.println("Key="+key+", File="+filespec+", Line="+linespec+", Enabled="+enabled);
// set file specific trace setting
} else {
// set line specific trace setting
}
}
}
}