Commit db2580f8 authored by Phillip Webb's avatar Phillip Webb

Merge pull request #11839 from dreis2211

* pr/11839:
  Use interfaces for collection declarations
parents 9a8c182d e7248ff2
...@@ -40,7 +40,7 @@ public final class Info { ...@@ -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);
} }
......
...@@ -42,7 +42,7 @@ public class DefaultCommandFactory implements CommandFactory { ...@@ -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());
......
...@@ -93,7 +93,7 @@ class ServiceCapabilitiesReportGenerator { ...@@ -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;
} }
......
...@@ -150,7 +150,7 @@ public class OptionHandler { ...@@ -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;
......
...@@ -167,7 +167,7 @@ public abstract class AstUtils { ...@@ -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);
......
...@@ -257,7 +257,7 @@ public class GroovyCompiler { ...@@ -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())) {
......
...@@ -424,7 +424,7 @@ public class SpringApplicationBuilder { ...@@ -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));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment