Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,8 +18,6 @@

import java.io.File;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -202,7 +200,7 @@ public static class Diskspace {
/**
* List of paths to report disk metrics for.
*/
private List<File> paths = new ArrayList<>(Collections.singletonList(new File(".")));
private List<File> paths = List.of(new File("."));

public List<File> getPaths() {
return this.paths;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,6 @@

package org.springframework.boot.actuate.autoconfigure.web.exchanges;

import java.util.HashSet;
import java.util.Set;

import org.springframework.boot.actuate.web.exchanges.Include;
Expand Down Expand Up @@ -53,7 +52,7 @@ public static class Recording {
* (excluding Authorization and Cookie), response headers (excluding Set-Cookie),
* and time taken.
*/
private Set<Include> include = new HashSet<>(Include.defaultIncludes());
private Set<Include> include = Include.defaultIncludes();

public Set<Include> getInclude() {
return this.include;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,6 @@
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
Expand All @@ -44,7 +43,7 @@ public class MessageSourceProperties {
* locations. If it doesn't contain a package qualifier (such as "org.mypackage"), it
* will be resolved from the classpath root.
*/
private List<String> basename = new ArrayList<>(List.of("messages"));
private List<String> basename = List.of("messages");

/**
* List of locale-independent property file resources containing common messages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,8 +17,6 @@
package org.springframework.boot.autoconfigure.elasticsearch;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
Expand All @@ -35,7 +33,7 @@ public class ElasticsearchProperties {
/**
* List of the Elasticsearch instances to use.
*/
private List<String> uris = new ArrayList<>(Collections.singletonList("http://localhost:9200"));
private List<String> uris = List.of("http://localhost:9200");

/**
* Username for authentication with Elasticsearch.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -57,7 +56,7 @@ public class FlywayProperties {
* Locations of migrations scripts. Can contain the special "{vendor}" placeholder to
* use vendor-specific locations.
*/
private List<String> locations = new ArrayList<>(Collections.singletonList("classpath:db/migration"));
private List<String> locations = List.of("classpath:db/migration");

/**
* Encoding of SQL migrations.
Expand Down Expand Up @@ -157,7 +156,7 @@ public class FlywayProperties {
/**
* File name suffix for SQL migrations.
*/
private List<String> sqlMigrationSuffixes = new ArrayList<>(Collections.singleton(".sql"));
private List<String> sqlMigrationSuffixes = List.of(".sql");

/**
* File name separator for SQL migrations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,8 +19,6 @@
import java.io.IOException;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -69,7 +67,7 @@ public class KafkaProperties {
* List of host:port pairs to use for establishing the initial connections to the
* Kafka cluster. Applies to all components unless overridden.
*/
private List<String> bootstrapServers = new ArrayList<>(Collections.singletonList("localhost:9092"));
private List<String> bootstrapServers = List.of("localhost:9092");

/**
* ID to pass to the server when making requests. Used for server-side logging.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,8 +17,6 @@
package org.springframework.boot.autoconfigure.quartz;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -155,7 +153,7 @@ public static class Jdbc {
/**
* Prefixes for single-line comments in SQL initialization scripts.
*/
private List<String> commentPrefix = new ArrayList<>(Arrays.asList("#", "--"));
private List<String> commentPrefix = List.of("#", "--");

public String getSchema() {
return this.schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -146,7 +146,7 @@ public List<String> getRoles() {
}

public void setRoles(List<String> roles) {
this.roles = new ArrayList<>(roles);
this.roles = roles;
}

public boolean isPasswordGenerated() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,16 +16,14 @@

package org.springframework.boot.docs.appendix.configurationmetadata.annotationprocessor.automaticmetadatageneration;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "my.messaging")
public class MyMessagingProperties {

private List<String> addresses = new ArrayList<>(Arrays.asList("a", "b"));
private List<String> addresses = List.of("a", "b");

private ContainerType containerType = ContainerType.SIMPLE;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,8 +17,6 @@
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.javabeanbinding;

import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
Expand Down Expand Up @@ -60,7 +58,7 @@ public static class Security {

private String password;

private List<String> roles = new ArrayList<>(Collections.singleton("USER"));
private List<String> roles = List.of("USER");

// @fold:on // getters / setters...
public String getUsername() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -146,7 +146,7 @@ Set<String> getSources() {
}

void setSources(Set<String> sources) {
this.sources = new LinkedHashSet<>(sources);
this.sources = sources;
}

WebApplicationType getWebApplicationType() {
Expand Down
Loading