This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 188161 - NbPreferences uses Preferences' importPreferences() method
Summary: NbPreferences uses Preferences' importPreferences() method
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Options&Settings (show other bugs)
Version: 6.x
Hardware: Sun SunOS
: P3 normal with 2 votes (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 15:48 UTC by jnk
Modified: 2011-11-04 11:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jnk 2010-06-28 15:48:07 UTC
NbPreferences provides an implementation of Preferences which adds the flexibility to use userDir passed by a command line option for example. Preferences class only uses either the user's home directory (e.g. /home/<user>/.java/.userPrefs) to store the preferences, or system's directory (e.g. /etc/.java/.systemPrefs) to store system preferences.
However, NbPreferences has not an equivalent importPreferences() method, hence it inherits Preferences' importPreferences() method, which unfortunately calls XmlSupport.importPreferences(), which ignores userDir and uses the standard userPrefs (Preferences.userRoot) or systemPrefs (Preferences.systemRoot) instead. 

This results in a FileNotFoundException if you use NbPreferences to store the Preferences in userDir, because Preferences.importPreferences() ignores looking to userDir.