| Summary: | Generated Code does not compile | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] GMF-Tooling | Reporter: | Steffen Becker <steffen.becker> | ||||||
| Component: | Core | Assignee: | Artem Tikhomirov <tikhomirov.artem> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | akarjakina | ||||||
| Version: | 2.0 | Flags: | richard.gronback:
pmc_approved+
Ed.Merks: pmc_approved+ dimzzy: review+ boris.blajer: review+ |
||||||
| Target Milestone: | 2.0 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows NT | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Could you please attach the model that exhibits this behaviour? I can't reproduce the issue. I can try to upload it, the problem is, that the ecore model is split into many partial models. I can upload them, however, I'm unsure about the referential integrity. But maybe it is sufficient for you to locate the problem. Created attachment 71728 [details]
Our model files
The GMF Models for all our editor are in gmfmodels subfolder. The problem I reported is in repository editor. However, it also happens in SEFF editor and may be in the others (I stopped testing the other models as they require manuall code fixes)
I am not sure yet if this could be of any help, but just as an investigation from xPand debugger for me to remember: that code comes from xpt::navigator::NavigatorLabelProvider:275 for Gen Link Label child of Gen Link (for example, ProvidesStereotypeLabelEditPart inside of ProvidedRoleEditPart in your repositoryeditor.gmfgen), as it has no any modelFacet (in the template we have label.modelFacet == null, so getDiagramLabelText for label.modelFacet does not get called at all) I can confirm that the code compiles when you add a DiagramModelFacet to each of the links manually and regenerate. How did it come that it was not there? I can not test if the generated code is correct because of bug 193180, but i'm continuing to try to get it running After working around bug 193180 I can confirm that the generated editor behaves as expected, so the only remaining question is why the Diagram Label Facet was missing, right? Ok, I have to correct myself. There is a strange 'dummy label' in the top left corner of the diagram which shows "<...>" and can not be drag dropped. It vanishes as soon as all diagram links are removed from the diagram. So, there is another issue besides the not compiling code and the missing facet Final comment: The dummy label comes from my gmfgraph which declares two labels as children of the role link figure but later in the gmfmap only one label is mapped. Earlier versions of GMF only generated code for mapped labels, the current version obviously generates code for all labels. So, the dummy label can be fixed in the gmfgraph model - possibly manually. (In reply to comment #5) > I can confirm that the code compiles when you add a DiagramModelFacet to each > of the links manually and regenerate. How did it come that it was not there? The reason there's no model facet in the .gmfgen is that you use LabelMapping for your labels. Basically, there are three options, LabelMapping, and two subclasses, DesignLabelMapping and FeatureLabelMapping. Using former means we generate no code to implement your labels and rather rely on you to implement and plug in parser provider, for two subclasses we do generate some additional support. So, I'm going to fix NavigatorLabelProvider to consult ParserService when there are no model facet, but if custom parser provider is not what you were tryying to accomplish, I'd suggest you to try some other LabelMapping. Diagram Label is just what i need, so I'll change it appropriately. I didn't change the mapping at all. It was transformed into this state by applying all the time "migrate to gmf2" actions. Some time in the past there must have been the change from label mapping to more refined label mappings and it did not transform it then (In reply to comment #10) You are rigth, some time ago we introduced that logic, and since old LabelMapping value (witout any features defined) is legal, it's hard to tell whether it should be transformed or not, so we keep it as is. Eventually, this seems to be helpful to find out the problem with NavigatorLabelProvider ;) Created attachment 71924 [details]
NavigatorLabelProvider.xpt
Proposed fix touches only cases with null modelFacet, generating code to consult ParserService.
delivered. [target cleanup] 2.0 RC was the original target milestone for this bug [GMF Restructure] Bug 319140 : product GMF and component Generation was the original product and component for this bug |
Eclipse Build ID: 3.3RC4 My generated code contains methods in ???NavigatorLabelProvider /** * @generated */ private String getProvidedRole_4101Text(View view) { } /** * @generated */ private String getRequiredRole_4102Text(View view) { } /** * @generated */ private String getImplementationComponentTypeParentCompleteComponentTypes_4103Text( View view) { } /** * @generated */ private String getCompleteComponentTypeParentProvidesComponentTypes_4104Text( View view) { } which the compiler won't compile as they obviously don't return a string More information: It's even not working with 18.6. Nightly build. gmfmap and genmodel validate nicely. All labels are read-only, static labels which show as stereotype <<Role>> on a link. Last time it worked for me was M7, I didn't test RC1