| Summary: | Java generation : java.lang.IndexOutOfBoundsException in Helios SR1 | ||
|---|---|---|---|
| Product: | [Modeling] MoDisco | Reporter: | Fabien Giquel <fabien.giquel> |
| Component: | Technologies | Assignee: | Fabien Giquel <fabien.giquel> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | gdupe, hugo.bruneliere, modisco.web-inbox, nicolas.bros |
| Version: | 0.8.1 | Flags: | fabien.giquel:
helios+
fabien.giquel: indigo+ |
| Target Milestone: | 0.8.2 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
| Bug Depends on: | 328931 | ||
| Bug Blocks: | |||
|
Description
Fabien Giquel
oups, wrong dependency 181952 -> 328931 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]
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]
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). Bug fixed. |