From 0f54185e0cdf79411f0e5085c5515ae559c9129d Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Wed, 12 Apr 2023 12:44:08 +0100 Subject: [PATCH] JAL-629 Fix non-multi string bootstrap arg bug. --- src/jalview/bin/argparser/BootstrapArgs.java | 4 ++++ test/jalview/bin/argparser/ArgParserTest.java | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/jalview/bin/argparser/BootstrapArgs.java b/src/jalview/bin/argparser/BootstrapArgs.java index 408d85d..4829ef8 100644 --- a/src/jalview/bin/argparser/BootstrapArgs.java +++ b/src/jalview/bin/argparser/BootstrapArgs.java @@ -170,6 +170,10 @@ public class BootstrapArgs { l.addAll(al); } + else if (l.size() == 0 && al.size() > 0) + { + l.add(al.get(0)); + } } /* diff --git a/test/jalview/bin/argparser/ArgParserTest.java b/test/jalview/bin/argparser/ArgParserTest.java index 47d9e24..6d7f88f 100644 --- a/test/jalview/bin/argparser/ArgParserTest.java +++ b/test/jalview/bin/argparser/ArgParserTest.java @@ -82,6 +82,7 @@ public class ArgParserTest if (a == Arg.PROPS) { Properties bP = Cache.bootstrapProperties(b.get(Arg.PROPS)); + Assert.assertNotNull(bP); Assert.assertTrue(other.equals(bP.get(Cache.BOOTSTRAP_TEST))); Assert.assertFalse(bP.contains("NOT" + Cache.BOOTSTRAP_TEST)); } @@ -139,13 +140,14 @@ public class ArgParserTest @DataProvider(name = "argLines") public Object[][] argLines() { - return new Object[][] { + return new Object[][] { { + "--open=test/jalview/bin/argparser/testfiles/test1.fa --props=test/jalview/bin/argparser/testfiles/testProps.jvprops", + Arg.PROPS, "true" }, { "--debug --open=test/jalview/bin/argparser/testfiles/test1.fa", Arg.DEBUG, null }, { "--open=test/jalview/bin/argparser/testfiles/test1.fa --headless", Arg.HEADLESS, null }, - { "--open=test/jalview/bin/argparser/testfiles/test1.fa --props=test/jalview/bin/argparser/testfiles/testProps.jvprops", - Arg.PROPS, "true" }, + { "--argfile test/jalview/bin/argparser/testfiles/argfile0.txt", Arg.ARGFILE, "test/jalview/bin/argparser/testfiles/argfile0.txt" }, -- 1.7.10.2