commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Haberman" <steph...@chase3000.com>
Subject [jelly] [patch] NullPointerException
Date Wed, 11 Sep 2002 02:47:47 GMT
I've been using Jelly HEAD with Maven HEAD and occasionally get a
NullPointerException when Maven tries to set a null attribute on some
Ant tag. I've attached what I think is a viable solution below.

If this isn't correct (I posted it before, but perhaps it just got lot
in the high volume), another solution would be great.

Thanks,
Stephen

Index: src/java/org/apache/commons/jelly/tags/ant/AntTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jell
y/tags/ant/AntTag.java,v
retrieving revision 1.9
diff -u -r1.9 AntTag.java
--- src/java/org/apache/commons/jelly/tags/ant/AntTag.java	28 Aug
2002 15:29:53 -0000	1.9
+++ src/java/org/apache/commons/jelly/tags/ant/AntTag.java	11 Sep
2002 02:45:16 -0000
@@ -313,11 +313,12 @@
     }
 
     public void setAttribute(String name,
-                             Object value) 
-    {
-        super.setAttribute( name,
-                            value.toString() );
-                            
+                             Object value) {
+        if (value == null) {
+            value = "";
+        }
+
+        super.setAttribute( name, value.toString() );
     }
 
     public void setBeanProperty(Object object, String name, Object
value) throws Exception {


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message