Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331374 - Template extension inside of a file block appears to be broken
Summary: Template extension inside of a file block appears to be broken
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-29 14:16 EST by Glenview Jeff CLA
Modified: 2016-04-05 03:14 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glenview Jeff CLA 2010-11-29 14:16:25 EST
Build Identifier: M20100211-1343

If I try to create a template that looks like this, everything works as expected.

[module a extends b]
[template public ItemActivity(i : ItemActivity) overrides Activity]
	[file ('/src/abc/'.concat(i.name.concat('.java')), false, 'Cp1252')]
		[doOtherTemplateStuff(i)/]
	[/file]
[/template]
[template public doOtherTemplateStuff(i : ItemActivity) overrides doOtherTemplateStuff]
   [super/]
   xyzzy1
[/template]
[/module]

[module b]
[template public Activity(a : Activity)]
	[doOtherTemplateStuff(a)/]
[/template]
[template public doOtherTemplateStuff(a : Activity)]
   [super/]
   xyzzy2
[/template]
[/module]



If on the other hand I do this (changing [doOtherTemplateStuff(i)/] to [super/]:

[module a]
[template public ItemActivity(i : ItemActivity) overrides Activity]
	[file ('/src/abc/'.concat(i.name.concat('.java')), false, 'Cp1252')]
		[super/]
	[/file]
[/template]

[template public doOtherTemplateStuff(i : ItemActivity) overrides doOtherTemplateStuff]
   [super/]
   xyzzy1
[/template]
[/module]

[module b]
[template public Activity(a : Activity)]
	[doOtherTemplateStuff(a)/]
[/template]
[/module]

[template public doOtherTemplateStuff(a : Activity)]
   xyzzy2
[/template]
[/module]



then I get no output. 

Reproducible: Always

Steps to Reproduce:
See example in details
Comment 1 Laurent Goubet CLA 2016-03-30 10:42:40 EDT
Associated gerrit https://git.eclipse.org/r/#/c/69534/ will fix the [super/] call.

However, Acceleo has the issue of never going "back down" to the sub-modules in  case of a super call.

In other words, "a.itemActivity" will properly go up to its super "b.Activity", but when "b.Activity" calls "doOtherTemplateStuff", the template called will be "b.doOtherTemplateStuff" and not "a.doOtherTemplateStuff" as one could expect.

There are no plans to fixing that behavior for now.