Skip to content

Commit 0066899

Browse files
OlgaMaciaszekspencergibb
authored andcommitted
Reformat.
1 parent 034768b commit 0066899

File tree

259 files changed

+1953
-3378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+1953
-3378
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ protected static class DiscoveryLoadBalancerConfiguration {
6161
@Bean
6262
@ConditionalOnDiscoveryHealthIndicatorEnabled
6363
public DiscoveryClientHealthIndicator discoveryClientHealthIndicator(
64-
ObjectProvider<DiscoveryClient> discoveryClient,
65-
DiscoveryClientHealthIndicatorProperties properties) {
64+
ObjectProvider<DiscoveryClient> discoveryClient, DiscoveryClientHealthIndicatorProperties properties) {
6665
return new DiscoveryClientHealthIndicator(discoveryClient, properties);
6766
}
6867

6968
@Bean
70-
@ConditionalOnProperty(
71-
value = "spring.cloud.discovery.client.composite-indicator.enabled",
69+
@ConditionalOnProperty(value = "spring.cloud.discovery.client.composite-indicator.enabled",
7270
matchIfMissing = true)
7371
@ConditionalOnBean({ DiscoveryHealthIndicator.class })
7472
public DiscoveryCompositeHealthContributor discoveryCompositeHealthContributor(
@@ -78,8 +76,7 @@ public DiscoveryCompositeHealthContributor discoveryCompositeHealthContributor(
7876

7977
@Bean
8078
public HasFeatures commonsFeatures() {
81-
return HasFeatures.abstractFeatures(DiscoveryClient.class,
82-
LoadBalancerClient.class);
79+
return HasFeatures.abstractFeatures(DiscoveryClient.class, LoadBalancerClient.class);
8380
}
8481

8582
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
@Retention(RetentionPolicy.RUNTIME)
3737
@Documented
3838
@Inherited
39-
@ConditionalOnProperty(value = "spring.cloud.discovery.blocking.enabled",
40-
matchIfMissing = true)
39+
@ConditionalOnProperty(value = "spring.cloud.discovery.blocking.enabled", matchIfMissing = true)
4140
public @interface ConditionalOnBlockingDiscoveryEnabled {
4241

4342
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
@Retention(RetentionPolicy.RUNTIME)
3737
@Documented
3838
@Inherited
39-
@ConditionalOnProperty(value = "spring.cloud.discovery.client.health-indicator.enabled",
40-
matchIfMissing = true)
39+
@ConditionalOnProperty(value = "spring.cloud.discovery.client.health-indicator.enabled", matchIfMissing = true)
4140
public @interface ConditionalOnDiscoveryHealthIndicatorEnabled {
4241

4342
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
@Documented
4040
@Inherited
4141
@ConditionalOnClass(name = "org.springframework.web.reactive.function.client.WebClient")
42-
@ConditionalOnProperty(value = "spring.cloud.discovery.reactive.enabled",
43-
matchIfMissing = true)
42+
@ConditionalOnProperty(value = "spring.cloud.discovery.reactive.enabled", matchIfMissing = true)
4443
public @interface ConditionalOnReactiveDiscoveryEnabled {
4544

4645
}

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

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public class DefaultServiceInstance implements ServiceInstance {
4949
* @param secure indicates whether or not the connection needs to be secure.
5050
* @param metadata a map containing metadata.
5151
*/
52-
public DefaultServiceInstance(String instanceId, String serviceId, String host,
53-
int port, boolean secure, Map<String, String> metadata) {
52+
public DefaultServiceInstance(String instanceId, String serviceId, String host, int port, boolean secure,
53+
Map<String, String> metadata) {
5454
this.instanceId = instanceId;
5555
this.serviceId = serviceId;
5656
this.host = host;
@@ -66,8 +66,7 @@ public DefaultServiceInstance(String instanceId, String serviceId, String host,
6666
* @param port the port on which the service is running.
6767
* @param secure indicates whether or not the connection needs to be secure.
6868
*/
69-
public DefaultServiceInstance(String instanceId, String serviceId, String host,
70-
int port, boolean secure) {
69+
public DefaultServiceInstance(String instanceId, String serviceId, String host, int port, boolean secure) {
7170
this(instanceId, serviceId, host, port, secure, new LinkedHashMap<>());
7271
}
7372

@@ -93,8 +92,7 @@ public DefaultServiceInstance(String serviceId, String host, int port, boolean s
9392
* @deprecated - use other constructors
9493
*/
9594
@Deprecated
96-
public DefaultServiceInstance(String serviceId, String host, int port,
97-
boolean secure) {
95+
public DefaultServiceInstance(String serviceId, String host, int port, boolean secure) {
9896
this(serviceId, host, port, secure, new LinkedHashMap<>());
9997
}
10098

@@ -105,8 +103,7 @@ public DefaultServiceInstance(String serviceId, String host, int port,
105103
*/
106104
public static URI getUri(ServiceInstance instance) {
107105
String scheme = (instance.isSecure()) ? "https" : "http";
108-
String uri = String.format("%s://%s:%s", scheme, instance.getHost(),
109-
instance.getPort());
106+
String uri = String.format("%s://%s:%s", scheme, instance.getHost(), instance.getPort());
110107
return URI.create(uri);
111108
}
112109

@@ -147,10 +144,9 @@ public boolean isSecure() {
147144

148145
@Override
149146
public String toString() {
150-
return "DefaultServiceInstance{" + "instanceId='" + this.instanceId + '\''
151-
+ ", serviceId='" + this.serviceId + '\'' + ", host='" + this.host + '\''
152-
+ ", port=" + this.port + ", secure=" + this.secure + ", metadata="
153-
+ this.metadata + '}';
147+
return "DefaultServiceInstance{" + "instanceId='" + this.instanceId + '\'' + ", serviceId='" + this.serviceId
148+
+ '\'' + ", host='" + this.host + '\'' + ", port=" + this.port + ", secure=" + this.secure
149+
+ ", metadata=" + this.metadata + '}';
154150
}
155151

156152
@Override
@@ -162,17 +158,14 @@ public boolean equals(Object o) {
162158
return false;
163159
}
164160
DefaultServiceInstance that = (DefaultServiceInstance) o;
165-
return this.port == that.port && this.secure == that.secure
166-
&& Objects.equals(this.instanceId, that.instanceId)
167-
&& Objects.equals(this.serviceId, that.serviceId)
168-
&& Objects.equals(this.host, that.host)
161+
return this.port == that.port && this.secure == that.secure && Objects.equals(this.instanceId, that.instanceId)
162+
&& Objects.equals(this.serviceId, that.serviceId) && Objects.equals(this.host, that.host)
169163
&& Objects.equals(this.metadata, that.metadata);
170164
}
171165

172166
@Override
173167
public int hashCode() {
174-
return Objects.hash(this.instanceId, this.serviceId, this.host, this.port,
175-
this.secure, this.metadata);
168+
return Objects.hash(this.instanceId, this.serviceId, this.host, this.port, this.secure, this.metadata);
176169
}
177170

178171
}

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
/**
3535
* @author Spencer Gibb
3636
*/
37-
public class HostInfoEnvironmentPostProcessor
38-
implements EnvironmentPostProcessor, Ordered {
37+
public class HostInfoEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered {
3938

4039
// Before ConfigFileApplicationListener
4140
private int order = ConfigFileApplicationListener.DEFAULT_ORDER - 1;
@@ -46,22 +45,19 @@ public int getOrder() {
4645
}
4746

4847
@Override
49-
public void postProcessEnvironment(ConfigurableEnvironment environment,
50-
SpringApplication application) {
48+
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
5149
InetUtils.HostInfo hostInfo = getFirstNonLoopbackHostInfo(environment);
5250
LinkedHashMap<String, Object> map = new LinkedHashMap<>();
5351
map.put("spring.cloud.client.hostname", hostInfo.getHostname());
5452
map.put("spring.cloud.client.ip-address", hostInfo.getIpAddress());
55-
MapPropertySource propertySource = new MapPropertySource(
56-
"springCloudClientHostInfo", map);
53+
MapPropertySource propertySource = new MapPropertySource("springCloudClientHostInfo", map);
5754
environment.getPropertySources().addLast(propertySource);
5855
}
5956

6057
private HostInfo getFirstNonLoopbackHostInfo(ConfigurableEnvironment environment) {
6158
InetUtilsProperties target = new InetUtilsProperties();
6259
ConfigurationPropertySources.attach(environment);
63-
Binder.get(environment).bind(InetUtilsProperties.PREFIX,
64-
Bindable.ofInstance(target));
60+
Binder.get(environment).bind(InetUtilsProperties.PREFIX, Bindable.ofInstance(target));
6561
try (InetUtils utils = new InetUtils(target)) {
6662
return utils.findFirstNonLoopbackHostInfo();
6763
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public class ReactiveCommonsClientAutoConfiguration {
5252
protected static class ReactiveDiscoveryLoadBalancerConfiguration {
5353

5454
@Bean
55-
@ConditionalOnProperty(
56-
value = "spring.cloud.discovery.client.composite-indicator.enabled",
55+
@ConditionalOnProperty(value = "spring.cloud.discovery.client.composite-indicator.enabled",
5756
matchIfMissing = true)
5857
@ConditionalOnBean({ ReactiveDiscoveryHealthIndicator.class })
5958
public ReactiveDiscoveryCompositeHealthContributor reactiveDiscoveryClients(
@@ -63,8 +62,7 @@ public ReactiveDiscoveryCompositeHealthContributor reactiveDiscoveryClients(
6362

6463
@Bean
6564
public HasFeatures reactiveCommonsFeatures() {
66-
return HasFeatures.abstractFeatures(ReactiveDiscoveryClient.class,
67-
ReactiveLoadBalancer.class);
65+
return HasFeatures.abstractFeatures(ReactiveDiscoveryClient.class, ReactiveLoadBalancer.class);
6866
}
6967

7068
}

spring-cloud-commons/src/main/java/org/springframework/cloud/client/actuator/FeaturesEndpoint.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ private void addAbstractFeature(Features features, Class<?> type) {
8282

8383
private void addFeature(Features features, NamedFeature feature) {
8484
Class<?> type = feature.getType();
85-
features.getEnabled()
86-
.add(new Feature(feature.getName(), type.getCanonicalName(),
87-
type.getPackage().getImplementationVersion(),
88-
type.getPackage().getImplementationVendor()));
85+
features.getEnabled().add(new Feature(feature.getName(), type.getCanonicalName(),
86+
type.getPackage().getImplementationVersion(), type.getPackage().getImplementationVendor()));
8987
}
9088

9189
static class Features {
@@ -139,9 +137,8 @@ public String getVendor() {
139137

140138
@Override
141139
public String toString() {
142-
return "Feature{" + "type='" + this.type + '\'' + ", name='" + this.name
143-
+ '\'' + ", version='" + this.version + '\'' + ", vendor='"
144-
+ this.vendor + '\'' + '}';
140+
return "Feature{" + "type='" + this.type + '\'' + ", name='" + this.name + '\'' + ", version='"
141+
+ this.version + '\'' + ", vendor='" + this.vendor + '\'' + '}';
145142
}
146143

147144
@Override
@@ -155,20 +152,16 @@ public boolean equals(Object o) {
155152

156153
Feature feature = (Feature) o;
157154

158-
if (this.type != null ? !this.type.equals(feature.type)
159-
: feature.type != null) {
155+
if (this.type != null ? !this.type.equals(feature.type) : feature.type != null) {
160156
return false;
161157
}
162-
if (this.name != null ? !this.name.equals(feature.name)
163-
: feature.name != null) {
158+
if (this.name != null ? !this.name.equals(feature.name) : feature.name != null) {
164159
return false;
165160
}
166-
if (this.version != null ? !this.version.equals(feature.version)
167-
: feature.version != null) {
161+
if (this.version != null ? !this.version.equals(feature.version) : feature.version != null) {
168162
return false;
169163
}
170-
return this.vendor != null ? this.vendor.equals(feature.vendor)
171-
: feature.vendor == null;
164+
return this.vendor != null ? this.vendor.equals(feature.vendor) : feature.vendor == null;
172165
}
173166

174167
@Override

spring-cloud-commons/src/main/java/org/springframework/cloud/client/actuator/HasFeatures.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,25 @@ public class HasFeatures {
3030

3131
private final List<NamedFeature> namedFeatures = new ArrayList<>();
3232

33-
public HasFeatures(List<Class<?>> abstractFeatures,
34-
List<NamedFeature> namedFeatures) {
33+
public HasFeatures(List<Class<?>> abstractFeatures, List<NamedFeature> namedFeatures) {
3534
this.abstractFeatures.addAll(abstractFeatures);
3635
this.namedFeatures.addAll(namedFeatures);
3736
}
3837

3938
public static HasFeatures abstractFeatures(Class<?>... abstractFeatures) {
40-
return new HasFeatures(Arrays.asList(abstractFeatures),
41-
Collections.<NamedFeature>emptyList());
39+
return new HasFeatures(Arrays.asList(abstractFeatures), Collections.<NamedFeature>emptyList());
4240
}
4341

4442
public static HasFeatures namedFeatures(NamedFeature... namedFeatures) {
45-
return new HasFeatures(Collections.<Class<?>>emptyList(),
46-
Arrays.asList(namedFeatures));
43+
return new HasFeatures(Collections.<Class<?>>emptyList(), Arrays.asList(namedFeatures));
4744
}
4845

4946
public static HasFeatures namedFeature(String name, Class<?> type) {
5047
return namedFeatures(new NamedFeature(name, type));
5148
}
5249

53-
public static HasFeatures namedFeatures(String name1, Class<?> type1, String name2,
54-
Class<?> type2) {
55-
return namedFeatures(new NamedFeature(name1, type1),
56-
new NamedFeature(name2, type2));
50+
public static HasFeatures namedFeatures(String name1, Class<?> type1, String name2, Class<?> type2) {
51+
return namedFeatures(new NamedFeature(name1, type1), new NamedFeature(name2, type2));
5752
}
5853

5954
public List<Class<?>> getAbstractFeatures() {

spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/Customizer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public interface Customizer<TOCUSTOMIZE> {
3939
* @param <K> the type of the identifier of the target
4040
* @return a wrapped customizer
4141
*/
42-
static <T, K> Customizer<T> once(Customizer<T> customizer,
43-
Function<? super T, ? extends K> keyMapper) {
42+
static <T, K> Customizer<T> once(Customizer<T> customizer, Function<? super T, ? extends K> keyMapper) {
4443
final ConcurrentMap<K, Boolean> customized = new ConcurrentHashMap<>();
4544
return t -> {
4645
final K key = keyMapper.apply(t);

0 commit comments

Comments
 (0)