You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by et...@apache.org on 2008/03/13 00:43:32 UTC

svn commit: r636577 - /incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java

Author: etnu
Date: Wed Mar 12 16:43:28 2008
New Revision: 636577

URL: http://svn.apache.org/viewvc?rev=636577&view=rev
Log:
Updated UserPref spec processor to correctly handle missing "datatype" attribute. It will now correctly default to "string" as per the spec rather than throwing an exception.


Modified:
    incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java

Modified: incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java?rev=636577&r1=636576&r2=636577&view=diff
==============================================================================
--- incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java (original)
+++ incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java Wed Mar 12 16:43:28 2008
@@ -156,10 +156,7 @@
     defaultValue = XmlUtil.getAttribute(element, "default_value", "");
     required = XmlUtil.getBoolAttribute(element, "required");
 
-    String dataType = XmlUtil.getAttribute(element, "datatype");
-    if (dataType == null) {
-      throw new SpecParserException("UserPref@datatype is required.");
-    }
+    String dataType = XmlUtil.getAttribute(element, "datatype", "string");
     this.dataType = DataType.parse(dataType);
 
     NodeList children = element.getElementsByTagName("EnumValue");