Community
Participate
Working Groups
XmlExtendedMetadata.getNamespace is called for every EPackage that needs to appear in the namespace declarations of the serialized file. Our special version ensures that the namespace without "-XMI" is used (see comments 8-11 of bug 316591). It does so by iterating over the structural features and using their namespace. However, if an EPackage uses metadata on references that has namespace=##targetNamespace, XmlExtendedMetadata is called again by BasicExtendedMetadata.basicGetNamespace, leading to an infinite recursion. This appears for example with the XMLTypePackage. (Packages other than the BPMN packages can for example be used because of ItemDefinition.structureRef.) As the goal of our overriding implementation is removing the "-XMI" for the 4 EPackages defined in our plugin, we could test for these and simply remove the -XMI part instead of inspecting the features. Like this, with some safeguards in order to only handle only "our" packages: String result = super.getNamespace(ePackage); if (result.endsWith("-XMI")) result = result.substring(0, result.length() - 4); return result; What do you think? Am I overlooking something?
Fixed in 185aac9fc8a676ce7fedb187df02bdd56da1f889.