You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Josh Singer <jo...@gmail.com> on 2008/12/04 16:29:42 UTC

bug in velocity 1.5 parser

Hi there,

I believe this might be a bug in the 1.5 parser

Trying to parse this:

show rsvp interface #if($tunnel-number) tunnel-te $tunnel-number #endif

I am getting this:

java.lang.NullPointerException
at org.apache.velocity.runtime.parser.Parser.Directive(Parser.java:672)
at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:320)
at org.apache.velocity.runtime.parser.Parser.IfStatement(Parser.java:1453)
at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:293)
at org.apache.velocity.runtime.parser.Parser.process(Parser.java:258)

I guess this should be a ParseException, not a NPE.

Obviously the #endif should have been #{end} but the NPE was throwing our
environment into a funny state.

I tried to submit a bug via JIRA but it didn't seem clear how to.

cheers,

josh

Re: bug in velocity 1.5 parser

Posted by Nathan Bubna <nb...@gmail.com>.
Hi Josh,

Yeah, that shouldn't be an NPE.   To open a bug report, go to
https://issues.apache.org/jira/browse/VELOCITY and click the "Create
New Issue" link in the menu bar along the top of that page.

Also, do you still get an NPE if you try it with Velocity 1.6?

thanks,
nathan

On Thu, Dec 4, 2008 at 7:29 AM, Josh Singer <jo...@gmail.com> wrote:
> Hi there,
>
> I believe this might be a bug in the 1.5 parser
>
> Trying to parse this:
>
> show rsvp interface #if($tunnel-number) tunnel-te $tunnel-number #endif
>
> I am getting this:
>
> java.lang.NullPointerException
> at org.apache.velocity.runtime.parser.Parser.Directive(Parser.java:672)
> at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:320)
> at org.apache.velocity.runtime.parser.Parser.IfStatement(Parser.java:1453)
> at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:293)
> at org.apache.velocity.runtime.parser.Parser.process(Parser.java:258)
>
> I guess this should be a ParseException, not a NPE.
>
> Obviously the #endif should have been #{end} but the NPE was throwing our
> environment into a funny state.
>
> I tried to submit a bug via JIRA but it didn't seem clear how to.
>
> cheers,
>
> josh
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org