diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationArguments.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationArguments.java index 555a96d5a9..cf23bad446 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationArguments.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationArguments.java @@ -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; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/DefaultApplicationArgumentsTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/DefaultApplicationArgumentsTests.java index 93ae9997b8..45029e476a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/DefaultApplicationArgumentsTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/DefaultApplicationArgumentsTests.java @@ -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(); }