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 Info(Builder builder) {
LinkedHashMap<String, Object> content = new LinkedHashMap<>();
Map<String, Object> content = new LinkedHashMap<>();
content.putAll(builder.content);
this.details = Collections.unmodifiableMap(content);
}

View File

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

View File

@ -93,7 +93,7 @@ class ServiceCapabilitiesReportGenerator {
}
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));
return dependencies;
}

View File

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

View File

@ -167,7 +167,7 @@ public abstract class AstUtils {
private static List<ExpressionStatement> getExpressionStatements(
BlockStatement block) {
ArrayList<ExpressionStatement> statements = new ArrayList<>();
List<ExpressionStatement> statements = new ArrayList<>();
for (Statement statement : block.getStatements()) {
if (statement instanceof ExpressionStatement) {
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++) {
if (conversionOperations.get(index).getClass().getName()
.startsWith(ASTTransformationVisitor.class.getName())) {

View File

@ -424,7 +424,7 @@ public class SpringApplicationBuilder {
}
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())) {
map.put((String) key, properties.get(key));
}