Hello, Will !

> Let me look into this.

Have you had a chance to take a look at this ?

What do you think about applying this patch:

Index: src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
===================================================================
--- src/java/org/apache/velocity/runtime/parser/node/ASTReference.java  
(revision 345188)
+++ src/java/org/apache/velocity/runtime/parser/node/ASTReference.java  
(working copy)
@@ -172,6 +172,9 @@
             for (int i = 0; i < numChildren; i++)
             {
                 result = getChild(i).execute(result,context);
+                if (result == null) {
+                  break;
+                }
             }
 
             return result;


> Thanks,

> WILL

> ----- Original Message ----- 
> From: "Alexey Panchenko" <[EMAIL PROTECTED]>
> To: "Velocity Developers List" <[email protected]>
> Sent: Monday, October 24, 2005 2:04 AM
> Subject: Re: svn commit: r291204 - in /jakarta/velocity/core/trunk: 
> src/java/org/apache/velocity/runtime/parser/node/ 
> src/test/org/apache/velocity/test/ 
> src/test/org/apache/velocity/test/provider/ test/templates/ 
> test/templates/compare/


>> Hello !
>>
>> What are the reasons for the change below ?
>>
>> Example template code:
>>
>> =================================
>> #set($x = {}) ## create empty map
>> $x.get('aaa').ccc
>> =================================
>>
>> With new code I got in the log:
>>
>> ERROR ASTIdentifier.execute() : identifier = ccc (with 
>> NullPointerException)
>> WARN ReferenceException ....
>>
>> The previous behavior was only:
>>
>> WARN ReferenceException ....
>>
>> Can somebody fix this ?
>>
>>> Author: wglass
>>> Date: Fri Sep 23 14:27:22 2005
>>> New Revision: 291204
>>
>>> URL: http://svn.apache.org/viewcvs?rev=291204&view=rev
>>> Log:
>>> silent reference now works when toString of the context returns
>>> null. (was throwing an exception. Thanks to Llwellyn Falco and Dan
>>> Powell for the patch!
>>
>>
>>> Modified: 
>>> jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
>>> URL: 
>>> http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java?rev=291204&r1=291203&r2=291204&view=diff
>>> ==============================================================================
>>> ---  
>>> jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
>>>  
>>> (original)
>>> +++ 
>>> jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
>>>  
>>> Fri Sep 23 14:27:22 2005
>>> @@ -171,11 +171,6 @@
>>>              for (int i = 0; i < numChildren; i++)
>>>              {
>>>                  result = jjtGetChild(i).execute(result,context);
>>> -
>>> -                if (result == null)
>>> -                {
>>> -                    return null;
>>> -                }
>>>              }
>>
>>>              return result;
>>
>> -- 
>> Best regards,
>> Alexey                            mailto:[EMAIL PROTECTED]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Best regards,
 Alexey                            mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to