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
/**
	 * Activate the selected profile, update all necessary options in
	 * preferences and save profiles to disk.
	 */
	public void commitChanges(IScopeContext scopeContext) {
		if (fSelected != null) {
			writeToPreferenceStore(fSelected, scopeContext);
		}
	}
	
	public void clearAllSettings(IScopeContext context) {
		final IEclipsePreferences corePrefs= context.getNode(JavaCore.PLUGIN_ID);
		boolean hasCoreChanges= updatePreferences(corePrefs, fCoreKeys, Collections.EMPTY_MAP);
		
		final IEclipsePreferences uiPrefs= context.getNode(JavaUI.ID_PLUGIN);
		boolean hasUIChanges= updatePreferences(uiPrefs, fUIKeys, Collections.EMPTY_MAP);
		
		if (hasUIChanges) {
			flushPreferences(uiPrefs);
		}
		if (hasCoreChanges) {
			flushPreferences(corePrefs);
		}
		
		if (context.getName() == ProjectScope.SCOPE) {
			setProjectProfileNameProperty(context, null);
		}
	}
	private void setProjectProfileNameProperty(IScopeContext context, String id) {
		String projectName= context.getNode(JavaUI.ID_PLUGIN).parent().name();