Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0.19
-
Fix Version/s: None
-
Component/s: Templating
-
Labels:None
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
TemplateCompiler has incorrect bounds checking, which causes the following test to fail on the third evaluation:
@Test
public void expandStrangeValue()
The problem is likely caused by the bounds checking in TemplateCompiler. The current implementation is:
public boolean isNext(char c)
{ return cursor != length && template[cursor + 1] == c; }The correct implementation should probably be:
public boolean isNext(char c)
{ return cursor != (length - 1) && template[cursor + 1] == c; }