From: Jim Procter Date: Tue, 7 Jan 2014 12:22:54 +0000 (+0000) Subject: Merge branch 'fix_JAL-1423' into Release_2_8_Branch X-Git-Tag: Release_2_8_0b1~1^2~24 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=17d3ea2201aefcedab0ed6513cbd420f87f8b999;hp=57097562617bf1c3186c6ff00928e85030ed813e;p=jalview.git Merge branch 'fix_JAL-1423' into Release_2_8_Branch --- diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java index 9d044bc..761bcc8 100644 --- a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java +++ b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java @@ -178,13 +178,21 @@ public class DasSourceRegistry implements DasSourceRegistryI, { // get local sources from properties and initialise the local source list String local = jalview.bin.Cache.getProperty("DAS_LOCAL_SOURCE"); + if (local != null) { + int n = 1; StringTokenizer st = new StringTokenizer(local, "\t"); while (st.hasMoreTokens()) { String token = st.nextToken(); int bar = token.indexOf("|"); + if (bar == -1) + { + System.err + .println("Warning: DAS user local source appears to have no nickname (expected a '|' followed by nickname)\nOffending definition: '" + + token + "'"); + } String url = token.substring(bar + 1); boolean features = true, sequence = false; if (url.startsWith("sequence:")) @@ -193,8 +201,25 @@ public class DasSourceRegistry implements DasSourceRegistryI, // this source also serves sequences as well as features sequence = true; } - createLocalSource(url, token.substring(0, bar), sequence, - features); + try + { + if (bar > -1) + { + createLocalSource(url, token.substring(0, bar), sequence, + features); + } + else + { + createLocalSource(url, "User Source" + n, sequence, features); + } + } catch (Exception q) + { + System.err + .println("Unexpected exception when creating local source from '" + + token + "'"); + q.printStackTrace(); + } + n++; } } }