Bug 101619 [formatter] Formatter profiles store even though I clicked 'Cancel'
I20050624-0010 1. open the formatter preference page 2. switch from existing profile p1 to another, lets say p2 3. click 'Cancel' Expected: my formatter profile is still p1 but it is now p2.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileManager.java
* Update all formatter settings with the settings of the specified profile. 
	 * @param profile The profile to write to the preference store
	 */
	private void writeToPreferenceStore(Profile profile, IScopeContext context) {
		final Map profileOptions= profile.getSettings();
		
		final IEclipsePreferences corePrefs= context.getNode(JavaCore.PLUGIN_ID);
		boolean hasCoreChanges= updatePreferences(corePrefs, fCoreKeys, profileOptions);
		
		final IEclipsePreferences uiPrefs= context.getNode(JavaUI.ID_PLUGIN);
		boolean hasUIChanges= updatePreferences(uiPrefs, fUIKeys, profileOptions);
		
		if (uiPrefs.getInt(FORMATTER_SETTINGS_VERSION, 0) != ProfileVersioner.CURRENT_VERSION) {
			uiPrefs.putInt(FORMATTER_SETTINGS_VERSION, ProfileVersioner.CURRENT_VERSION);
			hasUIChanges= true;
		}
		
		if (context.getName() == InstanceScope.SCOPE) {
			final String oldProfile= uiPrefs.get(PROFILE_KEY, null);
			if (!profile.getID().equals(oldProfile)) {
				uiPrefs.put(PROFILE_KEY, profile.getID());
				hasUIChanges= true;
			}
		} else if (context.getName() == ProjectScope.SCOPE && !profile.isSharedProfile()) {
			setProjectProfileNameProperty(context, profile.getID());
		}
		if (hasUIChanges) {
			flushPreferences(uiPrefs);
		}
		if (hasCoreChanges) {