You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/10/26 11:38:59 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/beanshell BeanShellExpressionFactory.java

jstrachan    2002/10/26 02:38:59

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/beanshell
                        BeanShellExpressionFactory.java
  Log:
  Fix to bug where using a script inside a loop wasn't correcty seeing new variables.
  Ultimately it'd be great to unify the Jelly and BeanShell scopes properly so that there wasn't a need to copy variables into/out of scopes to boost performance a bit. Still at least it works now.
  
  Revision  Changes    Path
  1.6       +11 -0     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellExpressionFactory.java
  
  Index: BeanShellExpressionFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellExpressionFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BeanShellExpressionFactory.java	1 Oct 2002 16:11:24 -0000	1.5
  +++ BeanShellExpressionFactory.java	26 Oct 2002 09:38:59 -0000	1.6
  @@ -78,6 +78,16 @@
        * A helper method to return the JellyInterpreter for the given JellyContext
        */
       public static JellyInterpreter getInterpreter(JellyContext context) throws EvalError {
  +  
  +        /** 
  +         * @todo when we can unify the BeanShell and Jelly variable scopes we can share a single
  +         * BeanShell context for each JellyContext. 
  +         * For now lets create a new one each time, which is slower.
  +         */
  +        JellyInterpreter interpreter = new JellyInterpreter();
  +        interpreter.setJellyContext(context);
  +        return interpreter;
  +/*        
           JellyInterpreter interpreter 
               = (JellyInterpreter) context.getVariable( "org.apache.commons.jelly.beanshell.JellyInterpreter" );
           if ( interpreter == null ) {
  @@ -86,6 +96,7 @@
               context.setVariable( "org.apache.commons.jelly.beanshell.JellyInterpreter", interpreter );
           }            
           return interpreter;
  +*/        
       }
       
       
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>