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/ProfileStore.java
private final static String XML_ATTRIBUTE_VERSION= "version"; 
	private final static String XML_ATTRIBUTE_ID= "id"; 
	private final static String XML_ATTRIBUTE_NAME= "name"; 
	private final static String XML_ATTRIBUTE_VALUE= "value"; 
		
	private ProfileStore() {
	}
	
	/**
	 * @return Returns the collection of profiles currently stored in the preference store or
	 * <code>null</code> if the loading failed. The elements are of type {@link CustomProfile}
	 * and are all updated to the latest version.
	 * @throws CoreException
	 */
	public static List readProfiles() throws CoreException {
		List res= readProfilesFromPreferences(PREF_FORMATTER_PROFILES);
		if (res == null) {
			return readOldForCompatibility();
		}
		return res;
	}
	
	public static void writeProfiles(Collection profiles) throws CoreException {
		ByteArrayOutputStream stream= new ByteArrayOutputStream(2000);
		try {
			writeProfilesToStream(profiles, stream);
			String val;
			try {
				val= stream.toString("UTF-8"); 
			} catch (UnsupportedEncodingException e) {