Merge branch 'develop' into bug/JAL-1803_JAL-2157
[jalview.git] / src / jalview / ws / sifts / SiftsClient.java
index dad2b3f..f20954e 100644 (file)
@@ -324,25 +324,24 @@ public class SiftsClient implements SiftsClientI
   public DBRefEntryI getValidSourceDBRef(SequenceI seq)
           throws SiftsException
   {
-    DBRefEntry[] dbRefs = seq.getDBRefs();
-    if (dbRefs == null || dbRefs.length < 1)
+    List<DBRefEntry> dbRefs = seq.getPrimaryDBRefs();
+    if (dbRefs == null || dbRefs.size() < 1)
     {
       throw new SiftsException(
               "Source DBRef could not be determined. DBRefs might not have been retrieved.");
     }
 
-    for (DBRefEntryI dbRef : dbRefs)
+    for (DBRefEntry dbRef : dbRefs)
     {
       if (dbRef == null || dbRef.getAccessionId() == null
               || dbRef.getSource() == null)
       {
         continue;
       }
+      String canonicalSource = DBRefUtils.getCanonicalName(dbRef
+              .getSource());
       if (isValidDBRefEntry(dbRef)
-              && dbRef.isPrimary()
-              && (DBRefUtils.getCanonicalName(dbRef.getSource())
-                      .equalsIgnoreCase(DBRefSource.UNIPROT) || DBRefUtils
-                      .getCanonicalName(dbRef.getSource())
+              && (canonicalSource.equalsIgnoreCase(DBRefSource.UNIPROT) || canonicalSource
                       .equalsIgnoreCase(DBRefSource.PDB)))
       {
         return dbRef;