| Summary: | UML Profile Metaclass extension not work since eclipse juno | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] M2T | Reporter: | Michael Fraefel <mfr> | ||||
| Component: | Xpand | Assignee: | Karsten Thoms <karsten.thoms> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jochen.schmich | ||||
| Version: | 1.2.2 | Flags: | karsten.thoms:
kepler+
|
||||
| Target Milestone: | M4 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Like with Bug 385174 it looks like the changes made to org.eclipse.uml2.uml in version 4.0 have negative effects on Xtend UML Typesystem (while this is not a bug of Xtend itself). Your issue occurs because UML Typesystem fails to retrieve the corresponding Type of the extended metaclass in order to gain access to its features (like 'name' for example). The Stereotype is usually converted into the internal representation by the ProfileMetaModel at some point. This is also done for the Metaclass - conversion is handled by a different typesystem, though. And this seems to be an important detail: The Metaclass is handled by Emf(Registry)MetaModel and registered via its qualified name "uml::Class" (while "uml" is the name of the EPackage in this case). When the instance of org.eclipse.xtend.typesystem.uml2.profile.StereotypeType (the internal representation of Stereotypes) is asked for its supertypes, the ProfileMetaModel tries to lookup the internal representation of the Metaclass and add it to the list of supertypes in order to make the Stereotype inherit its attributes. This is the point, where the mechanism silently fails: The lookup routine uses a different way to compute the qualified name than the EmfRegistryMetaModel used to - the method org.eclipse.xtend.typesystem.uml2.profile.StereotypeType.getFullName(Object) now returns "UML::Class" instead of "uml::Class". This happens because #getFullName(Object) eventually calls org.eclipse.uml2.uml.NamedElement.getQualifiedName() which by itself returns the name of the Element and its owners - in this case: an instance of the class Model called "UML" (see: http://www.omg.org/spec/UML/20110701). It is likely that this change has been introduced by the current UML Version. You may want to switch to the former version of org.eclipse.uml2.uml in order to work around this issue. FQN construction should be aware of the Naming change for the specific UML version 4.0. It looks like the only way of fixing this is a special handling - I only had a short look at the implementation, though. I just stumbled over this issue when fixing bug#333605. The attached example there had the same issue. Pushed to master Part of Kepler M4 (Version 1.3.0) Requested via bug 522520. -M. |
Created attachment 220394 [details] Sample project Hi We use xpand to transform uml models to java code. For that we defined our own uml profile with stereotypes. Since we upgraded to eclipse juno, our stereotypes not match anymore the extended metaclass. I tried it as well with a fresh simple example project. It doesn’t work. In the attachment I have my example project. As you can see, the line 5 in NewXtendFile.ext has an error. But the line 8 doesn’t have it. The MyClass extends Class and should as well have the property name. Or I am wrong? Thanks for your help.