[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Thu Oct 26 00:30:27 UTC 2006


gordonp
Wed Oct 25 20:30:27 EDT 2006
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data
In directory dev.open-bio.org:/tmp/cvs-serv14799/src/main/org/biomoby/shared/data

Modified Files:
	MobyDataComposite.java 
Log Message:
Fixed varargs c-tor logic
moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.7,1.8
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java	2006/07/07 04:12:40	1.7
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java	2006/10/26 00:30:27	1.8
@@ -89,6 +89,12 @@
      */
     public MobyDataComposite(MobyDataType type, MobyNamespace namespace, String id, Object... memberStrings) throws IllegalArgumentException, MobyException{
 	super(namespace.getName(), id);
+	
+	if(type == null){
+	    throw new IllegalArgumentException("MOBY data type given in composite object " +
+					       "constructor was null (not in the ontology?)");
+	}
+
 	setDataType(type);
 	members = new ConcurrentHashMap<String, MobyDataObject>();
 
@@ -111,7 +117,8 @@
 	    // which will be the basis for the member.
 	    else{
 		put(children[0].getName(), 
-		    MobyDataObject.createInstanceFromString(children[0].getName(), memberStrings[0].toString()));
+		    MobyDataObject.createInstanceFromString(children[0].getDataTypeName(), 
+							    memberStrings[0].toString()));
 	    }
 	    return;
 	}
@@ -124,7 +131,7 @@
 	    }
 	    String name = (String) arg1;
 
-	    Object arg2 = memberStrings[i++];
+	    Object arg2 = memberStrings[++i];
 
 	    for(int j = 0; i < memberStrings.length && j < children.length; j++){
 		MobyRelationship relationship = children[j];




More information about the MOBY-guts mailing list