[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Mon Jan 7 22:09:49 UTC 2008
gordonp
Mon Jan 7 17:09:49 EST 2008
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data
In directory dev.open-bio.org:/tmp/cvs-serv15563/src/main/org/biomoby/shared/data
Modified Files:
MobyDataXref.java
Log Message:
Added support for non-registered services in Xref (doesn't cause exception anymore, but rather just has an info-poor MobyService object)
moby-live/Java/src/main/org/biomoby/shared/data MobyDataXref.java,1.8,1.9
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataXref.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/shared/data/MobyDataXref.java 2007/12/09 00:23:49 1.8
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataXref.java 2008/01/07 22:09:49 1.9
@@ -71,7 +71,12 @@
public MobyDataXref(String namespace, String id, String serviceName, String authURI, Registry registry){
super("", id, new MobyService[] {MobyService.getService(serviceName, authURI)}, registry);
addNamespace(MobyNamespace.getNamespace(namespace));
- getService().setAuthority(authURI);
+ MobyService s = getService();
+ if(s == null){ // the service name given didn't resolve to something in the registry
+ s = new MobyService(serviceName, authURI); // make an explicit info-void one instead
+ System.err.println("Created token service object for unresolvable xref service '"+serviceName+"'");
+ setServices(new MobyService[]{s});
+ }
}
public MobyDataXref(Element e) throws MobyException{
@@ -263,7 +268,7 @@
return xrefType;
}
- public Object clone(){
+ public MobyDataXref clone(){
return new MobyDataXref(getNamespace(), getId(), getService());
}
More information about the MOBY-guts
mailing list