Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365026

Summary: XMI222UMLResourceFactoryImpl does not register ecore2xml
Product: [Modeling] MDT.UML2 Reporter: Ed Willink <ed>
Component: CoreAssignee: UML2 Inbox <mdt-uml2-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2011-11-29 03:07:06 EST
When running standalone, the incomplete initialization of a private ResourceSetImpl in XMI222UMLResourceFactoryImpl.createResource causes failure when reading the working UML 2.5 distribution.

At least 

extensionToFactoryMap.put(Ecore2XMLResource.FILE_EXTENSION, Ecore2XMLResource.Factory.INSTANCE);

would appear to be missing.
Comment 1 Kenn Hussey CLA 2011-12-01 22:29:58 EST
When running in standalone mode, you are required to programmatically perform all of the registrations that would otherwise be done by plug-in manifests, via the global registries. The file extension registry in the private resource set that you mention will delegate to the global registry, so it should be enough for your code to do this:

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(Ecore2XMLResource.FILE_EXTENSION, Ecore2XMLResource.Factory.INSTANCE);
Comment 2 Ed Willink CLA 2011-12-02 09:16:02 EST
The problem was in the "platform:" rather than ".ecore2xml" aspect of the access. My ProjectMap had a bug for workspace projects with genmodels; now fixed.

The contribution to Bug 364419 successfully puts all the pices in place to allow the UML 2.5 XMI to be opened standalone.