Bug 310665 [Browser] 'Web Browser' preference page ignores cancellation
I20100426-0852 1. Window > Preferences > General > Web Browser 2. In Windows XP, I see "Default system web browser", "Firefox", and "Internet Explorer". 3. Select IE. Click the 'Remove' button. 4. Click 'Cancel'. 5. Redo step 1. 6. Window > Preferences 7. IE is gone. :(
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserManager.java
if (currentBrowser == null && browsers.size() > 0)
			currentBrowser = (IBrowserDescriptor) browsers.get(0);
		setChanged();
		notifyObservers();
	}
	protected void saveBrowsers() {
		try {
			ignorePreferenceChanges = true;
			XMLMemento memento = XMLMemento.createWriteRoot("web-browsers"); 
			Iterator iterator = browsers.iterator();
			while (iterator.hasNext()) {
				Object obj = iterator.next();
				if (obj instanceof BrowserDescriptor) {
					BrowserDescriptor browser = (BrowserDescriptor) obj;
					IMemento child = memento.createChild("external"); 
					browser.save(child);
				} else if (obj instanceof SystemBrowserDescriptor) {
					memento.createChild("system"); 
				}
			}
			
			memento.putInteger("current", browsers.indexOf(currentBrowser)); 
			StringWriter writer = new StringWriter();
			memento.save(writer);
			String xmlString = writer.getBuffer().toString();
			InstanceScope instanceScope = new InstanceScope();
		    IEclipsePreferences prefs = instanceScope.getNode(WebBrowserUIPlugin.PLUGIN_ID);
			prefs.put("browsers", xmlString); 
			prefs.flush();