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
if (manager.getSelected() instanceof CustomProfile) {
				manager.commitChanges(instanceofScope); 
			}
			uiPreferences.putInt(PREF_FORMATTER_PROFILES_VERSION, ProfileVersioner.CURRENT_VERSION);
			try {
				IJavaProject[] javaProjects= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
				for (int i= 0; i < javaProjects.length; i++) {
					ProjectScope scope= new ProjectScope(javaProjects[i].getProject());
					if (ProfileManager.hasProjectSpecificSettings(scope)) {
						manager= new ProfileManager(profiles, scope);
						manager.commitChanges(scope); 
					}
				}
			} catch (JavaModelException e) {
				JavaPlugin.log(e);
			}
		} catch (CoreException e) {
			JavaPlugin.log(e);
		}
	}
	
		
	/*
	 * Creates a UI exception for logging purposes
	 */
	private static JavaUIException createException(Throwable t, String message) {
		return new JavaUIException(JavaUIStatus.createError(IStatus.ERROR, message, t));
	}
}