JAL-4366 avoid corrupting map when no complete mapping available for chain to sequence
[jalview.git] / src / jalview / io / JalviewFileChooser.java
index 1a4326c..588a2b8 100755 (executable)
@@ -197,8 +197,9 @@ public class JalviewFileChooser extends JFileChooser
     }
     else
     {
-      System.err.println("JalviewFileChooser arguments mismatch: "
-              + extensions + ", " + descs);
+      jalview.bin.Console
+              .errPrintln("JalviewFileChooser arguments mismatch: "
+                      + extensions + ", " + descs);
     }
   }
 
@@ -286,6 +287,11 @@ public class JalviewFileChooser extends JFileChooser
     alljvf.setExtensionListInDescription(false);
     addChoosableFileFilter(alljvf);
 
+    if (selected == null)
+    {
+      chosen = alljvf;
+    }
+
     for (String[] format : formats)
     {
       JalviewFileFilter jvf = new JalviewFileFilter(format[0], format[1]);
@@ -432,7 +438,7 @@ public class JalviewFileChooser extends JFileChooser
         return FileFormats.getInstance().forName(format);
       } catch (IllegalArgumentException e)
       {
-        System.err.println("Unexpected format: " + format);
+        jalview.bin.Console.errPrintln("Unexpected format: " + format);
       }
     }
     return null;
@@ -486,7 +492,7 @@ public class JalviewFileChooser extends JFileChooser
         }
       } catch (Throwable x)
       {
-        System.err.println(
+        jalview.bin.Console.errPrintln(
                 "Unexpected exception when trying to get filename.");
         x.printStackTrace();
       }