Use varargs for DefaultApplicationArguments

Closes gh-15142
pull/15385/head
artsiom 6 years ago committed by Stephane Nicoll
parent 389ab9579f
commit e2d5dfad3a

@ -37,7 +37,7 @@ public class DefaultApplicationArguments implements ApplicationArguments {
private final String[] args; private final String[] args;
public DefaultApplicationArguments(String[] args) { public DefaultApplicationArguments(String... args) {
Assert.notNull(args, "Args must not be null"); Assert.notNull(args, "Args must not be null");
this.source = new Source(args); this.source = new Source(args);
this.args = args; this.args = args;

@ -80,8 +80,7 @@ public class DefaultApplicationArgumentsTests {
@Test @Test
public void getNoNonOptionArgs() { public void getNoNonOptionArgs() {
ApplicationArguments arguments = new DefaultApplicationArguments( ApplicationArguments arguments = new DefaultApplicationArguments("--debug");
new String[] { "--debug" });
assertThat(arguments.getNonOptionArgs()).isEmpty(); assertThat(arguments.getNonOptionArgs()).isEmpty();
} }

Loading…
Cancel
Save