[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Fri Apr 27 13:45:29 UTC 2007


gordonp
Fri Apr 27 09:45:29 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data
In directory dev.open-bio.org:/tmp/cvs-serv3338/src/main/org/biomoby/shared/data

Modified Files:
	MobyDataObject.java 
Log Message:
Workaround for namespace setting quirks of MobyPrimaryDataSimple
moby-live/Java/src/main/org/biomoby/shared/data MobyDataObject.java,1.14,1.15
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java	2007/03/12 17:03:24	1.14
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java	2007/04/27 13:45:29	1.15
@@ -519,7 +519,8 @@
      */
     public void setPrimaryNamespace(MobyNamespace ns){
 	MobyNamespace[] nss = getNamespaces();
-	if(nss == null || nss.length == 0){
+	// special case, if no namespace already, simply add this one
+	if(nss == null || nss.length == 0 || nss[0].getName().length() == 0){
 	    addNamespace(ns);
 	    return;
 	}
@@ -532,6 +533,7 @@
 		    // Swap'em
 		    nss[i] = nss[0];
 		    nss[0] = ns;
+		    setNamespaces(null);
 		    setNamespaces(nss);
 		}
 		//It's in slot 0 as it should be
@@ -543,6 +545,7 @@
 	// Prepend the namespace to the array
 	newnss[0] = ns;
 	System.arraycopy(nss, 0, newnss, 1, nss.length);
+	setNamespaces(null);
 	setNamespaces(newnss);
     }
 




More information about the MOBY-guts mailing list