Closed monae closed 9 years ago
On v1.10, the template {{#foo}}{{this}}{{/foo}} works well for both primitive arrays and wrapper arrays:
{{#foo}}{{this}}{{/foo}}
System.out.println(template.execute(new Object() { int[] foo = new int[]{1, 2, 3, 4}; })); // prints "1234" System.out.println(template.execute(new Object() { Integer[] foo = new Integer[]{1, 2, 3, 4}; })); // prints "1234"
On the other hand, the indexing {{foo.2}} does not work for primitive arrays:
{{foo.2}}
System.out.println(template.execute(new Object() { int[] foo = new int[]{1, 2, 3, 4}; })); // throws an exception System.out.println(template.execute(new Object() { Integer[] foo = new Integer[]{1, 2, 3, 4}; })); // prints "3"
This patch adds support for such index access on primitive arrays.
On v1.10, the template
{{#foo}}{{this}}{{/foo}}
works well for both primitive arrays and wrapper arrays:On the other hand, the indexing
{{foo.2}}
does not work for primitive arrays:This patch adds support for such index access on primitive arrays.