|[emft-dev] [modeling-dev] Creating/Loading (Legacy) UML Resources|
I would like to bring your attention to some changes in UML2 which may impact you if you happen to be programmatically creating/loading UML resources; for all the gory details, see bug 389542 .
The UML editor in UML2 4.0.0 didn't properly handle legacy resources because a file extension registration occluded the content type registration for *.uml resources.
In UML2 4.0.1, the problematic file extension registration was removed from UMLUtil#init(ResourceSet), which fixed the UML editor (when loading resources directly) but meant that creation of resources based on file extension alone when using UMLResourcesUtil#init(ResourceSet), stopped working. Support for indirectly-loaded legacy UML resources, however, still depends on the fix in EMF for bug 390951 , scheduled for Juno SR2.
Fixes in UML2 4.0.2 will affect clients that are using UMLResourcesUtil#init(ResourceSet). The intention is to ensure that behavior of Eclipse and standalone modes are equivalent; to do this, only "local" registrations are done in UMLUtil#init(ResourceSet) (since the global ones are already done by various plug-in manifests) and only "global" registrations, including one for the *.uml file extension, are done in UMLResourcesUtil#init(ResourceSet). The net effect being that support for legacy resources and creation of UML resources based only on file extension should work the same in both modes.
Basically, if you're looking to programmatically create/load UML resources with UML2 4.0.2 (and releases thereafter), it's like this:
- if you want to work with (only new) UML resources in Eclipse, do nothing
- if you want support for legacy resources in Eclipse, call UMLUtil#init(ResourceSet) with a resource set (since passing null is essentially a no-op)
- if you want to work with (only new) UML resources standalone, call UMLResourcesUtil#init(ResourceSet) with null (once)
- if you want support for legacy resources standalone, call UMLResourcesUtil#init(ResourceSet) with a resource set
_______________________________________________ modeling-dev mailing list modeling-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/modeling-dev
Back to the top