abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r580496 - /incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java
Date Fri, 28 Sep 2007 22:00:17 GMT
Author: jmsnell
Date: Fri Sep 28 15:00:16 2007
New Revision: 580496

URL: http://svn.apache.org/viewvc?rev=580496&view=rev
Log:
bug fix (NPE) in json writer

Modified:
    incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java

Modified: incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java?rev=580496&r1=580495&r2=580496&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java
(original)
+++ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java
Fri Sep 28 15:00:16 2007
@@ -188,8 +188,10 @@
       writeElement("rights", source.getRightsElement(),jstream);
       jstream.writeField("updated", source.getUpdated());
       writeElement("generator", source.getGenerator(),jstream);
-      jstream.writeField("icon", source.getIconElement().getResolvedValue());
-      jstream.writeField("logo", source.getLogoElement().getResolvedValue());
+      if (source.getIconElement() != null)
+        jstream.writeField("icon", source.getIconElement().getResolvedValue());
+      if (source.getLogoElement() != null)
+        jstream.writeField("logo", source.getLogoElement().getResolvedValue());
       writeList("authors",source.getAuthors(),jstream);
       writeList("contributors",source.getContributors(),jstream);
       writeList("links",source.getLinks(),jstream);
@@ -244,9 +246,7 @@
   private static void writeElement(Element child, QName parentqname, JSONStream jstream)
throws IOException {
     QName childqname = child.getQName();
     String prefix = childqname.getPrefix();
-    String uri = childqname.getNamespaceURI();
     jstream.startArray();
-    
     if (prefix != null && !"".equals(prefix)) {
       jstream.writeQuoted(childqname.getPrefix() + ":" + childqname.getLocalPart());
     } else {



Mime
View raw message