JAL-1705 regular expression updates, tests, other refactoring
[jalview.git] / src / jalview / gui / SequenceFetcher.java
index 257beba..fc6fb0d 100755 (executable)
@@ -22,7 +22,6 @@ package jalview.gui;
 
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 import jalview.io.FormatAdapter;
@@ -551,7 +550,7 @@ public class SequenceFetcher extends JPanel implements Runnable
                             Integer.valueOf(nqueries).toString(),
                             proxy.getDbName() }), Thread.currentThread()
                         .hashCode());
-        isAliSource = proxy.isA(DBRefSource.ALIGNMENTDB);
+        isAliSource = proxy.isAlignmentSource();
         if (proxy.getAccessionSeparator() == null)
         {
           while (en.hasNext())
@@ -638,20 +637,19 @@ public class SequenceFetcher extends JPanel implements Runnable
                 DBRefEntry dbr = new DBRefEntry(), found[] = null;
                 dbr.setSource(proxy.getDbSource());
                 dbr.setVersion(null);
-                String accId = DBRefUtils.processQueryToAccessionFor(proxy,
-                        q);
+                String accId = proxy.getAccessionIdFromQuery(q);
                 dbr.setAccessionId(accId);
                 boolean rfound = false;
                 for (int r = 0; r < rs.length; r++)
                 {
-                  if (rs[r] != null
-                          && (found = DBRefUtils.searchRefs(
-                                  rs[r].getDBRef(), dbr)) != null
-                          && found.length > 0)
+                  if (rs[r] != null)
                   {
-                    rfound = true;
-                    rs[r] = null;
-                    continue;
+                    found = DBRefUtils.searchRefs(rs[r].getDBRefs(), accId);
+                    if (found != null && found.length > 0)
+                    {
+                      rfound = true;
+                      rs[r] = null;
+                    }
                   }
                 }
                 if (!rfound)
@@ -775,7 +773,7 @@ public class SequenceFetcher extends JPanel implements Runnable
 
   AlignmentI parseResult(String result, String title)
   {
-    String format = new IdentifyFile().Identify(result, "Paste");
+    String format = new IdentifyFile().identify(result, "Paste");
     AlignmentI sequences = null;
     if (FormatAdapter.isValidFormat(format))
     {