Bug 305792 [Model] E4XMIResource fails when creating a resource with ModelComponents
The problem is that the ID generation stuff expects that everything is ApplicationElement which is not correct for the ModelComponents-Element. We should check for the case that the EObject is not an MApplicationElement and only set the xml:id in this case.
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/internal/E4XMIResource.java
/*******************************************************************************
 * Copyright (c) 2009 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 ******************************************************************************/
package org.eclipse.e4.workbench.ui.internal;
import java.util.Map;
import java.util.Map.Entry;
import java.util.WeakHashMap;
import org.eclipse.e4.ui.model.application.MApplicationElement;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
public class E4XMIResource extends XMIResourceImpl {
	private Map<EObject, String> objectMap = new WeakHashMap<EObject, String>();
	public E4XMIResource() {
	}
	public E4XMIResource(URI uri) {