Merge branch '1.5.x'

This commit is contained in:
Phillip Webb
2017-12-13 13:07:18 -08:00
14 changed files with 124 additions and 44 deletions

View File

@@ -16,8 +16,9 @@
package org.springframework.boot.cli;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.boot.cli.command.Command;
@@ -38,14 +39,24 @@ import org.springframework.boot.cli.command.run.RunCommand;
*/
public class DefaultCommandFactory implements CommandFactory {
private static final List<Command> defaultCommands = Arrays.asList(
new VersionCommand(), new RunCommand(), new GrabCommand(), new JarCommand(),
new WarCommand(), new InstallCommand(), new UninstallCommand(),
new InitCommand());
private static final List<Command> DEFAULT_COMMANDS;
static {
ArrayList<Command> defaultCommands = new ArrayList<>();
defaultCommands.add(new VersionCommand());
defaultCommands.add(new RunCommand());
defaultCommands.add(new GrabCommand());
defaultCommands.add(new JarCommand());
defaultCommands.add(new WarCommand());
defaultCommands.add(new InstallCommand());
defaultCommands.add(new UninstallCommand());
defaultCommands.add(new InitCommand());
DEFAULT_COMMANDS = Collections.unmodifiableList(defaultCommands);
}
@Override
public Collection<Command> getCommands() {
return defaultCommands;
return DEFAULT_COMMANDS;
}
}