This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-cli.git
commit 6f48238018d2d47252f18fe03b1009fd0751de7d Author: Gary D. Gregory <[email protected]> AuthorDate: Tue Oct 7 08:26:53 2025 -0400 Call static APIs directly --- .../java/org/apache/commons/cli/bug/BugCLI13Test.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/test/java/org/apache/commons/cli/bug/BugCLI13Test.java b/src/test/java/org/apache/commons/cli/bug/BugCLI13Test.java index d790e8ad..fe43d9d2 100644 --- a/src/test/java/org/apache/commons/cli/bug/BugCLI13Test.java +++ b/src/test/java/org/apache/commons/cli/bug/BugCLI13Test.java @@ -34,19 +34,14 @@ class BugCLI13Test { @Test void testCLI13() throws ParseException { final String debugOpt = "debug"; - @SuppressWarnings("static-access") - //@formatter:off - final Option debug = OptionBuilder - .withArgName(debugOpt) - .withDescription("turn on debugging") - .withLongOpt(debugOpt) - .hasArg() - .create('d'); - //@formatter:on + OptionBuilder.withArgName(debugOpt); + OptionBuilder.withDescription("turn on debugging"); + OptionBuilder.withLongOpt(debugOpt); + OptionBuilder.hasArg(); + final Option debug = OptionBuilder.create('d'); final Options options = new Options(); options.addOption(debug); - final CommandLine commandLine = new PosixParser().parse(options, new String[] {"-d", "true"}); - + final CommandLine commandLine = new PosixParser().parse(options, new String[] { "-d", "true" }); assertEquals("true", commandLine.getOptionValue(debugOpt)); assertEquals("true", commandLine.getOptionValue('d')); assertTrue(commandLine.hasOption('d'));
