warning for unresolvable database source strings (or ones which apparently have no...
authorjprocter <Jim Procter>
Thu, 11 Mar 2010 17:18:40 +0000 (17:18 +0000)
committerjprocter <Jim Procter>
Thu, 11 Mar 2010 17:18:40 +0000 (17:18 +0000)
src/jalview/ws/DBRefFetcher.java

index 73d106a..581901a 100644 (file)
@@ -500,27 +500,31 @@ public class DBRefFetcher implements Runnable
       DBRefEntry[] entryRefs = jalview.util.DBRefUtils.selectRefs(entry\r
               .getDBRef(), new String[]\r
       { dbSource });\r
+      if (entryRefs==null) {\r
+        System.err.println("Dud dbSource string ? no entryrefs selected for "+dbSource+ " on "+entry.getName());\r
+        continue;\r
+      }\r
       for (int j = 0; j < entryRefs.length; j++)\r
-      {\r
-        String accessionId = entryRefs[j].getAccessionId(); // .getAccession().elementAt(j).toString();\r
-        // match up on accessionId\r
-        if (seqRefs.containsKey(accessionId.toUpperCase()))\r
         {\r
-          Vector seqs = (Vector) seqRefs.get(accessionId);\r
-          for (int jj = 0; jj < seqs.size(); jj++)\r
+          String accessionId = entryRefs[j].getAccessionId(); // .getAccession().elementAt(j).toString();\r
+          // match up on accessionId\r
+          if (seqRefs.containsKey(accessionId.toUpperCase()))\r
           {\r
-            sequence = (SequenceI) seqs.elementAt(jj);\r
-            if (!sequenceMatches.contains(sequence))\r
+            Vector seqs = (Vector) seqRefs.get(accessionId);\r
+            for (int jj = 0; jj < seqs.size(); jj++)\r
             {\r
-              sequenceMatches.addElement(sequence);\r
+              sequence = (SequenceI) seqs.elementAt(jj);\r
+              if (!sequenceMatches.contains(sequence))\r
+              {\r
+                sequenceMatches.addElement(sequence);\r
+              }\r
             }\r
           }\r
         }\r
-      }\r
-      if (sequenceMatches.size() == 0)\r
-      {\r
-        // failed to match directly on accessionId==query so just compare all\r
-        // sequences to entry\r
+        if (sequenceMatches.size() == 0)\r
+        {\r
+          // failed to match directly on accessionId==query so just compare all\r
+          // sequences to entry\r
         Enumeration e = seqRefs.keys();\r
         while (e.hasMoreElements())\r
         {\r