Merge pull request #15142 from ayudovin
* pr/15142: Use varargs for DefaultApplicationArguments
This commit is contained in:
@@ -37,7 +37,7 @@ public class DefaultApplicationArguments implements ApplicationArguments {
|
||||
|
||||
private final String[] args;
|
||||
|
||||
public DefaultApplicationArguments(String[] args) {
|
||||
public DefaultApplicationArguments(String... args) {
|
||||
Assert.notNull(args, "Args must not be null");
|
||||
this.source = new Source(args);
|
||||
this.args = args;
|
||||
|
||||
@@ -80,8 +80,7 @@ public class DefaultApplicationArgumentsTests {
|
||||
|
||||
@Test
|
||||
public void getNoNonOptionArgs() {
|
||||
ApplicationArguments arguments = new DefaultApplicationArguments(
|
||||
new String[] { "--debug" });
|
||||
ApplicationArguments arguments = new DefaultApplicationArguments("--debug");
|
||||
assertThat(arguments.getNonOptionArgs()).isEmpty();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user