JAL-2418 source formatting
[jalview.git] / src / jalview / analysis / SeqsetUtils.java
index d9df6f8..2b21e5e 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -59,13 +59,19 @@ public class SeqsetUtils
         sfeat.addElement(sfarray[i]);
       }
     }
-    sqinfo.put("SeqFeatures", sfeat);
-    sqinfo.put("PdbId",
-            (seq.getAllPDBEntries() != null) ? seq.getAllPDBEntries()
-                    : new Vector<PDBEntry>());
-    sqinfo.put("datasetSequence",
-            (seq.getDatasetSequence() != null) ? seq.getDatasetSequence()
-                    : new Sequence("THISISAPLACEHOLDER", ""));
+    if (seq.getDatasetSequence() == null)
+    {
+      sqinfo.put("SeqFeatures", sfeat);
+      sqinfo.put("PdbId",
+              (seq.getAllPDBEntries() != null) ? seq.getAllPDBEntries()
+                      : new Vector<PDBEntry>());
+    }
+    else
+    {
+      sqinfo.put("datasetSequence",
+              (seq.getDatasetSequence() != null) ? seq.getDatasetSequence()
+                      : new Sequence("THISISAPLACEHOLDER", ""));
+    }
     return sqinfo;
   }
 
@@ -125,10 +131,14 @@ public class SeqsetUtils
     {
       sq.setDescription(description);
     }
-    if ((seqds != null)
-            && !(seqds.getName().equals("THISISAPLACEHOLDER") && seqds
-                    .getLength() == 0))
+    if ((seqds != null) && !(seqds.getName().equals("THISISAPLACEHOLDER")
+            && seqds.getLength() == 0))
     {
+      if (sfeatures != null)
+      {
+        System.err.println(
+                "Implementation error: setting dataset sequence for a sequence which has sequence features.\n\tDataset sequence features will not be visible.");
+      }
       sq.setDatasetSequence(seqds);
     }
 
@@ -250,8 +260,9 @@ public class SeqsetUtils
     if (unmatched.size() > 0 && !quiet)
     {
       System.err.println("Did not find matches for :");
-      for (Enumeration i = unmatched.elements(); i.hasMoreElements(); System.out
-              .println(((SequenceI) i.nextElement()).getName()))
+      for (Enumeration i = unmatched.elements(); i
+              .hasMoreElements(); System.out
+                      .println(((SequenceI) i.nextElement()).getName()))
       {
         ;
       }