adri...@apache.org wrote:
> Author: adrianc
> Date: Sun Jan 31 00:08:14 2010
> New Revision: 904921
> 
> URL: http://svn.apache.org/viewvc?rev=904921&view=rev
> Log:
> Some changes to the UEL integration. While attempting to upgrade the JUEL 
> library, some flaws in my original code were exposed. This commit fixes them. 
> Also, I added some more unit tests.

I would have split this commit into several.

> Modified: 
> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java
> URL: 
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java?rev=904921&r1=904920&r2=904921&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java 
> (original)
> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java 
> Sun Jan 31 00:08:14 2010
> @@ -120,9 +120,11 @@
>      }
>  
>      protected static class BasicContext extends ELContext {
> +        protected final Map<String, Object> variables;
>          protected final VariableMapper variableMapper;
>          public BasicContext(Map<String, ? extends Object> context) {
> -            this.variableMapper = new BasicVariableMapper(context, this);
> +            this.variableMapper = new BasicVariableMapper(this);
> +            this.variables = UtilGenerics.cast(context);

This is wrong.  You've converted a read only map to a writable one.
The syntax on context means that BasicContext doesn't insert new
items, nor replace any items in context.

If you really need to modify variable, then change the generics markup
on context.

Reply via email to