[ 
https://issues.apache.org/jira/browse/VELOCITY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex updated VELOCITY-966:
--------------------------
    Affects Version/s: 2.3
          Description: 
The objective is to use 

*RuntimeInstance.parse* to get the parsed AST for some test and cache the AST.

Then use *RuntimeInstance.render* multiple times to render the text.

 

It appears that in version 2.3 {*}RuntimeInstance.{*}{*}render{*} invokes the 
Node.init call and at the end of the rendering clears the parser and tokens. On 
the next attempt to render init fails with the NullPointerException because 
tokens have been cleared.{*}{*}

 

So you can not call *RuntimeInstance.render* on the same AST several times

which seems to be the intent of this method...

> RuntimeInstance.render throws null pointer exception when trying to render 
> the same AST 
> ----------------------------------------------------------------------------------------
>
>                 Key: VELOCITY-966
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-966
>             Project: Velocity
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Alex
>            Priority: Major
>
> The objective is to use 
> *RuntimeInstance.parse* to get the parsed AST for some test and cache the AST.
> Then use *RuntimeInstance.render* multiple times to render the text.
>  
> It appears that in version 2.3 {*}RuntimeInstance.{*}{*}render{*} invokes the 
> Node.init call and at the end of the rendering clears the parser and tokens. 
> On the next attempt to render init fails with the NullPointerException 
> because tokens have been cleared.{*}{*}
>  
> So you can not call *RuntimeInstance.render* on the same AST several times
> which seems to be the intent of this method...



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to