[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Fri Aug 10 20:23:01 UTC 2007


gordonp
Fri Aug 10 16:23:01 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data
In directory dev.open-bio.org:/tmp/cvs-serv3106/src/main/org/biomoby/shared/data

Modified Files:
	MobyDataComposite.java 
Log Message:
Throw explanatory MobyException if the parsed data type is not found in the registry (was causing uninformative NullPointerException before)
moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.17,1.18
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java	2007/07/06 22:06:51	1.17
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java	2007/08/10 20:23:01	1.18
@@ -42,6 +42,14 @@
 	     getName(element), 
 	     getNamespace(element), 
 	     getId(element));
+	if(getDataType() == null){
+	    throw new MobyException("Attempted to build a composite MOBY object from XML, " +
+				    "but the tag (" + element.getLocalName() + ") does not " +
+				    "correspond to an existing data type in the registry (" +
+				    (registry == null ? "default" : registry.getLongName()) + 
+				    ").  Please check the spelling and capitalization of the " +
+				    "XML tag, to match a registered data type.");
+	}
 
 	populateMembersFromDOM(element, registry);
     }




More information about the MOBY-guts mailing list