Merge branch 'develop' into bug/JAL-2255_seq-fetcher-broken-on-linux
[jalview.git] / src / jalview / io / packed / ParsePackedSet.java
index 71999f0..138fef7 100644 (file)
@@ -23,6 +23,7 @@ package jalview.io.packed;
 import jalview.api.FeatureColourI;
 import jalview.datamodel.AlignmentI;
 import jalview.io.AppletFormatAdapter;
+import jalview.io.FileFormatI;
 import jalview.io.FileParse;
 import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
@@ -64,7 +65,7 @@ public class ParsePackedSet
       FileParse src = dta.getDataSource();
       if (dta.getType().equals(DataProvider.JvDataType.ALIGNMENT))
       {
-        String fmt = null;
+        FileFormatI fmt = null;
         try
         {
           fmt = new IdentifyFile().identify(src, false);
@@ -76,32 +77,24 @@ public class ParsePackedSet
 
         if (fmt != null)
         {
-          if (!FormatAdapter.isValidIOFormat(fmt, false))
+          // parse the alignment
+          AlignmentI al = null;
+          try
           {
-            errmsg = fmt;
-            exerror = null;
+            al = new FormatAdapter().readFromFile(src, fmt);
+          } catch (Exception e)
+          {
+            errmsg = "Failed to parse alignment from result set";
+            exerror = e;
           }
-          else
+          if (al != null)
           {
-            // parse the alignment
-            AlignmentI al = null;
-            try
-            {
-              al = new FormatAdapter().readFromFile(src, fmt);
-            } catch (Exception e)
-            {
-              errmsg = "Failed to parse alignment from result set";
-              exerror = e;
-            }
-            if (al != null)
-            {
-              // deuniquify and construct/merge additional dataset entries if
-              // necessary.
-              context.addAlignment(al);
-              context.updateSetModified(true);
-              rslt.add(al);
-              deuniquify = true;
-            }
+            // deuniquify and construct/merge additional dataset entries if
+            // necessary.
+            context.addAlignment(al);
+            context.updateSetModified(true);
+            rslt.add(al);
+            deuniquify = true;
           }
         }
       }