geirm       00/12/03 18:08:19

  Modified:    src/java/org/apache/velocity/runtime/directive Include.java
  Log:
  Replaced arg type checking with test of constant rather than string. (my duh...)
  
  Revision  Changes    Path
  1.9       +5 -5      
jakarta-velocity/src/java/org/apache/velocity/runtime/directive/Include.java
  
  Index: Include.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/directive/Include.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Include.java      2000/11/28 04:16:21     1.8
  +++ Include.java      2000/12/04 02:08:19     1.9
  @@ -93,7 +93,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
  - * @version $Id: Include.java,v 1.8 2000/11/28 04:16:21 jvanzyl Exp $
  + * @version $Id: Include.java,v 1.9 2000/12/04 02:08:19 geirm Exp $
    */
   public class Include extends Directive
   {
  @@ -133,16 +133,16 @@
                *  we only handle StringLiterals and References right now
                */
   
  -            String strArgType = node.jjtGetChild(i).toString();
  +            Node n = node.jjtGetChild(i);
   
  -            if (strArgType.equals("StringLiteral") || 
strArgType.equals("Reference"))
  +            if ( n.getType() ==  ParserTreeConstants.JJTSTRINGLITERAL || 
n.getType() ==  ParserTreeConstants.JJTREFERENCE )
               {
  -                if (!renderOutput(  node.jjtGetChild(i), context, writer ))
  +                if (!renderOutput( n, context, writer ))
                       outputErrorToStream( writer, "error with arg " + i + " please 
see log.");
               }
               else
               {
  -                Runtime.error( new String("#include() error : invalid argument type 
: " + strArgType) );
  +                Runtime.error( new String("#include() error : invalid argument type 
: " + n.toString() ) );
                   outputErrorToStream( writer, "error with arg " + i + " please see 
log.");
               }
           }
  
  
  

Reply via email to