JAL-3210 Merge branch 'develop' into trialMerge
[jalview.git] / src / jalview / io / SequenceAnnotationReport.java
index dd09d03..2381ecf 100644 (file)
@@ -53,9 +53,7 @@ public class SequenceAnnotationReport
 
   private static final int MAX_SOURCES = 40;
 
-  private static final String[][] PRIMARY_SOURCES = new String[][] {
-      DBRefSource.CODINGDBS, DBRefSource.DNACODINGDBS,
-      DBRefSource.PROTEINDBS };
+ // public static final String[][] PRIMARY_SOURCES  moved to DBRefSource.java
 
   final String linkImageURL;
 
@@ -79,8 +77,8 @@ public class SequenceAnnotationReport
       }
       String s1 = ref1.getSource();
       String s2 = ref2.getSource();
-      boolean s1Primary = isPrimarySource(s1);
-      boolean s2Primary = isPrimarySource(s2);
+      boolean s1Primary = DBRefSource.isPrimarySource(s1);
+      boolean s2Primary = DBRefSource.isPrimarySource(s2);
       if (s1Primary && !s2Primary)
       {
         return -1;
@@ -101,20 +99,20 @@ public class SequenceAnnotationReport
       return comp;
     }
 
-    private boolean isPrimarySource(String source)
-    {
-      for (String[] primary : PRIMARY_SOURCES)
-      {
-        for (String s : primary)
-        {
-          if (source.equals(s))
-          {
-            return true;
-          }
-        }
-      }
-      return false;
-    }
+//    private boolean isPrimarySource(String source)
+//    {
+//      for (String[] primary : DBRefSource.PRIMARY_SOURCES)
+//      {
+//        for (String s : primary)
+//        {
+//          if (source.equals(s))
+//          {
+//            return true;
+//          }
+//        }
+//      }
+//      return false;
+//    }
   };
 
   public SequenceAnnotationReport(String linkURL)
@@ -395,14 +393,14 @@ public class SequenceAnnotationReport
   protected int appendDbRefs(final StringBuilder sb, SequenceI ds,
           boolean summary)
   {
-    DBRefEntry[] dbrefs = ds.getDBRefs();
+    List<DBRefEntry> dbrefs = ds.getDBRefs();
     if (dbrefs == null)
     {
       return 0;
     }
 
     // note this sorts the refs held on the sequence!
-    Arrays.sort(dbrefs, comparator);
+    dbrefs.sort(comparator);
     boolean ellipsis = false;
     String source = null;
     String lastSource = null;