Bug 303841 Model ids should not be used as resource ids
Merging can go wrong here because model ids are only unique within a given scope. java.lang.ClassCastException: org.eclipse.e4.ui.model.application.impl.CommandImpl cannot be cast to org.eclipse.e4.ui.model.application.MPerspective at org.eclipse.e4.ui.model.application.impl.PerspectiveStackImpl.eSet(PerspectiveStackImpl.java:201) at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1081) at org.eclipse.e4.workbench.ui.internal.EMFModelDeltaSet.apply(EMFModelDeltaSet.java:31) at org.eclipse.e4.workbench.ui.internal.EMFModelDeltaDelayedSet.apply(EMFModelDeltaDelayedSet.java:44) at org.eclipse.e4.workbench.ui.internal.ModelReconcilingService.applyDeltas(ModelReconcilingService.java:53) at org.eclipse.e4.workbench.ui.internal.ModelReconcilingService.applyDeltas(ModelReconcilingService.java:35) at org.eclipse.e4.workbench.ui.internal.ResourceHandler.loadMostRecentModel(ResourceHandler.java:172)
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/internal/E4XMIResource.java
if (internalId != null) {
				super.setID(eObject, internalId);
			}
			objectMap.put(eObject, id);
		}
		super.setID(eObject, id);
	}
	@Override
	public String getID(EObject eObject) {
		String id = super.getID(eObject);
		if (id != null) {
			return id;
		}
		id = objectMap.get(eObject);
		if (id != null) {
			return id;
		}
		MApplicationElement element = (MApplicationElement) eObject;
		id = element.getId();
		if (id != null && id.length() != 0) {
			setID(eObject, id);
			return id;
		}
		id = getUniqueId();
		element.setId(id);
		setID(eObject, id);
		return id;
	}
}