Summary: | Problem saving plug-in preferences - plug-in metadata directory is not created | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | svritchie |
Component: | Resources | Assignee: | Debbie Wilson <debbie_wilson> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | critical | ||
Priority: | P1 | CC: | ahranganath, as, atberman, bleroux, carl_mcconnell, eharris, Frank.Cornelissen, glongman, kent_johnson, michael.schwind, paulacox, philippe_mulet, rodrigo, simon.gunzenreiner |
Version: | 2.0 | ||
Target Milestone: | 2.0 F3 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
svritchie
2002-06-01 19:57:31 EDT
Ant Tasks added in preferences are not saved either. This seems to be caused by a missing folder. On a new install the folder org.eclipse.ant.core is not created in eclipse\workspace\.metadata\.plugins\. If this folder is manually created, the Ant preferences can be saved. Also missing is folder org.eclipse.ui.externaltools which prevents the External Tools preferences from being saved. Other folders may also be missing. I'm not sure what has changed but the problem seems to be in Plugin.savePluginPreferences(...). It does not create the the folder. It seems that the whole problem happens because Platform.getPluginStateLocation(...) does not call InternalPlatform.getPluginStateLocation(..., true). Moving to Platform Core. Should fix for 2.0 To confirm that the problem is in Plugin.savePluginPreferences you can try to change values in Preference->Debug it doesn't work. Other preference pages should have the same problem, for instance a plugin of mine also has the same problem. This a very critical problem for a stable build as every plugin relying on preference store is impacted. Just a reminder when fixing this one. When saving the preferences, if an IOException is thrown it is currently ignored. We should be at least logging it to the console. I agree this is a must fix for 2.0. *** Bug 19213 has been marked as a duplicate of this bug. *** Adding following code fragment inside the try block of org.eclipse.core.runtime.Plugin.savePluginPreferences method fixes the problem. // if preference directory doesn't exist, create it File prefDir = prefFile.getParentFile(); if (prefDir != null && !prefDir.exists()) prefDir.mkdir(); The title of this PR should be generalized. Problem was that PlatformMetaArea.getPluginPreferenceLocation was not creating the directories for the plugin state location if they were needed (note that in some cases you don't want to create these directories under .metadata you just want some idea of where the preferences would be if they existed). Changes had to be made in PreferenceExporter and Plugin to indicate to getPluginPreferenceLocation if the directories should or should not be created. Fixed in F3 (or 20020607). *** Bug 19491 has been marked as a duplicate of this bug. *** *** Bug 19582 has been marked as a duplicate of this bug. *** *** Bug 19642 has been marked as a duplicate of this bug. *** *** Bug 19885 has been marked as a duplicate of this bug. *** *** Bug 20056 has been marked as a duplicate of this bug. *** *** Bug 20328 has been marked as a duplicate of this bug. *** |