Polish
This commit is contained in:
parent
78242cb794
commit
8946c761ee
|
@ -19,7 +19,6 @@ package org.springframework.boot.docker.compose.core;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -40,9 +39,9 @@ import org.springframework.util.StringUtils;
|
|||
*/
|
||||
class DefaultConnectionPorts implements ConnectionPorts {
|
||||
|
||||
private Map<ContainerPort, Integer> mappings = new LinkedHashMap<>();
|
||||
private final Map<ContainerPort, Integer> mappings;
|
||||
|
||||
private Map<Integer, Integer> portMappings = new LinkedHashMap<>();
|
||||
private final Map<Integer, Integer> portMappings;
|
||||
|
||||
DefaultConnectionPorts(DockerCliInspectResponse inspectResponse) {
|
||||
this.mappings = !isHostNetworkMode(inspectResponse)
|
||||
|
@ -128,7 +127,7 @@ class DefaultConnectionPorts implements ConnectionPorts {
|
|||
* @param number the port number
|
||||
* @param protocol the protocol (e.g. tcp)
|
||||
*/
|
||||
static record ContainerPort(int number, String protocol) {
|
||||
record ContainerPort(int number, String protocol) {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
@ -43,7 +43,7 @@ class DefaultRunningService implements RunningService, OriginProvider {
|
|||
|
||||
private final Map<String, String> labels;
|
||||
|
||||
private DockerEnv env;
|
||||
private final DockerEnv env;
|
||||
|
||||
DefaultRunningService(DockerHost host, DockerComposeFile composeFile, DockerCliComposePsResponse composePsResponse,
|
||||
DockerCliInspectResponse inspectResponse) {
|
||||
|
|
|
@ -87,8 +87,7 @@ abstract sealed class DockerCliCommand<R> {
|
|||
return false;
|
||||
}
|
||||
DockerCliCommand<?> other = (DockerCliCommand<?>) obj;
|
||||
boolean result = true;
|
||||
result = result && this.type == other.type;
|
||||
boolean result = this.type == other.type;
|
||||
result = result && this.responseType == other.responseType;
|
||||
result = result && this.listResponse == other.listResponse;
|
||||
result = result && this.command.equals(other.command);
|
||||
|
|
|
@ -34,7 +34,7 @@ final class DockerHost {
|
|||
|
||||
private static final String LOCALHOST = "127.0.0.1";
|
||||
|
||||
private String host;
|
||||
private final String host;
|
||||
|
||||
private DockerHost(String host) {
|
||||
this.host = host;
|
||||
|
|
|
@ -49,7 +49,7 @@ class DockerComposeLifecycleManager {
|
|||
|
||||
private static final Log logger = LogFactory.getLog(DockerComposeLifecycleManager.class);
|
||||
|
||||
private static final Object IGNORE_LABEL = "org.springframework.boot.ignore";
|
||||
private static final String IGNORE_LABEL = "org.springframework.boot.ignore";
|
||||
|
||||
private final File workingDirectory;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ServiceNotReadyException extends RuntimeException {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the service that was not reeady.
|
||||
* Return the service that was not ready.
|
||||
* @return the non-ready service
|
||||
*/
|
||||
public RunningService getService() {
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.springframework.boot.docker.compose.core.RunningService;
|
|||
*/
|
||||
class TcpConnectServiceReadinessCheck implements ServiceReadinessCheck {
|
||||
|
||||
private final String DISABLE_LABEL = "org.springframework.boot.readiness-check.tcp.disable";
|
||||
private static final String DISABLE_LABEL = "org.springframework.boot.readiness-check.tcp.disable";
|
||||
|
||||
private final ReadinessProperties.Tcp properties;
|
||||
|
||||
|
@ -43,7 +43,7 @@ class TcpConnectServiceReadinessCheck implements ServiceReadinessCheck {
|
|||
|
||||
@Override
|
||||
public void check(RunningService service) {
|
||||
if (service.labels().containsKey(this.DISABLE_LABEL)) {
|
||||
if (service.labels().containsKey(DISABLE_LABEL)) {
|
||||
return;
|
||||
}
|
||||
for (int port : service.ports().getAll("tcp")) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
class ElasticsearchEnvironment {
|
||||
|
||||
private String password;
|
||||
private final String password;
|
||||
|
||||
ElasticsearchEnvironment(Map<String, String> env) {
|
||||
Assert.state(!env.containsKey("ELASTIC_PASSWORD_FILE"), "ELASTIC_PASSWORD_FILE is not supported");
|
||||
|
|
|
@ -41,9 +41,9 @@ public class ConnectionFactoryOptionsBuilder {
|
|||
|
||||
private static final String PARAMETERS_LABEL = "org.springframework.boot.r2dbc.parameters";
|
||||
|
||||
private String driver;
|
||||
private final String driver;
|
||||
|
||||
private int sourcePort;
|
||||
private final int sourcePort;
|
||||
|
||||
/**
|
||||
* Create a new {@link JdbcUrlBuilder} instance.
|
||||
|
|
Loading…
Reference in New Issue