Skip to content

Commit db2580f

Browse files
committed
Merge pull request spring-projects#11839 from dreis2211
* pr/11839: Use interfaces for collection declarations
2 parents 9a8c182 + e7248ff commit db2580f

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public final class Info {
4040
private final Map<String, Object> details;
4141

4242
private Info(Builder builder) {
43-
LinkedHashMap<String, Object> content = new LinkedHashMap<>();
43+
Map<String, Object> content = new LinkedHashMap<>();
4444
content.putAll(builder.content);
4545
this.details = Collections.unmodifiableMap(content);
4646
}

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class DefaultCommandFactory implements CommandFactory {
4242
private static final List<Command> DEFAULT_COMMANDS;
4343

4444
static {
45-
ArrayList<Command> defaultCommands = new ArrayList<>();
45+
List<Command> defaultCommands = new ArrayList<>();
4646
defaultCommands.add(new VersionCommand());
4747
defaultCommands.add(new RunCommand());
4848
defaultCommands.add(new GrabCommand());

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ServiceCapabilitiesReportGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private void reportAvailableDependencies(InitializrServiceMetadata metadata,
9393
}
9494

9595
private List<Dependency> getSortedDependencies(InitializrServiceMetadata metadata) {
96-
ArrayList<Dependency> dependencies = new ArrayList<>(metadata.getDependencies());
96+
List<Dependency> dependencies = new ArrayList<>(metadata.getDependencies());
9797
dependencies.sort(Comparator.comparing(Dependency::getId));
9898
return dependencies;
9999
}

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public Collection<OptionHelp> getOptionHelp() {
150150

151151
private static class OptionHelpAdapter implements OptionHelp {
152152

153-
private final LinkedHashSet<String> options;
153+
private final Set<String> options;
154154

155155
private final String description;
156156

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public static ClosureExpression getClosure(BlockStatement block, String name,
167167

168168
private static List<ExpressionStatement> getExpressionStatements(
169169
BlockStatement block) {
170-
ArrayList<ExpressionStatement> statements = new ArrayList<>();
170+
List<ExpressionStatement> statements = new ArrayList<>();
171171
for (Statement statement : block.getStatements()) {
172172
if (statement instanceof ExpressionStatement) {
173173
statements.add((ExpressionStatement) statement);

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public void call(SourceUnit source) throws CompilationFailedException {
257257
});
258258
}
259259

260-
private int getIndexOfASTTransformationVisitor(LinkedList<?> conversionOperations) {
260+
private int getIndexOfASTTransformationVisitor(List<?> conversionOperations) {
261261
for (int index = 0; index < conversionOperations.size(); index++) {
262262
if (conversionOperations.get(index).getClass().getName()
263263
.startsWith(ASTTransformationVisitor.class.getName())) {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public SpringApplicationBuilder properties(Properties defaultProperties) {
424424
}
425425

426426
private Map<String, Object> getMapFromProperties(Properties properties) {
427-
HashMap<String, Object> map = new HashMap<>();
427+
Map<String, Object> map = new HashMap<>();
428428
for (Object key : Collections.list(properties.propertyNames())) {
429429
map.put((String) key, properties.get(key));
430430
}

0 commit comments

Comments
 (0)