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
flushPreferences(corePrefs);
		}
	}
	
	private void flushPreferences(final IEclipsePreferences prefs) {
		try {
			PlatformUI.getWorkbench().getProgressService().run(true, true, new IRunnableWithProgress() {
				public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
					try {
						prefs.flush();
					} catch (BackingStoreException e) {
						throw new InvocationTargetException(e);
					}
				}
			});
		} catch (InvocationTargetException e) {
			JavaPlugin.log(e);
		} catch (InterruptedException e) {
		}
	}
	
	
	/**
	 * Add all the built-in profiles to the map and to the list.
	 * @param profiles The map to add the profiles to
	 * @param profilesByName List of profiles by
	 */
	private void addBuiltinProfiles(Map profiles, List profilesByName) {
		final Profile javaProfile= new BuiltInProfile(JAVA_PROFILE, FormatterMessages.ProfileManager_java_conventions_profile_name, getJavaSettings(), 1); 
		profiles.put(javaProfile.getID(), javaProfile);