Use interfaces for collection declarations

Closes gh-11839
This commit is contained in:
dreis2211 2018-01-29 22:31:10 +01:00 committed by Phillip Webb
parent 9a8c182d19
commit e7248ff273
7 changed files with 7 additions and 7 deletions

View File

@ -40,7 +40,7 @@ public final class Info {
private final Map<String, Object> details; private final Map<String, Object> details;
private Info(Builder builder) { private Info(Builder builder) {
LinkedHashMap<String, Object> content = new LinkedHashMap<>(); Map<String, Object> content = new LinkedHashMap<>();
content.putAll(builder.content); content.putAll(builder.content);
this.details = Collections.unmodifiableMap(content); this.details = Collections.unmodifiableMap(content);
} }

View File

@ -42,7 +42,7 @@ public class DefaultCommandFactory implements CommandFactory {
private static final List<Command> DEFAULT_COMMANDS; private static final List<Command> DEFAULT_COMMANDS;
static { static {
ArrayList<Command> defaultCommands = new ArrayList<>(); List<Command> defaultCommands = new ArrayList<>();
defaultCommands.add(new VersionCommand()); defaultCommands.add(new VersionCommand());
defaultCommands.add(new RunCommand()); defaultCommands.add(new RunCommand());
defaultCommands.add(new GrabCommand()); defaultCommands.add(new GrabCommand());

View File

@ -93,7 +93,7 @@ class ServiceCapabilitiesReportGenerator {
} }
private List<Dependency> getSortedDependencies(InitializrServiceMetadata metadata) { private List<Dependency> getSortedDependencies(InitializrServiceMetadata metadata) {
ArrayList<Dependency> dependencies = new ArrayList<>(metadata.getDependencies()); List<Dependency> dependencies = new ArrayList<>(metadata.getDependencies());
dependencies.sort(Comparator.comparing(Dependency::getId)); dependencies.sort(Comparator.comparing(Dependency::getId));
return dependencies; return dependencies;
} }

View File

@ -150,7 +150,7 @@ public class OptionHandler {
private static class OptionHelpAdapter implements OptionHelp { private static class OptionHelpAdapter implements OptionHelp {
private final LinkedHashSet<String> options; private final Set<String> options;
private final String description; private final String description;

View File

@ -167,7 +167,7 @@ public abstract class AstUtils {
private static List<ExpressionStatement> getExpressionStatements( private static List<ExpressionStatement> getExpressionStatements(
BlockStatement block) { BlockStatement block) {
ArrayList<ExpressionStatement> statements = new ArrayList<>(); List<ExpressionStatement> statements = new ArrayList<>();
for (Statement statement : block.getStatements()) { for (Statement statement : block.getStatements()) {
if (statement instanceof ExpressionStatement) { if (statement instanceof ExpressionStatement) {
statements.add((ExpressionStatement) statement); statements.add((ExpressionStatement) statement);

View File

@ -257,7 +257,7 @@ public class GroovyCompiler {
}); });
} }
private int getIndexOfASTTransformationVisitor(LinkedList<?> conversionOperations) { private int getIndexOfASTTransformationVisitor(List<?> conversionOperations) {
for (int index = 0; index < conversionOperations.size(); index++) { for (int index = 0; index < conversionOperations.size(); index++) {
if (conversionOperations.get(index).getClass().getName() if (conversionOperations.get(index).getClass().getName()
.startsWith(ASTTransformationVisitor.class.getName())) { .startsWith(ASTTransformationVisitor.class.getName())) {

View File

@ -424,7 +424,7 @@ public class SpringApplicationBuilder {
} }
private Map<String, Object> getMapFromProperties(Properties properties) { private Map<String, Object> getMapFromProperties(Properties properties) {
HashMap<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
for (Object key : Collections.list(properties.propertyNames())) { for (Object key : Collections.list(properties.propertyNames())) {
map.put((String) key, properties.get(key)); map.put((String) key, properties.get(key));
} }