Skip to content

Commit 88916aa

Browse files
authored
minor changes (#1336)
1 parent b1e8d6a commit 88916aa

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerClientsProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2021 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
3434
@ConfigurationProperties("spring.cloud.loadbalancer")
3535
public class LoadBalancerClientsProperties extends LoadBalancerProperties {
3636

37-
private Map<String, LoadBalancerProperties> clients = new HashMap<>();
37+
private final Map<String, LoadBalancerProperties> clients = new HashMap<>();
3838

3939
public Map<String, LoadBalancerProperties> getClients() {
4040
return this.clients;

spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerInterceptor.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,9 +33,9 @@
3333
*/
3434
public class LoadBalancerInterceptor implements ClientHttpRequestInterceptor {
3535

36-
private LoadBalancerClient loadBalancer;
36+
private final LoadBalancerClient loadBalancer;
3737

38-
private LoadBalancerRequestFactory requestFactory;
38+
private final LoadBalancerRequestFactory requestFactory;
3939

4040
public LoadBalancerInterceptor(LoadBalancerClient loadBalancer, LoadBalancerRequestFactory requestFactory) {
4141
this.loadBalancer = loadBalancer;
@@ -48,12 +48,12 @@ public LoadBalancerInterceptor(LoadBalancerClient loadBalancer) {
4848
}
4949

5050
@Override
51-
public ClientHttpResponse intercept(final HttpRequest request, final byte[] body,
52-
final ClientHttpRequestExecution execution) throws IOException {
53-
final URI originalUri = request.getURI();
51+
public ClientHttpResponse intercept(HttpRequest request, byte[] body,
52+
ClientHttpRequestExecution execution) throws IOException {
53+
URI originalUri = request.getURI();
5454
String serviceName = originalUri.getHost();
5555
Assert.state(serviceName != null, "Request URI does not contain a valid hostname: " + originalUri);
56-
return this.loadBalancer.execute(serviceName, this.requestFactory.createRequest(request, body, execution));
56+
return loadBalancer.execute(serviceName, requestFactory.createRequest(request, body, execution));
5757
}
5858

5959
}

0 commit comments

Comments
 (0)