[
https://issues.apache.org/jira/browse/VELOCITY-676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jarkko Viinamäki updated VELOCITY-676:
--------------------------------------
Attachment: velocity-676.patch
This should fix it.
I changed the parser so that SINGLE_LINE_COMMENT_START is not detected in all
states. The problem was the while IN_TEXTBLOCK state the parser ran into ## and
processed SINGLE_LINE_COMMENT_START block which in turn somehow erased the
input buffer.
I hope this parser comment processing change doesn't break anything. Tests pass
at least.
> #[[##x]]# causes StringIndexOutOfBoundsException
> ------------------------------------------------
>
> Key: VELOCITY-676
> URL: https://issues.apache.org/jira/browse/VELOCITY-676
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.7
> Reporter: Byron Foster
> Attachments: velocity-676.patch
>
>
> The following VTL:
> #[[##x]]#
> Causes:
> Threw: class java.lang.StringIndexOutOfBoundsException
> Msg: String index out of range: -2
> java.lang.String.substring(String.java:1768)
> org.apache.velocity.runtime.parser.node.ASTTextblock.init(ASTTextblock.java:79)
>
> org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:309)
> org.apache.velocity.Template.initDocument(Template.java:218)
> org.apache.velocity.Template.process(Template.java:126)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]