commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/jexl JexlExpression.java
Date Fri, 26 Apr 2002 04:29:41 GMT
geirm       02/04/25 21:29:41

  Modified:    jelly/src/java/org/apache/commons/jelly/expression/jexl
                        JexlExpression.java
  Log:
  Doesn't suck now, and it only took 11 hours :)
  
  Revision  Changes    Path
  1.2       +21 -7     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/jexl/JexlExpression.java
  
  Index: JexlExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/jexl/JexlExpression.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JexlExpression.java	24 Apr 2002 13:03:03 -0000	1.1
  +++ JexlExpression.java	26 Apr 2002 04:29:41 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/jexl/JexlExpression.java,v
1.1 2002/04/24 13:03:03 jstrachan Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/04/24 13:03:03 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/jexl/JexlExpression.java,v
1.2 2002/04/26 04:29:41 geirm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/26 04:29:41 $
    *
    * ====================================================================
    *
  @@ -57,10 +57,12 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: JexlExpression.java,v 1.1 2002/04/24 13:03:03 jstrachan Exp $
  + * $Id: JexlExpression.java,v 1.2 2002/04/26 04:29:41 geirm Exp $
    */
   package org.apache.commons.jelly.expression.jexl;
   
  +import java.util.Map;
  +
   import org.apache.commons.jelly.Context;
   import org.apache.commons.jelly.expression.ExpressionSupport;
   
  @@ -78,7 +80,7 @@
    * along with some extra features like object method invocation.
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class JexlExpression extends ExpressionSupport {
   
  @@ -96,10 +98,22 @@
       //------------------------------------------------------------------------- 
       public Object evaluate(Context context) {
           try {
  -            // ##### this sucks - avoid doing a copy by value ASAP
  -            HashMapContext jexlContext = new HashMapContext();
  -            jexlContext.putAll( context.getVariables() );
  -            
  +
  +	    JexlContext jexlContext = new JexlContext() {
  +		    
  +		    Map ctx;
  +
  +		    public void setVars(Map vars) {
  +			ctx = vars;
  +		    }
  +
  +		    public Map getVars() {
  +			return ctx;
  +		    }
  +		};
  +
  +	    jexlContext.setVars(context.getVariables());
  +
               if ( log.isDebugEnabled() ) {            
                   log.debug( "Evaluating EL: " + expression );
               }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message