From c84d2601499c7d332cfd208f589686af8e3b1a20 Mon Sep 17 00:00:00 2001 From: James Procter Date: Tue, 24 Jan 2023 07:46:34 +0000 Subject: [PATCH] JAL-629 labelled breaks are frowned upon by everyone --- src/jalview/bin/ArgParser.java | 12 ++++++------ src/jalview/bin/Commands.java | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/jalview/bin/ArgParser.java b/src/jalview/bin/ArgParser.java index 4cdfd19..4d37847 100644 --- a/src/jalview/bin/ArgParser.java +++ b/src/jalview/bin/ArgParser.java @@ -454,7 +454,7 @@ public class ArgParser // new style Enumeration argE = Collections.enumeration(Arrays.asList(args)); - ARG: while (argE.hasMoreElements()) + while (argE.hasMoreElements()) { String arg = argE.nextElement(); String argName = null; @@ -497,14 +497,14 @@ public class ArgParser { // arg not found Console.error("Argument '" + arg + "' not recognised. Ignoring."); - continue ARG; + continue; } if (!a.hasOption(Opt.BOOLEAN) && negated) { // used "no" with a non-boolean option Console.error("Argument '--" + NEGATESTRING + argName + "' not a boolean option. Ignoring."); - continue ARG; + continue; } if (!a.hasOption(Opt.STRING) && equalPos > -1) { @@ -512,7 +512,7 @@ public class ArgParser Console.error("Argument '--" + argName + "' does not expect a value (given as '" + arg + "'). Ignoring."); - continue ARG; + continue; } if (!a.hasOption(Opt.LINKED) && linkedId != null) { @@ -520,7 +520,7 @@ public class ArgParser Console.error("Argument '--" + argName + "' does not expect a linked id (given as '" + arg + "'). Ignoring."); - continue ARG; + continue; } if (a.hasOption(Opt.STRING) && equalPos == -1) @@ -531,7 +531,7 @@ public class ArgParser // no value to take for arg, which wants a value Console.error("Argument '" + a.getName() + "' requires a value, none given. Ignoring."); - continue ARG; + continue; } val = argE.nextElement(); } diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index c05194d..5b3e199 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -121,11 +121,12 @@ public class Commands boolean first = true; AlignFrame af; - OPEN: for (String openFile : ArgParser.getValues(m, Arg.OPEN)) + for (String openFile : ArgParser.getValues(m, Arg.OPEN)) { if (openFile == null) - continue OPEN; + continue; + argsWereParsed = true; if (first) { first = false; @@ -150,7 +151,6 @@ public class Commands if (!(new File(openFile)).exists()) { Console.warn("Can't find file '" + openFile + "'"); - continue OPEN; } } } @@ -391,7 +391,7 @@ public class Commands AlignFrame af = afMap.get(id); if (ArgParser.getArgValues(m, Arg.STRUCTURE) != null) { - STRUCTURE: for (String val : ArgParser.getValues(m, Arg.STRUCTURE)) + for (String val : ArgParser.getValues(m, Arg.STRUCTURE)) { SubVal subId = new SubVal(val); SequenceI seq = getSpecifiedSequence(af, subId); @@ -421,14 +421,14 @@ public class Commands if (structureFile == null) { Console.warn("Not provided structure file with '" + val + "'"); - continue STRUCTURE; + continue; } if (!structureFile.exists()) { Console.warn("Structure file '" + structureFile.getAbsoluteFile() + "' not found."); - continue STRUCTURE; + continue; } Console.debug("Using structure file " -- 1.7.10.2