Bug 441619 - Extension point to execute initialization code only once
Summary: Extension point to execute initialization code only once
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-12 13:23 EDT by Simon Schäfer CLA
Modified: 2014-08-12 18:28 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Schäfer CLA 2014-08-12 13:23:36 EDT
Eclipse already has the org.eclipse.core.runtime.preferences extension points, which allows to specify initializers that are run every time Eclipse is started.

But sometimes it would be nice to run such an initializer only once and when it succeeded never again. This can be especially useful when plugin authors provide a newer version of their plugin which is in some places incompatible with older configuration related to this plugin. In such cases the plugin authors can provide some code that migrates the old configuration to a newer one and run this code for example with an `AbstractPreferenceInitializer`.

In the case that this migration should happen only once plugin authors manually have to ensure to save a property to the preference store, check its value when the preference initializer is executed and then abort further execution if the code was already one. They also have to ensure, that they do not forget to set the property value after the migration happened successfully.

It would be nice if Eclipse could provide an extension to an `AbstractPreferenceInitializer` (or to the org.eclipse.core.runtime.preferences extension point in general) that already provides the option to run initialization code only once.