Commit f4758678 by Michael Koch Committed by Michael Koch

2003-10-08 Michael Koch <konqueror@gmx.de>

	* java/util/prefs/Preferences.java
	(defaultFactoryClass): Fixed class name.
	(getFactory): Create instance of class returned by Class.forName(),
	reformated code.

From-SVN: r72229
parent e55f4a34
2003-10-08 Michael Koch <konqueror@gmx.de>
* java/util/prefs/Preferences.java
(defaultFactoryClass): Fixed class name.
(getFactory): Create instance of class returned by Class.forName(),
reformated code.
2003-10-08 Arnaud Vandyck <arnaud.vandyck@ulg.ac.be>
* javax/swing/table/AbstractTableModel.java
......
......@@ -92,11 +92,11 @@ public abstract class Preferences {
* Default PreferencesFactory class used when the system property
* "java.util.prefs.PreferencesFactory" is not set.
* <p>
* XXX - Currently set to MemoryBasedPreferencesFactory, should be changed
* XXX - Currently set to MemoryBasedFactory, should be changed
* when FileBasedPreferences backend works.
*/
private static final String defaultFactoryClass
= "gnu.java.util.prefs.MemoryBasedPreferencesFactory";
= "gnu.java.util.prefs.MemoryBasedFactory";
/** Permission needed to access system or user root. */
private static final Permission prefsPermission
......@@ -210,18 +210,23 @@ public abstract class Preferences {
});
// Still no factory? Use our default.
if (factory == null) {
try {
Object o = Class.forName(defaultFactoryClass);
factory = (PreferencesFactory) o;
} catch (ClassNotFoundException cnfe) {
throw new RuntimeException("Couldn't load default factory"
if (factory == null)
{
try
{
Class cls = Class.forName (defaultFactoryClass);
factory = (PreferencesFactory) cls.newInstance();
}
catch (Exception e)
{
throw new RuntimeException ("Couldn't load default factory"
+ " '"+ defaultFactoryClass +"'");
// XXX - when using 1.4 compatible throwables add cause
}
}
}
}
}
return factory;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment