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
final Iterator keyIter= ProfileManager.getKeys().iterator();
		
		while (keyIter.hasNext()) {
			final String key= (String)keyIter.next();
			final String value= (String)profile.getSettings().get(key);
			if (value != null) {
				final Element setting= document.createElement(XML_NODE_SETTING);
				setting.setAttribute(XML_ATTRIBUTE_ID, key);
				setting.setAttribute(XML_ATTRIBUTE_VALUE, value);
				element.appendChild(setting);
			} else {
				JavaPlugin.logErrorMessage("ProfileStore: Profile does not contain value for key " + key); 
			}
		}
		return element;
	}
	
	public static void checkCurrentOptionsVersion() {
		InstanceScope instanceofScope= new InstanceScope();
		IEclipsePreferences uiPreferences= instanceofScope.getNode(JavaUI.ID_PLUGIN);
		int version= uiPreferences.getInt(PREF_FORMATTER_PROFILES_VERSION, 0);
		if (version >= ProfileVersioner.CURRENT_VERSION) {
			return; 
		}
		try {
			List profiles= ProfileStore.readProfiles();
			if (profiles == null) {
				profiles= Collections.EMPTY_LIST;
			}
			ProfileManager manager= new ProfileManager(profiles, instanceofScope);