/[classpath]/classpath/java/util/prefs/Preferences.java
ViewVC logotype

Diff of /classpath/java/util/prefs/Preferences.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by mkoch, Wed Jun 18 09:42:57 2003 UTC revision 1.5 by mkoch, Thu Oct 2 19:49:42 2003 UTC
# Line 92  public abstract class Preferences { Line 92  public abstract class Preferences {
92       * Default PreferencesFactory class used when the system property       * Default PreferencesFactory class used when the system property
93       * "java.util.prefs.PreferencesFactory" is not set.       * "java.util.prefs.PreferencesFactory" is not set.
94           * <p>           * <p>
95           * XXX - Currently set to MemoryBasedPreferencesFactory, should be changed           * XXX - Currently set to MemoryBasedFactory, should be changed
96           * when FileBasedPreferences backend works.           * when FileBasedPreferences backend works.
97       */       */
98      private static final String defaultFactoryClass      private static final String defaultFactoryClass
99          = "gnu.java.util.prefs.MemoryBasedPreferencesFactory";          = "gnu.java.util.prefs.MemoryBasedFactory";
100    
101      /** Permission needed to access system or user root. */      /** Permission needed to access system or user root. */
102      private static final Permission prefsPermission      private static final Permission prefsPermission
# Line 210  public abstract class Preferences { Line 210  public abstract class Preferences {
210                          });                          });
211    
212              // Still no factory? Use our default.              // Still no factory? Use our default.
213              if (factory == null) {              if (factory == null)
214                  try {                {
215                      Object o = Class.forName(defaultFactoryClass);                  try
216                      factory = (PreferencesFactory) o;                    {
217                  } catch (ClassNotFoundException cnfe) {                      Object o = Class.forName (defaultFactoryClass);
218                      throw new RuntimeException("Couldn't load default factory"                      factory = (PreferencesFactory) o.newInstance();
219                      }
220                    catch (Exception e)
221                      {
222                        throw new RuntimeException ("Couldn't load default factory"
223                          + " '"+ defaultFactoryClass +"'");                          + " '"+ defaultFactoryClass +"'");
224                      // XXX - when using 1.4 compatible throwables add cause                      // XXX - when using 1.4 compatible throwables add cause
225                  }                    }
226              }                }
227    
228          }          }
229            
230          return factory;          return factory;
231      }      }
232    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26