modifiedNode.accept(visitor);
internalApply(tree, filters);  lastStringSharing = 0; shareStrings();
	public IStatus applyPreferences(IExportedPreferences preferences) throws CoreException {		// TODO investigate refactoring to merge with new #apply(IEclipsePreferences, IPreferenceFilter[]) APIs		if (preferences == null)			throw new IllegalArgumentException();		if (EclipsePreferences.DEBUG_PREFERENCE_GENERAL)			PrefsMessages.message("Applying exported preferences: " + ((ExportedPreferences) preferences).toDeepDebugString()); //$NON-NLS-1$		final MultiStatus result = new MultiStatus(PrefsMessages.OWNER_NAME, IStatus.OK, PrefsMessages.preferences_applyProblems, null);		IEclipsePreferences modifiedNode = firePreApplyEvent(preferences);		// create a visitor to apply the given set of preferences		IPreferenceNodeVisitor visitor = new IPreferenceNodeVisitor() {			public boolean visit(IEclipsePreferences node) throws BackingStoreException {				IEclipsePreferences globalNode;				if (node.parent() == null)					globalNode = root;				else					globalNode = (IEclipsePreferences) root.node(node.absolutePath());				ExportedPreferences epNode = (ExportedPreferences) node;				// if this node is an export root then we need to remove 				// it from the global preferences before continuing.				boolean removed = false;				if (epNode.isExportRoot()) {					if (EclipsePreferences.DEBUG_PREFERENCE_GENERAL)						PrefsMessages.message("Found export root: " + epNode.absolutePath()); //$NON-NLS-1$					// TODO should only have to do this if any of my children have properties to set					globalNode.removeNode();					removed = true;				}				// iterate over the preferences in this node and set them				// in the global space.				String[] keys = epNode.properties.keys();				if (keys.length > 0) {					// if this node was removed then we need to create a new one					if (removed)						globalNode = (IEclipsePreferences) root.node(node.absolutePath());					for (int i = 0; i < keys.length; i++) {						String key = keys[i];						// intern strings we import because some people						// in their property change listeners use identity						// instead of equals. See bug 20193 and 20534.						key = key.intern();						String value = node.get(key, null);						if (value != null) {							if (EclipsePreferences.DEBUG_PREFERENCE_SET)								PrefsMessages.message("Setting: " + globalNode.absolutePath() + '/' + key + '=' + value); //$NON-NLS-1$							globalNode.put(key, value);						}					}				}				// keep visiting children				return true;			}		};		try {			// start by visiting the root			modifiedNode.accept(visitor);		} catch (BackingStoreException e) {			throw new CoreException(createStatusError(PrefsMessages.preferences_applyProblems, e));		}		// save the prefs		try {			getRootNode().node(modifiedNode.absolutePath()).flush();		} catch (BackingStoreException e) {			throw new CoreException(createStatusError(PrefsMessages.preferences_saveProblems, e));		}		if (EclipsePreferences.DEBUG_PREFERENCE_GENERAL)			PrefsMessages.message("Current list of all settings: " + ((EclipsePreferences) getRootNode()).toDeepDebugString()); //$NON-NLS-1$		//this typically causes a major change to the preference tree, so force string sharing		lastStringSharing = 0;		shareStrings();		return result;	}