Skip to content

Commit 6f48238

Browse files
committed
Call static APIs directly
1 parent c7de56e commit 6f48238

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

src/test/java/org/apache/commons/cli/bug/BugCLI13Test.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,14 @@ class BugCLI13Test {
3434
@Test
3535
void testCLI13() throws ParseException {
3636
final String debugOpt = "debug";
37-
@SuppressWarnings("static-access")
38-
//@formatter:off
39-
final Option debug = OptionBuilder
40-
.withArgName(debugOpt)
41-
.withDescription("turn on debugging")
42-
.withLongOpt(debugOpt)
43-
.hasArg()
44-
.create('d');
45-
//@formatter:on
37+
OptionBuilder.withArgName(debugOpt);
38+
OptionBuilder.withDescription("turn on debugging");
39+
OptionBuilder.withLongOpt(debugOpt);
40+
OptionBuilder.hasArg();
41+
final Option debug = OptionBuilder.create('d');
4642
final Options options = new Options();
4743
options.addOption(debug);
48-
final CommandLine commandLine = new PosixParser().parse(options, new String[] {"-d", "true"});
49-
44+
final CommandLine commandLine = new PosixParser().parse(options, new String[] { "-d", "true" });
5045
assertEquals("true", commandLine.getOptionValue(debugOpt));
5146
assertEquals("true", commandLine.getOptionValue('d'));
5247
assertTrue(commandLine.hasOption('d'));

0 commit comments

Comments
 (0)