You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org> on 2010/11/13 19:47:13 UTC

[jira] Commented: (VELOCITY-777) ParseErrorException line-/columnNumber properties not set

    [ https://issues.apache.org/jira/browse/VELOCITY-777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931715#action_12931715 ] 

Jarkko Viinamäki commented on VELOCITY-777:
-------------------------------------------

I can verify that 1.6.4 release behaves like that and it looks like a bug. However, current SVN head seems to work properly so it's fixed there.

> ParseErrorException line-/columnNumber properties not set
> ---------------------------------------------------------
>
>                 Key: VELOCITY-777
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-777
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.4
>         Environment: Velocity 1.6.4
>            Reporter: Olaf Klischat
>
> import java.io.StringReader;
> import java.io.StringWriter;
> import org.apache.velocity.VelocityContext;
> import org.apache.velocity.app.Velocity;
> import org.apache.velocity.exception.ParseErrorException;
> public class VelErrTest {
>     public static void main(String[] args) throws Exception {
>         String template = "hello\n\nFoo bar #blah(foo.bar.baz)";
>         VelocityContext ctx = new VelocityContext();
>         StringWriter out = new StringWriter(100);
>         try {
>             Velocity.evaluate(ctx, out, "test", new StringReader(template));
>             System.out.println(out.toString());
>         } catch (ParseErrorException pex) {
>             System.out.println("ParseErrorException: "+ pex.getMessage());
>             System.out.println(" ..at: " + pex.getLineNumber() + ", " + pex.getColumnNumber());
>         }
>     }
> }
> ...outputs:
> ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 3, column 19.  Encountered: "b" (98), after : "."
>  ..at: -1, -1
> i.e. the getLineNumber(), getColumnNumber() fields are (-1,-1) rather than (3,19).

-- 
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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org