I took a quick look at the problem reported in SHINDIG-86, and I'm not
sure if I'm taking a too simplistic step here, but should the fix for
this be to check if contents actually have childs inside
GadgetSpecParser ? Below is a quick diff for discussion, feel free to
tell me the issue is much bigger then this :) and need further
investigation.


Index: src/main/java/org/apache/shindig/gadgets/GadgetSpecParser.java
===================================================================
--- src/main/java/org/apache/shindig/gadgets/GadgetSpecParser.java
 (revision 630088)
+++ src/main/java/org/apache/shindig/gadgets/GadgetSpecParser.java
 (working copy)
@@ -322,14 +322,17 @@
       Node viewNode = attrs.getNamedItem("view");
       String viewStr = (viewNode == null) ? "" : viewNode.getNodeValue();
       String[] views = viewStr.split(",");
-      Node child = content.getFirstChild();
-      String contentData = content.getTextContent();
-      if (contentData.length() > 0) {
-        for (String view : views) {
-          spec.addContent(view, contentData);
-        }
-      } else {
-        throw new SpecParserException("Empty or malformed <Content> section!");
+
+      if (content.hasChildNodes()) {
+         Node child = content.getFirstChild();
+          String contentData = content.getTextContent();
+          if (contentData.length() > 0) {
+            for (String view : views) {
+              spec.addContent(view, contentData);
+            }
+          } else {
+            throw new SpecParserException("Empty or malformed
<Content> section!");
+          }
       }
     }
   }


On Thu, Feb 21, 2008 at 5:16 PM, Kevin Brown <[EMAIL PROTECTED]> wrote:
> This is a known issue. Current workaround is to require some arbitrary
>  feature.
>
>  On Thu, Feb 21, 2008 at 2:50 PM, Phillip Rhodes <[EMAIL PROTECTED]>
>  wrote:
>
>
>
>  > Bruno Bowden wrote:
>  > > I'm also looking in to this:
>  > >   https://issues.apache.org/jira/browse/SHINDIG-86
>  >
>  >
>  > Aaah, OK.  Thanks for pointing that out.  At least I know
>  > it's not just me now.  :-)
>  >
>  >
>  > TTYL,
>  >
>  >
>  > --
>  > Phillip Rhodes
>  > Chief Architect - OpenQabal
>  > https://openqabal.dev.java.net
>  > LinkedIn: http://www.linkedin.com/in/philliprhodes
>  >
>
>
>
>  --
>  ~Kevin
>
>  If you received this email by mistake, please delete it, cancel your mail
>  account, destroy your hard drive, silence any witnesses, and burn down the
>  building that you're in.
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Reply via email to