jon 00/12/18 12:14:10
Modified: src/java/org/apache/velocity Context.java
Log:
at least log things...geeezzz...
Revision Changes Path
1.13 +32 -10 jakarta-velocity/src/java/org/apache/velocity/Context.java
Index: Context.java
===================================================================
RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/Context.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Context.java 2000/12/18 20:06:55 1.12
+++ Context.java 2000/12/18 20:14:09 1.13
@@ -69,7 +69,7 @@
* are stored in a Hashtable.
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: Context.java,v 1.12 2000/12/18 20:06:55 jvanzyl Exp $
+ * @version $Id: Context.java,v 1.13 2000/12/18 20:14:09 jon Exp $
*/
public class Context extends InternalContext implements Cloneable
{
@@ -94,7 +94,21 @@
*/
public void put(String key, Object value)
{
- context.put(key, value);
+ try
+ {
+ context.put(key, value);
+ }
+ catch (NullPointerException npe)
+ {
+ if (key == null)
+ {
+ org.apache.velocity.runtime.Runtime.error ("Context key was null!
Value was: " + value);
+ }
+ else if (value == null)
+ {
+ org.apache.velocity.runtime.Runtime.error ("Context value was null!
Key was: " + key);
+ }
+ }
}
/**
@@ -105,6 +119,10 @@
*/
public Object get(String key)
{
+ if (key == null)
+ {
+ org.apache.velocity.runtime.Runtime.debug ("Context key was null!");
+ }
return context.get(key);
}
@@ -116,6 +134,10 @@
*/
public boolean containsKey(Object key)
{
+ if (key == null)
+ {
+ org.apache.velocity.runtime.Runtime.debug ("Context key was null!");
+ }
return context.containsKey(key);
}
@@ -136,13 +158,19 @@
*/
public Object remove(Object key)
{
+ if (key == null)
+ {
+ org.apache.velocity.runtime.Runtime.debug ("Context key was null!");
+ }
return context.remove(key);
}
-
+ /**
+ * Clones this context object
+ * @return Object an instance of this Context
+ */
public Object clone()
{
Context clone = null;
-
try
{
clone = (Context) super.clone();
@@ -151,12 +179,6 @@
catch (CloneNotSupportedException cnse)
{
}
-
return clone;
}
}
-
-
-
-
-