geirm 00/11/26 19:55:58
Modified: src/java/org/apache/velocity/runtime/parser/node
ASTReference.java
Log:
Two changes :
1) changed the type of log message from error() to warn() for an invalid reference.
2) Added a check to see if the runtime.log.reference.log_invalid is set to true in
order to print out those messages. This way, you can turn this off for production.
Revision Changes Path
1.11 +4 -3
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
Index: ASTReference.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ASTReference.java 2000/11/11 22:40:05 1.10
+++ ASTReference.java 2000/11/27 03:55:58 1.11
@@ -64,7 +64,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: ASTReference.java,v 1.10 2000/11/11 22:40:05 geirm Exp $
+ * @version $Id: ASTReference.java,v 1.11 2000/11/27 03:55:58 geirm Exp $
*/
package org.apache.velocity.runtime.parser.node;
@@ -76,6 +76,7 @@
import org.apache.velocity.Context;
import org.apache.velocity.runtime.Runtime;
+import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.exception.ReferenceException;
import org.apache.velocity.runtime.parser.*;
@@ -181,8 +182,8 @@
writer.write(NodeUtils.specialText(getFirstToken()) + strPrefix_ +
strPrefix_ + nullString);
- if (referenceType != QUIET_REFERENCE)
- Runtime.error(new ReferenceException("reference", this));
+ if (referenceType != QUIET_REFERENCE && Runtime.getBoolean(
RuntimeConstants.RUNTIME_LOG_REFERENCE_LOG_INVALID, true) )
+ Runtime.warn(new ReferenceException("reference", this));
}
else
{