Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363447 - When having two FigureRef to the same figure. generated code has 2 variables with same name
Summary: When having two FigureRef to the same figure. generated code has 2 variables ...
Status: NEW
Alias: None
Product: GMF-Tooling
Classification: Modeling
Component: Generation / Templates (show other bugs)
Version: 2.4   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.0M3   Edit
Assignee: Svyatoslav Kovalsky CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-10 05:26 EST by Mickael Istria CLA
Modified: 2011-11-24 10:45 EST (History)
1 user (show)

See Also:


Attachments
A sample GMF Graph highlighting the issue (3.31 KB, application/octet-stream)
2011-11-10 05:26 EST, Mickael Istria CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2011-11-10 05:26:03 EST
Created attachment 206774 [details]
A sample GMF Graph highlighting the issue

If in a FigureDescriptor, you have two FigureRef that references that same Figure, the generated code creates the same variable name for both figures.

With the attached gmfgraph, you can see the IfFigure contains two FigureRefs to the diamond Figure. Generated code contains twice a diamond0 variable. A simple "Generate Figures plug-in" shows the issue.
Comment 1 Michael Golubev CLA 2011-11-10 10:25:35 EST
Slava, could you please add this use case to gmfgraph test suite? 

It should not be difficult to fix and the same fix will probably work for both bridge-time and codegen-time templates.
Comment 2 Mickael Istria CLA 2011-11-10 10:27:29 EST
Do you think this could be part of a 2.4.1 maintenance release?
Comment 3 Mickael Istria CLA 2011-11-24 10:41:25 EST
I think adding curly braces around line 45 of Children.xpt should be enough to fix that.
Comment 4 Michael Golubev CLA 2011-11-24 10:45:36 EST
I asked Slava to fix that "ad hoc", without introducing the differences for the generated code that is not explicily affected by problem. 

But yes, if this is difficult enough, then it seems that 
>adding curly braces around line 45 of Children.xpt 
would fix the problem.