|Re: getAppliedStereotypes() does not work when model and profile are in the same file ? [message #1598134 is a reply to message #1592977]
||Mon, 02 February 2015 20:19
|| Christian W. Damus
Registered: July 2009
The answer to your problem is a common mistake in creating the URIs
with which a resource is loaded. As Ed reminds us weekly on the EMF
newsgroup, you must always use an absolute URI when loading a resource
to ensure correct resolution of references. In this case, even local
references into the same resource (via some package registry or other
component that loses the context of what is the referencing resource).
So, changing the URI created at line 20 of your example program to an
absolute URI lets the stereotype applied to the class be found at line
On 2015-01-30 10:42:43 +0000, Dominique Marcadet said:
> I have a profile with a stereotype extending Class and a model with a
> class in a package. The profile is applied to the package and the
> stereotype is applied to the class.
> When the package and the profile are in two different files, I am able
> to get the stereotype with getAppliedStereotypes().
> But when the the package and the profile are in the same model and
> file, getAppliedStereotypes() returns nothing even if the stereotype is
> correctly displayed by UML editor.
> Is there anything specific to do to handle the "only one file" case ?
> I attach the UML and test java files showing the problem.
Powered by FUDForum
. Page generated in 0.02660 seconds