mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-07 19:43:43 +08:00
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
This commit is contained in:
parent
e55f4a3413
commit
f475867806
@ -1,3 +1,10 @@
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user