JAL-3662 JAL-3660 JAL-3561 source formatting
authorJim Procter <jprocter@issues.jalview.org>
Wed, 17 Jun 2020 12:49:24 +0000 (13:49 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 17 Jun 2020 12:49:24 +0000 (13:49 +0100)
src/jalview/bin/Jalview.java

index b8aa928..4f76776 100755 (executable)
@@ -981,8 +981,7 @@ public class Jalview implements ApplicationSingletonI
    * @param aparser
    * @param format
    */
-  private void createOutputFiles(ArgsParser aparser,
-          FileFormatI format)
+  private void createOutputFiles(ArgsParser aparser, FileFormatI format)
   {
     AlignFrame af = currentAlignFrame;
     while (aparser.getSize() >= 2)
@@ -1037,37 +1036,45 @@ public class Jalview implements ApplicationSingletonI
                 "Creating image map: " + imageFile.getAbsolutePath());
         continue;
       default:
-         // fall through - try to parse as an alignment data export format
-          FileFormatI outFormat=null;
-          try {
-            outFormat = FileFormats.getInstance().forName(outputFormat);
-          } catch (Exception formatP) {
-          }
-          if (outFormat==null) {
-            System.out.println("Couldn't parse "+outputFormat+" as a valid Jalview format string.");
-           continue;
-         }
-          if (!outFormat.isWritable())
-          {
-            System.out.println(
-                    "This version of Jalview does not support alignment export as "
-                            + outputFormat);
-           continue;
-          }
-          // record file as it was passed to Jalview so it is recognisable to the CLI caller
-          String file;
-         fname = new File(file=aparser.nextValue()).getAbsolutePath();
-         // JBPNote - yuck - really wish we did have a bean returned from this which gave success/fail like before !
-         af.saveAlignment(fname, outFormat);
-         if (!af.isSaveAlignmentSuccessful())
-          {
-              System.out.println("Written alignment in " + outputFormat
-                      + " format to " + file);
-             continue;
-          } else {
-                System.out.println("Error writing file " + file + " in "
-                        + outputFormat + " format!!");
-          }
+        // fall through - try to parse as an alignment data export format
+        FileFormatI outFormat = null;
+        try
+        {
+          outFormat = FileFormats.getInstance().forName(outputFormat);
+        } catch (Exception formatP)
+        {
+        }
+        if (outFormat == null)
+        {
+          System.out.println("Couldn't parse " + outputFormat
+                  + " as a valid Jalview format string.");
+          continue;
+        }
+        if (!outFormat.isWritable())
+        {
+          System.out.println(
+                  "This version of Jalview does not support alignment export as "
+                          + outputFormat);
+          continue;
+        }
+        // record file as it was passed to Jalview so it is recognisable to the CLI
+        // caller
+        String file;
+        fname = new File(file = aparser.nextValue()).getAbsolutePath();
+        // JBPNote - yuck - really wish we did have a bean returned from this which gave
+        // success/fail like before !
+        af.saveAlignment(fname, outFormat);
+        if (!af.isSaveAlignmentSuccessful())
+        {
+          System.out.println("Written alignment in " + outputFormat
+                  + " format to " + file);
+          continue;
+        }
+        else
+        {
+          System.out.println("Error writing file " + file + " in "
+                  + outputFormat + " format!!");
+        }
       }
     }
     // ??? Should report - 'ignoring' extra args here...