geirm       01/01/13 08:44:57

  Modified:    src/java/org/apache/velocity/runtime/parser/node
                        ASTSetDirective.java
  Log:
  (Re) added support for switch to silence ASTSetDirective when the RHS
  of a set statement is null.
  
  That switch is  :
  
  RUNTIME_LOG_REFERENCE_LOG_INVALID
  
  and has been in or vel.props for a while.  The code to support it seems
  to have fallen off somewhere.
  
  Revision  Changes    Path
  1.12      +6 -2      
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTSetDirective.java
  
  Index: ASTSetDirective.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTSetDirective.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ASTSetDirective.java      2001/01/03 05:27:04     1.11
  +++ ASTSetDirective.java      2001/01/13 16:44:57     1.12
  @@ -59,7 +59,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - * @version $Id: ASTSetDirective.java,v 1.11 2001/01/03 05:27:04 geirm Exp $
  + * @version $Id: ASTSetDirective.java,v 1.12 2001/01/13 16:44:57 geirm Exp $
    */
   
   package org.apache.velocity.runtime.parser.node;
  @@ -78,6 +78,7 @@
       private Node right;
       private ASTReference left;
       boolean bDeprecated = true;
  +    boolean blather = false;
       String lit = "";
   
       public ASTSetDirective(int id)
  @@ -110,6 +111,8 @@
           right = getRightHandSide();
           left = getLeftHandSide();
   
  +        blather = Runtime.getBoolean(Runtime.RUNTIME_LOG_REFERENCE_LOG_INVALID, 
true);
  +
           /*
            *   yechy but quick : so we can warn users they are using what will be 
            *  the deprecated version of #set
  @@ -153,7 +156,8 @@
   
           if ( value  == null)
           {
  -            Runtime.error("RHS of #set statement is null. Context will not be 
modified. " 
  +            if(blather)
  +                Runtime.error("RHS of #set statement is null. Context will not be 
modified. " 
                             + context.getCurrentTemplateName() + " [line " + 
getLine() 
                             + ", column " + getColumn() + "]");
   
  
  
  

Reply via email to