On lun., 2010-03-01 at 12:43 +0100, Rachid wrote:
> Hi Velocity Users and devs,
>
> My excuses when you get this email twice. I think it concerns both groups
> after reading this page:
> http://wiki.apache.org/velocity/GettingYourPatchCommitted
Most commiters also read the users group. If unsure, next time, please
choose only one of them.
> When I was playing with the Velocity Template Engine I got a
> NullPointerException. Maybe it is because of my unusual configuration that
> this exception didn't occured before to others. But in my opinion this kind
> of Exceptions may never occur.
We should minimize them, yes.
> To be specific. I have Velocity version 1.7. The Exception is thrown on line
> 225 in Foreach.java
> if (!hasNextName.equals("velocityHasNext"))
> When the variable hasNextName equals null
> hasNextName is a deprecated config setting. It is assigned on line 210:
> hasNextName = rsvc.getString(RuntimeConstants.HAS_NEXT_NAME);
>
> A possible fix is to change the evaluation to
> if (!"velocityHasNext".equals(hasNextName))
>
> Since this kind of evaluation is done on more places (also on line 217) I'm
> willing to create a patch.
> I could not find a JIRA ticket concerning this issue. So can I just create a
> patch and commit this?
...and attach it to the JIRA issue so that we can review it and commit
it, yes.
But on this specific problem, default values should be provided in an
inner properties file
(org/apache/velocity/runtime/defaults/velocity.properties), so the main
concern would be to understand why this file did not get read in your
setup.
Claude
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]