[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Wed Sep 10 19:36:45 UTC 2008


gordonp
Wed Sep 10 15:36:44 EDT 2008
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data
In directory dev.open-bio.org:/tmp/cvs-serv27430/src/main/org/biomoby/shared/data

Modified Files:
	MobyDataComposite.java 
Log Message:
Added support for put() in datatypes not found in the registry (i.e. the HAS/HAS-A relationship for the member is not validated)
moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.26,1.27
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java	2008/02/13 09:26:08	1.26
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java	2008/09/10 19:36:44	1.27
@@ -418,7 +418,17 @@
 
 	MobyRelationship relationship = getDataType().getChild(fieldName);
 	if(relationship == null){
-	    relationship = MobyDataType.getDataType(getDataType().getName(), getDataType().getRegistry()).getChild(fieldName);
+	    MobyDataType t = MobyDataType.getDataType(getDataType().getName(), getDataType().getRegistry());
+	    if(t == null){
+		System.err.println("Data type " + getDataType().getName() + " is not in the registry: " +
+                                   "validity of member put() operation will not be confirmed");
+		relationship = new MobyRelationship(fieldName, 
+						    value.getDataType().getName(), 
+						    members.containsKey(fieldName) ? Central.iHAS : Central.iHASA);
+	    }
+	    else{
+		relationship = t.getChild(fieldName);
+	    }
 	    if(relationship == null){
 		String memberNames = "";
 		for(MobyRelationship rel: getDataType().getChildren()){




More information about the MOBY-guts mailing list