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
val= stream.toString(); 
			}
			IPreferenceStore preferenceStore= PreferenceConstants.getPreferenceStore();
			preferenceStore.setValue(PREF_FORMATTER_PROFILES, val);
			preferenceStore.setValue(PREF_FORMATTER_PROFILES_VERSION, ProfileVersioner.CURRENT_VERSION);
			JavaPlugin.getDefault().savePluginPreferences();
		} finally {
			try { stream.close(); } catch (IOException e) {  }
		}
	}
	
	private static List readProfilesFromPreferences(String key) throws CoreException {
		String string= PreferenceConstants.getPreferenceStore().getString(key);
		if (string != null && string.length() > 0) {
			byte[] bytes;
			try {
				bytes= string.getBytes("UTF-8"); 
			} catch (UnsupportedEncodingException e) {
				bytes= string.getBytes();
			}
			InputStream is= new ByteArrayInputStream(bytes);
			try {
				List res= readProfilesFromStream(new InputSource(is));
				if (res != null) {
					for (int i= 0; i < res.size(); i++) {
						ProfileVersioner.updateAndComplete((CustomProfile) res.get(i));
					}
				}
				return res;
			} finally {