dion 2003/07/23 23:43:05
Modified: jelly/src/java/org/apache/commons/jelly JellyContext.java
Log:
Maven exposed issue where a map has a null value and putAll was failing with an NPE
Revision Changes Path
1.45 +8 -2
jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java
Index: JellyContext.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- JellyContext.java 11 Jul 2003 06:27:07 -0000 1.44
+++ JellyContext.java 24 Jul 2003 06:43:05 -0000 1.45
@@ -322,9 +322,15 @@
* Sets the Map of variables to use
*/
public void setVariables(Map variables) {
- // FIXME: I have seen this fail when the passed Map contains a key, value
+ // I have seen this fail when the passed Map contains a key, value
// pair where the value is null
- this.variables.putAll( variables );
+ for (Iterator iter = variables.entrySet().iterator(); iter.hasNext();) {
+ Map.Entry element = (Map.Entry) iter.next();
+ if (element.getValue() != null) {
+ this.variables.put(element.getKey(), element.getValue());
+ }
+ }
+ //this.variables.putAll( variables );
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]