geirm 01/06/19 21:24:36
Modified: src/java/org/apache/velocity/runtime/parser/node
ASTAddNode.java ASTDivNode.java ASTEQNode.java
ASTGENode.java ASTGTNode.java ASTLENode.java
ASTLTNode.java ASTModNode.java ASTMulNode.java
ASTNENode.java ASTSubtractNode.java
Log:
Small change to give better information in case of a null reference.
Revision Changes Path
1.6 +4 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTAddNode.java
Index: ASTAddNode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTAddNode.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ASTAddNode.java 2001/03/19 18:27:17 1.5
+++ ASTAddNode.java 2001/06/20 04:24:24 1.6
@@ -63,7 +63,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: ASTAddNode.java,v 1.5 2001/03/19 18:27:17 geirm Exp $
+ * @version $Id: ASTAddNode.java,v 1.6 2001/06/20 04:24:24 geirm Exp $
*/
import org.apache.velocity.context.InternalContextAdapter;
@@ -112,7 +112,9 @@
if (left == null || right == null)
{
Runtime.error( ( left == null ? "Left" : "Right" )
- + " side of addition operation has null value."
+ + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of addition operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line " +
getLine()
+ ", column " + getColumn() + "]");
1.6 +4 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTDivNode.java
Index: ASTDivNode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTDivNode.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ASTDivNode.java 2001/03/19 18:27:19 1.5
+++ ASTDivNode.java 2001/06/20 04:24:25 1.6
@@ -68,7 +68,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: ASTDivNode.java,v 1.5 2001/03/19 18:27:19 geirm Exp $
+ * @version $Id: ASTDivNode.java,v 1.6 2001/06/20 04:24:25 geirm Exp $
*/
public class ASTDivNode extends SimpleNode
{
@@ -110,7 +110,9 @@
if (left == null || right == null)
{
Runtime.error( ( left == null ? "Left" : "Right" )
- + " side of division operation has null value."
+ + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of division operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName()
+ " [line " + getLine()
1.7 +7 -5
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTEQNode.java
Index: ASTEQNode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTEQNode.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ASTEQNode.java 2001/04/09 02:24:03 1.6
+++ ASTEQNode.java 2001/06/20 04:24:26 1.7
@@ -68,7 +68,7 @@
* This operator requires that the LHS and RHS are both of the
* same Class.
*
- * @version $Id: ASTEQNode.java,v 1.6 2001/04/09 02:24:03 geirm Exp $
+ * @version $Id: ASTEQNode.java,v 1.7 2001/06/20 04:24:26 geirm Exp $
*/
public class ASTEQNode extends SimpleNode
{
@@ -117,12 +117,14 @@
if (left == null || right == null)
{
Runtime.error( ( left == null ? "Left" : "Right" )
- + " side of equality operator (==) "
- + "has null value."
- + " If a reference, it may not be in the context."
+ + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of '==' operation "
+ + "has null value. "
+ + "If a reference, it may not be in the context."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line " +
getLine()
- + ", column " + getColumn() + "] (ASTEQNode)");
+ + ", column " + getColumn() + "]");
return false;
}
1.7 +3 -1
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTGENode.java
Index: ASTGENode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTGENode.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ASTGENode.java 2001/04/09 02:26:11 1.6
+++ ASTGENode.java 2001/06/20 04:24:26 1.7
@@ -94,7 +94,9 @@
if (left == null || right == null)
{
Runtime.error( ( left == null ? "Left" : "Right" )
- + " side of '>=' operation has null value."
+ + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of '>=' operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line "
+ getLine()
1.6 +3 -1
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTGTNode.java
Index: ASTGTNode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTGTNode.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ASTGTNode.java 2001/04/09 02:24:03 1.5
+++ ASTGTNode.java 2001/06/20 04:24:27 1.6
@@ -94,7 +94,9 @@
if (left == null || right == null)
{
Runtime.error( ( left == null ? "Left" : "Right" )
- + " side of '>' operation has null value."
+ + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of '>' operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line "
+ getLine()
1.6 +3 -1
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTLENode.java
Index: ASTLENode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTLENode.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ASTLENode.java 2001/04/09 02:26:11 1.5
+++ ASTLENode.java 2001/06/20 04:24:28 1.6
@@ -95,7 +95,9 @@
if (left == null || right == null)
{
Runtime.error( ( left == null ? "Left" : "Right" )
- + " side of '<=' operation has null value."
+ + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of '<=' operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line "
+ getLine()
1.6 +3 -1
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTLTNode.java
Index: ASTLTNode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTLTNode.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ASTLTNode.java 2001/04/09 02:26:11 1.5
+++ ASTLTNode.java 2001/06/20 04:24:28 1.6
@@ -95,7 +95,9 @@
if (left == null || right == null)
{
Runtime.error( ( left == null ? "Left" : "Right" )
- + " side of '<' operation has null value."
+ + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of '<' operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line "
+ getLine()
1.5 +4 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTModNode.java
Index: ASTModNode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTModNode.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ASTModNode.java 2001/03/19 17:17:50 1.4
+++ ASTModNode.java 2001/06/20 04:24:29 1.5
@@ -64,7 +64,7 @@
* what controls the generation of this class.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: ASTModNode.java,v 1.4 2001/03/19 17:17:50 geirm Exp $
+ * @version $Id: ASTModNode.java,v 1.5 2001/06/20 04:24:29 geirm Exp $
*/
import org.apache.velocity.context.InternalContextAdapter;
import org.apache.velocity.runtime.Runtime;
@@ -106,7 +106,9 @@
if (left == null || right == null)
{
- Runtime.error( ( left == null ? "Left" : "Right" ) + " side of modulus
operation has null value."
+ Runtime.error( ( left == null ? "Left" : "Right" ) + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of modulus operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line " +
getLine()
+ ", column " + getColumn() + "]");
1.5 +4 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTMulNode.java
Index: ASTMulNode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTMulNode.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ASTMulNode.java 2001/03/19 17:17:51 1.4
+++ ASTMulNode.java 2001/06/20 04:24:29 1.5
@@ -69,7 +69,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: ASTMulNode.java,v 1.4 2001/03/19 17:17:51 geirm Exp $
+ * @version $Id: ASTMulNode.java,v 1.5 2001/06/20 04:24:29 geirm Exp $
*/
public class ASTMulNode extends SimpleNode
{
@@ -109,7 +109,9 @@
if (left == null || right == null)
{
- Runtime.error( ( left == null ? "Left" : "Right" ) + " side of
multiplication operation has null value."
+ Runtime.error( ( left == null ? "Left" : "Right" ) + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of multiplication operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line " +
getLine()
+ ", column " + getColumn() + "]");
1.5 +3 -1
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTNENode.java
Index: ASTNENode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTNENode.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ASTNENode.java 2001/04/09 02:24:03 1.4
+++ ASTNENode.java 2001/06/20 04:24:30 1.5
@@ -90,7 +90,9 @@
if ( left == null || right == null)
{
- Runtime.error( ( left == null ? "Left" : "Right" ) + " side of '!='
operation has null value."
+ Runtime.error( ( left == null ? "Left" : "Right" ) + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of '!=' operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line " +
getLine()
+ ", column " + getColumn() + "]");
1.5 +4 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTSubtractNode.java
Index: ASTSubtractNode.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTSubtractNode.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ASTSubtractNode.java 2001/03/19 17:17:54 1.4
+++ ASTSubtractNode.java 2001/06/20 04:24:30 1.5
@@ -70,7 +70,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: ASTSubtractNode.java,v 1.4 2001/03/19 17:17:54 geirm Exp $
+ * @version $Id: ASTSubtractNode.java,v 1.5 2001/06/20 04:24:30 geirm Exp $
*/
public class ASTSubtractNode extends SimpleNode
{
@@ -111,7 +111,9 @@
if (left == null || right == null)
{
- Runtime.error( ( left == null ? "Left" : "Right" ) + " side of
subtraction operation has null value."
+ Runtime.error( ( left == null ? "Left" : "Right" ) + " side ("
+ + jjtGetChild( (left == null? 0 : 1) ).literal()
+ + ") of subtraction operation has null value."
+ " Operation not possible. "
+ context.getCurrentTemplateName() + " [line " +
getLine()
+ ", column " + getColumn() + "]");