[MOBY-guts] biomoby commit

Eddie Kawas kawas at pub.open-bio.org
Fri Mar 24 17:52:38 UTC 2006


kawas
Fri Mar 24 12:52:38 EST 2006
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util
In directory pub.open-bio.org:/tmp/cvs-serv15307/org/biomoby/registry/rdfagent/util

Modified Files:
	SignatureURLConnection.java 
Log Message:
fixed a bug where the rdf is valid RDF, but doesnt contain a valid service description. This resulted in a null pointer exception.

moby-live/Java/src/main/org/biomoby/registry/rdfagent/util SignatureURLConnection.java,1.8,1.9
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/SignatureURLConnection.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/SignatureURLConnection.java	2006/03/02 03:20:52	1.8
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/SignatureURLConnection.java	2006/03/24 17:52:38	1.9
@@ -187,14 +187,20 @@
 				Log.severe("There was something wrong with the model: "
 						+ newline + e.getLocalizedMessage());
 				performURLErrorHandling(url, 501);
+				return new MobyService[]{};
 			}
 
 			Log.info("Parsing complete.");
 			if (parser.isRDFValid()) {
 				// RDF was valid and no bad service found
+				if (services.length == 0) {
+					performURLErrorHandling(url, 501);
+					return services;
+				}
 				if (services != null)
 					return services;
 			} else {
+				Log.info("RDF contained some invalid services.");
 				// RDF was found to contain bad services
 				// process the bad ones and return the good ones.
 				String errors = parser.getErrors();
@@ -218,6 +224,10 @@
 						}
 					}
 				}
+				if (services.length == 0) {
+					performURLErrorHandling(url, 501);
+					return services;
+				}
 				if (services != null)
 					return services;
 			}
@@ -270,7 +280,11 @@
 				central = new CentralDataAccessImpl();
 				int count = central.getErrorCountForURL(url);
 				if (count == 0) {
-					central.insertErrorCountForURL(url, code);
+					if (central.insertErrorCountForURL(url, code)) {
+						Log.info("Error count for " + url + " was inserted! The count is 1.");
+					} else {
+						Log.warning("Error count for " + url + " was not inserted! Make sure that the DB parameters are correct!");
+					}
 				} else {
 					if ((++count) >= Constants.REGISTRY_DEREGISTER_COUNT) {
 						central.deleteErrorCountForURL(url);




More information about the MOBY-guts mailing list