Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328932 - Java generation : java.lang.IndexOutOfBoundsException in Helios SR1
Summary: Java generation : java.lang.IndexOutOfBoundsException in Helios SR1
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Technologies (show other bugs)
Version: 0.8.1   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 0.8.2   Edit
Assignee: Fabien Giquel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 328931
Blocks:
  Show dependency tree
 
Reported: 2010-10-28 10:18 EDT by Fabien Giquel CLA
Modified: 2011-05-23 09:32 EDT (History)
4 users (show)

See Also:
fabien.giquel: helios+
fabien.giquel: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabien Giquel CLA 2010-10-28 10:18:13 EDT
There is an issue when launching Java generation template with Helios SR1.
The error does not occur in 3.7 milestones.
See "depends on" M2T issue for details on the error.
Comment 1 Fabien Giquel CLA 2010-10-28 10:19:37 EDT
oups, wrong dependency 181952 -> 328931
Comment 2 Nicolas Bros CLA 2010-10-28 10:36:20 EDT
using a "for" loop instead of a recursive template fixes the problem:

[template public writeBrackets(o : ASTNode, d : Integer)]
[for (i : Integer | Sequence{1..d})]['[]'/][/for]
[/template]
Comment 3 Nicolas Bros CLA 2010-10-28 12:32:49 EDT
For some reason, the previous code outputs nothing when d = 1.
So, I propose instead:

[template public writeBrackets(o : ASTNode, d : Integer)]
[if (d = 1)]['[]'/][/if]
[if (d > 1)][for (i : Integer | Sequence{1..d})]['[]'/][/for][/if]
[/template]
Comment 4 Fabien Giquel CLA 2010-11-24 08:02:47 EST
since We do not know when bug 328931 can be fixed and we have a simple solution, I commited your proposal, Nicolas. 
Both on 0.8 (rev 3615) and 0.9 branch (rev 3616).
Comment 5 Hugo Bruneliere CLA 2011-01-11 05:08:52 EST
Bug fixed.