JAL-2110 random stuff
[jalview.git] / src / jalview / analysis / CrossRefs.java
index 7d0c263..0f3f425 100644 (file)
@@ -49,6 +49,8 @@ public class CrossRefs
     List<SequenceI> foundSeqs = new ArrayList<SequenceI>();
     AlignedCodonFrame mappings = new AlignedCodonFrame();
 
+    List<DBRefEntry> sourceRefs = new ArrayList<DBRefEntry>();
+
     for (SequenceI seq : seqs)
     {
       if (dna != Comparison.isNucleotide(seq))
@@ -62,28 +64,27 @@ public class CrossRefs
       /*
        * get this sequence's dbrefs to source database (if any)
        */
-      List<DBRefEntry> sourceRefs = DBRefUtils.searchRefsForSource(
+      List<DBRefEntry> seqSourceRefs = DBRefUtils.searchRefsForSource(
               seq.getDBRefs(), source);
 
       /*
        * first extract any mapped sequences from sourceRefs
        */
-      findMappedDbrefs(seq, sourceRefs, foundSeqs, mappings);
+      findMappedDbrefs(seq, seqSourceRefs, foundSeqs, mappings);
 
       /*
        * for remaining sourceRefs, try to match a 
        * complementary sequence in the dataset
        */
-      findIndirectCrossReferences(seq, source, sourceRefs, dataset,
+      findIndirectCrossReferences(seq, source, seqSourceRefs, dataset,
               foundSeqs, mappings);
-
-      /*
-       * fetch any remaining sourceRefs from the source database
-       */
-      fetchCrossReferences(seq, sourceRefs, foundSeqs, mappings, dna,
-              dataset);
     }
 
+    /*
+     * fetch any remaining sourceRefs from the source database
+     */
+    fetchCrossReferences(sourceRefs, foundSeqs, mappings, dna, dataset);
+
     if (foundSeqs.isEmpty())
     {
       return null;