[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Mon Aug 17 21:27:30 UTC 2009


gordonp
Mon Aug 17 17:27:30 EDT 2009
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services
In directory dev.open-bio.org:/tmp/cvs-serv26087/src/main/ca/ucalgary/seahawk/services

Modified Files:
	MobyClient.java 
Log Message:
Made less verbose, catches null text input, and fixed so primitive rules work properly
moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.22,1.23
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java	2009/06/09 19:25:12	1.22
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java	2009/08/17 21:27:30	1.23
@@ -316,9 +316,9 @@
 			continue;
 		    }
 		    dataTypeString = getDataType(ruleMember);
-		    if(isPrimitiveDataType(dataTypeString)){
-			addMemberMapping(ruleMember, memberMap, dataTypeString);
-		    }
+// 		    if(isPrimitiveDataType(dataTypeString)){
+// 			addMemberMapping(ruleMember, memberMap, dataTypeString);
+// 		    }
 		}
 		else if(isMemberRule(ruleMember)){
 		    addMemberMapping(ruleMember, memberMap, dataTypeString);
@@ -343,7 +343,7 @@
 		if(memberMap.size() != 0){
 		    System.err.println("Warning: ignoring member rules, since " +
 				       "no datatype was defined for the ruleset " +
-				       "(base Obejct will be created)");
+				       "(base Object will be created)");
 		}
 
 		for(int j = 0; j < xpathStrings.size(); j++){
@@ -686,6 +686,9 @@
     public MobyDataObject[] getMobyObjects(String textData, MobyDataType targetDataType, MobyNamespace targetNS){
 	Vector<MobyDataObject> objectVector = new Vector<MobyDataObject>();
 
+	if(textData == null){
+	    return new MobyDataObject[0];
+	}
 	for(Pattern pattern: regexMap.keySet()){
 	    MobyComplexBuilder rule = regexMap.get(pattern);
 	    if((targetDataType == null ||
@@ -709,6 +712,7 @@
 		    }
 		} catch(Throwable t){  // Principally stack overflows
 		    System.err.println("Exception/Error ("+t+") while applying regex '"+pattern.pattern()+"' to text");
+		    t.printStackTrace(System.err);
 		}
 	    }
 	}
@@ -1234,9 +1238,9 @@
 		}
 	    }		
 	}catch(javax.xml.xpath.XPathExpressionException xpe){
-	    System.err.println("Warning: Cannot select nodes due to exception "+
-			       "in XPath expression ("+xpath+"):" + xpe);
-	    xpe.printStackTrace();
+	    //System.err.println("Warning: Cannot select nodes due to exception "+
+	    //"in XPath expression ("+xpath+"):" + xpe);
+	//xpe.printStackTrace();
 	    return new Vector<MobyDataObject>();
 	}catch(MobyException me){
 	    System.err.println("Warning: Cannot create objects from select nodes due " +




More information about the MOBY-guts mailing list