Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331374

Summary: Template extension inside of a file block appears to be broken
Product: [Modeling] Acceleo Reporter: Glenview Jeff <junk>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: laurent.goubet
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
See Also: https://git.eclipse.org/r/69534
https://git.eclipse.org/c/acceleo/org.eclipse.acceleo.git/commit/?id=414e281ea6381368aaaca2b6cf878044c1b27a88
Whiteboard:

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.