Geir,
In this patch, I think you should NOT have
> + outputMsgEnd = Runtime.getString(Runtime.ERRORMSG_END );
> + outputMsgStart = " " + outputMsgStart;
but instead have
> + outputMsgEnd = Runtime.getString(Runtime.ERRORMSG_END );
> + outputMsgEnd = " " + outputMsgEnd;
Thanks for the good work.
Have fun,
Paulo Gaspar
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 27, 2001 17:45
> To: [EMAIL PROTECTED]
> Subject: cvs commit:
> jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node
> ASTDirective.java
>
>
> geirm 01/04/27 08:44:40
>
> Modified: src/java/org/apache/velocity/runtime/directive Include.java
> src/java/org/apache/velocity/runtime/parser/node
> ASTDirective.java
> Log:
> Kasper Nielsen's performance patches. Thanks
>
> Revision Changes Path
> 1.19 +30 -7
> jakarta-velocity/src/java/org/apache/velocity/runtime/directive/In
> clude.java
>
> Index: Include.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/di
> rective/Include.java,v
> retrieving revision 1.18
> retrieving revision 1.19
> diff -u -r1.18 -r1.19
> --- Include.java 2001/04/22 18:14:15 1.18
> +++ Include.java 2001/04/27 15:44:37 1.19
> @@ -98,10 +98,14 @@
> *
> * @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.18 2001/04/22 18:14:15 geirm Exp $
> + * @author <a href="mailto:[EMAIL PROTECTED]">Kasper Nielsen</a>
> + * @version $Id: Include.java,v 1.19 2001/04/27 15:44:37 geirm Exp $
> */
> public class Include extends Directive
> {
> + private String outputMsgStart = "";
> + private String outputMsgEnd = "";
> +
> /**
> * Return name of this directive.
> */
> @@ -117,7 +121,27 @@
> {
> return LINE;
> }
> -
> +
> + /**
> + * simple init - init the tree and get the elementKey from
> + * the AST
> + */
> + public void init( InternalContextAdapter context, Node node)
> + throws Exception
> + {
> + super.init( context, node );
> +
> + /*
> + * get the msg, and add the space so we don't have to
> + * do it each time
> + */
> + outputMsgStart = Runtime.getString(Runtime.ERRORMSG_START);
> + outputMsgStart = outputMsgStart + " ";
> +
> + outputMsgEnd = Runtime.getString(Runtime.ERRORMSG_END );
> + outputMsgStart = " " + outputMsgStart;
> + }
> +
> /**
> * iterates through the argument list and renders every
> * argument that is appropriate. Any non appropriate
> @@ -225,13 +249,12 @@
> */
> private void outputErrorToStream( Writer writer, String msg )
> throws IOException
> - {
> - String outputMsgStart =
> Runtime.getString(Runtime.ERRORMSG_START);
> - String outputMsgEnd = Runtime.getString(Runtime.ERRORMSG_END );
> -
> + {
> if ( outputMsgStart != null && outputMsgEnd != null)
> {
> - writer.write( outputMsgStart + " " + msg + " " +
> outputMsgEnd );
> + writer.write(outputMsgStart);
> + writer.write(msg);
> + writer.write(outputMsgEnd);
> }
> return;
> }
>
>
>
> 1.17 +4 -4
> jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/
> ASTDirective.java
>
> Index: ASTDirective.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/pa
> rser/node/ASTDirective.java,v
> retrieving revision 1.16
> retrieving revision 1.17
> diff -u -r1.16 -r1.17
> --- ASTDirective.java 2001/03/19 17:17:44 1.16
> +++ ASTDirective.java 2001/04/27 15:44:39 1.17
> @@ -1,7 +1,5 @@
> package org.apache.velocity.runtime.parser.node;
>
> -/* Generated By:JJTree: Do not edit this line. ASTDirective.java */
> -
> /*
> * The Apache Software License, Version 1.1
> *
> @@ -76,7 +74,8 @@
> *
> * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
> * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
> - * @version $Id: ASTDirective.java,v 1.16 2001/03/19 17:17:44
> geirm Exp $
> + * @author <a href="mailto:[EMAIL PROTECTED]">Kasper Nielsen</a>
> + * @version $Id: ASTDirective.java,v 1.17 2001/04/27 15:44:39
> geirm Exp $
> */
> public class ASTDirective extends SimpleNode
> {
> @@ -152,7 +151,8 @@
> }
> else
> {
> - writer.write( "#" + directiveName );
> + writer.write( "#");
> + writer.write( directiveName );
> }
>
> return true;
>
>
>
>