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

Bug 369268

Summary: CMOF file cannot be read after edit
Product: [Modeling] MDT.UML2 Reporter: Ed Willink <ed>
Component: CoreAssignee: UML2 Inbox <mdt-uml2-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 4.0.0   
Target Milestone: M5   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2012-01-20 13:19:24 EST
(16-Jan I-build) After editing a 3.0.0 file, the Extension references change to <xmi:Extension extender="http://www.eclipse.org/uml2/4.0.0/UML"> for which CMOF202UMLHandler.processElement has no support. Need another || UMLPackage.eNS_URI.equals(extender) term.
Comment 1 Kenn Hussey CLA 2012-01-20 17:04:01 EST
Hmm, odd that I didn't encounter this while testing...
Comment 2 Kenn Hussey CLA 2012-01-20 17:07:28 EST
Actually, the code is already there:

	@Override
	protected void processElement(String name, String prefix, String localName) {
		String extender = attribs
			.getValue(EMOFExtendedMetaData.XMI_EXTENDER_ATTRIBUTE);

		if (EMOFExtendedMetaData.EXTENSION.equals(localName)
			&& XMI2UMLResource.XMI_2_1_NS_URI.equals(helper.getURI(prefix))
			&& attribs != null
			&& (UML212UMLResource.UML_METAMODEL_NS_URI.equals(extender) || UML302UMLResource.UML_METAMODEL_NS_URI
				.equals(extender)) || UMLPackage.eNS_URI.equals(extender)) {

			types.push(UML_EXTENSION_TYPE);
		} else {
			super.processElement(name, prefix, localName);
		}
	}

Are you sure you used the latest build?
Comment 3 Kenn Hussey CLA 2012-01-20 17:54:53 EST
Doh, there was a typo. Fix committed and pushed. Another integration build will be published soon.
Comment 4 Kenn Hussey CLA 2012-01-20 18:14:40 EST
The integration build is now available.
Comment 5 Ed Willink CLA 2012-01-21 00:49:44 EST
(In reply to comment #2)
> Are you sure you used the latest build?

I think I used a CVS ergonomic and Synchronized, which didn't do a Fetch. I was still using the 8-Dec [366083] commit state in my Workspace after the latest I-build failed because of the typo.

Might I suggest an isUMLMetamodelNSuri() helper for this growing list; UML 2.5 coming shortly. Also more readable and debuggable. Perhaps even an explicitly extendable list to facilitate UML developers and customizers.
Comment 6 Kenn Hussey CLA 2012-01-21 08:28:59 EST
I'll consider adding a convenience utility if/when we migrate to UML 2.5.