Skip to content

Commit 2a59210

Browse files
committed
Polish formatting
1 parent 91a7bf9 commit 2a59210

File tree

102 files changed

+449
-435
lines changed

Some content is hidden

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

102 files changed

+449
-435
lines changed

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ public class EndpointWebMvcAutoConfigurationTests {
115115
@Rule
116116
public ExpectedException thrown = ExpectedException.none();
117117

118-
private final AnnotationConfigEmbeddedWebApplicationContext applicationContext =
119-
new AnnotationConfigEmbeddedWebApplicationContext();
118+
private final AnnotationConfigEmbeddedWebApplicationContext applicationContext = new AnnotationConfigEmbeddedWebApplicationContext();
120119

121120
private static ThreadLocal<Ports> ports = new ThreadLocal<Ports>();
122121

@@ -125,10 +124,8 @@ public void setUp() {
125124
Ports values = new Ports();
126125
ports.set(values);
127126
EnvironmentTestUtils.addEnvironment(this.applicationContext,
128-
"management.context-path=",
129-
"management.security.enabled=false",
130-
"server.servlet.context-path=",
131-
"server.port=" + ports.get().server);
127+
"management.context-path=", "management.security.enabled=false",
128+
"server.servlet.context-path=", "server.port=" + ports.get().server);
132129
}
133130

134131
@After
@@ -276,8 +273,8 @@ public void onDifferentPortInServletContainer() throws Exception {
276273

277274
@Test
278275
public void onRandomPort() throws Exception {
279-
EnvironmentTestUtils.addEnvironment(this.applicationContext,
280-
"management.port=0", "management.security.enabled=false");
276+
EnvironmentTestUtils.addEnvironment(this.applicationContext, "management.port=0",
277+
"management.security.enabled=false");
281278
this.applicationContext.register(RootConfig.class, EndpointConfig.class,
282279
BaseConfiguration.class, EndpointWebMvcAutoConfiguration.class,
283280
ErrorMvcAutoConfiguration.class);
@@ -565,8 +562,8 @@ public void managementSpecificSslUsingSamePortFails() throws Exception {
565562
@Test
566563
public void managementServerCanDisableSslWhenUsingADifferentPort() throws Exception {
567564
EnvironmentTestUtils.addEnvironment(this.applicationContext,
568-
"management.port=" + ports.get().management,
569-
"server.ssl.enabled=true", "server.ssl.key-store=classpath:test.jks",
565+
"management.port=" + ports.get().management, "server.ssl.enabled=true",
566+
"server.ssl.key-store=classpath:test.jks",
570567
"server.ssl.key-password=password", "management.ssl.enabled=false");
571568

572569
this.applicationContext.register(RootConfig.class, EndpointConfig.class,
@@ -652,8 +649,7 @@ private void endpointDisabled(String name, Class<? extends MvcEndpoint> type) {
652649
private void endpointEnabledOverride(String name, Class<? extends MvcEndpoint> type)
653650
throws Exception {
654651
this.applicationContext.register(LoggingConfig.class, RootConfig.class,
655-
BaseConfiguration.class,
656-
EndpointWebMvcAutoConfiguration.class);
652+
BaseConfiguration.class, EndpointWebMvcAutoConfiguration.class);
657653
EnvironmentTestUtils.addEnvironment(this.applicationContext,
658654
"endpoints.enabled:false",
659655
String.format("endpoints_%s_enabled:true", name));
@@ -736,7 +732,7 @@ private static class Ports {
736732
}
737733

738734
@Configuration
739-
@Import({PropertyPlaceholderAutoConfiguration.class,
735+
@Import({ PropertyPlaceholderAutoConfiguration.class,
740736
EmbeddedServletContainerAutoConfiguration.class,
741737
JacksonAutoConfiguration.class, EndpointAutoConfiguration.class,
742738
HttpMessageConvertersAutoConfiguration.class,

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class HazelcastCacheConfiguration {
5757
}
5858

5959
@Bean
60-
public HazelcastCacheManager cacheManager(
61-
HazelcastInstance existingHazelcastInstance) throws IOException {
60+
public HazelcastCacheManager cacheManager(HazelcastInstance existingHazelcastInstance)
61+
throws IOException {
6262
HazelcastCacheManager cacheManager = new HazelcastCacheManager(
6363
existingHazelcastInstance);
6464
return this.customizers.customize(cacheManager);

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@ else if (Type.REACTIVE == type) {
7777
message.because(servletOutcome.getMessage()));
7878
}
7979
ConditionOutcome reactiveOutcome = isReactiveWebApplication(context);
80-
if (reactiveOutcome.isMatch() && required) {
80+
if (reactiveOutcome.isMatch() && required) {
8181
return new ConditionOutcome(reactiveOutcome.isMatch(),
8282
message.because(reactiveOutcome.getMessage()));
8383
}
84-
boolean finalOutcome = (required ?
85-
servletOutcome.isMatch() && reactiveOutcome.isMatch() :
86-
servletOutcome.isMatch() || reactiveOutcome.isMatch());
87-
return new ConditionOutcome(finalOutcome, message.because(
88-
servletOutcome.getMessage()).append("and").append(
89-
reactiveOutcome.getMessage()));
84+
boolean finalOutcome = (required
85+
? servletOutcome.isMatch() && reactiveOutcome.isMatch()
86+
: servletOutcome.isMatch() || reactiveOutcome.isMatch());
87+
return new ConditionOutcome(finalOutcome,
88+
message.because(servletOutcome.getMessage()).append("and")
89+
.append(reactiveOutcome.getMessage()));
9090
}
9191
}
9292

@@ -115,16 +115,16 @@ private ConditionOutcome isServletWebApplication(ConditionContext context) {
115115
private ConditionOutcome isReactiveWebApplication(ConditionContext context) {
116116
ConditionMessage.Builder message = ConditionMessage.forCondition("");
117117
if (context.getResourceLoader() instanceof ReactiveWebApplicationContext) {
118-
return ConditionOutcome.match(
119-
message.foundExactly("ReactiveWebApplicationContext"));
118+
return ConditionOutcome
119+
.match(message.foundExactly("ReactiveWebApplicationContext"));
120120
}
121-
return ConditionOutcome.noMatch(message.because(
122-
"not a reactive web application"));
121+
return ConditionOutcome
122+
.noMatch(message.because("not a reactive web application"));
123123
}
124124

125125
private Type deduceType(AnnotatedTypeMetadata metadata) {
126-
Map<String, Object> attributes = metadata.getAnnotationAttributes(
127-
ConditionalOnWebApplication.class.getName());
126+
Map<String, Object> attributes = metadata
127+
.getAnnotationAttributes(ConditionalOnWebApplication.class.getName());
128128
if (attributes != null) {
129129
return (Type) attributes.get("type");
130130
}

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/ReactiveMongoRepositoriesAutoConfigureRegistrar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
* @author Mark Paluch
3232
* @since 2.0.0
3333
*/
34-
class ReactiveMongoRepositoriesAutoConfigureRegistrar extends
35-
AbstractRepositoryConfigurationSourceSupport {
34+
class ReactiveMongoRepositoriesAutoConfigureRegistrar
35+
extends AbstractRepositoryConfigurationSourceSupport {
3636

3737
@Override
3838
protected Class<? extends Annotation> getAnnotation() {

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
* @since 2.0.0
3535
*/
3636
@Order(Ordered.LOWEST_PRECEDENCE)
37-
public class ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor extends
38-
AbstractDependsOnBeanFactoryPostProcessor {
37+
public class ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor
38+
extends AbstractDependsOnBeanFactoryPostProcessor {
3939

4040
public ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor(
4141
String... dependsOn) {

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoClientFactory.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
public class MongoClientFactory {
4646

4747
private final MongoProperties properties;
48+
4849
private final Environment environment;
4950

5051
public MongoClientFactory(MongoProperties properties, Environment environment) {
@@ -54,8 +55,8 @@ public MongoClientFactory(MongoProperties properties, Environment environment) {
5455

5556
/**
5657
* Creates a {@link MongoClient} using the given {@code options}. If the environment
57-
* contains a {@code local.mongo.port} property, it is used to configure a client
58-
* to an embedded MongoDB instance.
58+
* contains a {@code local.mongo.port} property, it is used to configure a client to
59+
* an embedded MongoDB instance.
5960
* @param options the options
6061
* @return the Mongo client
6162
*/
@@ -83,8 +84,7 @@ private MongoClient createEmbeddedMongoClient(MongoClientOptions options, int po
8384
}
8485
String host = this.properties.getHost() == null ? "localhost"
8586
: this.properties.getHost();
86-
return new MongoClient(
87-
Collections.singletonList(new ServerAddress(host, port)),
87+
return new MongoClient(Collections.singletonList(new ServerAddress(host, port)),
8888
Collections.emptyList(), options);
8989
}
9090

@@ -100,24 +100,24 @@ private MongoClient createNetworkMongoClient(MongoClientOptions options) {
100100
}
101101
List<MongoCredential> credentials = new ArrayList<MongoCredential>();
102102
if (hasCustomCredentials()) {
103-
String database = this.properties.getAuthenticationDatabase() == null ? this.properties
104-
.getMongoClientDatabase() : this.properties
105-
.getAuthenticationDatabase();
106-
credentials.add(MongoCredential.createCredential(
107-
this.properties.getUsername(), database,
108-
this.properties.getPassword()));
103+
String database = this.properties.getAuthenticationDatabase() == null
104+
? this.properties.getMongoClientDatabase()
105+
: this.properties.getAuthenticationDatabase();
106+
credentials.add(
107+
MongoCredential.createCredential(this.properties.getUsername(),
108+
database, this.properties.getPassword()));
109109
}
110110
String host = this.properties.getHost() == null ? "localhost"
111111
: this.properties.getHost();
112112
int port = this.properties.getPort() != null ? this.properties.getPort()
113113
: MongoProperties.DEFAULT_PORT;
114114
return new MongoClient(
115-
Collections.singletonList(new ServerAddress(host, port)),
116-
credentials, options);
115+
Collections.singletonList(new ServerAddress(host, port)), credentials,
116+
options);
117117
}
118118
// The options and credentials are in the URI
119-
return new MongoClient(new MongoClientURI(this.properties.determineUri(),
120-
builder(options)));
119+
return new MongoClient(
120+
new MongoClientURI(this.properties.determineUri(), builder(options)));
121121
}
122122

123123
private boolean hasCustomAddress() {

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactory.java

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public ReactiveMongoClientFactory(MongoProperties properties,
5656

5757
/**
5858
* Creates a {@link MongoClient} using the given {@code settings}. If the environment
59-
* contains a {@code local.mongo.port} property, it is used to configure a client
60-
* to an embedded MongoDB instance.
59+
* contains a {@code local.mongo.port} property, it is used to configure a client to
60+
* an embedded MongoDB instance.
6161
* @param settings the settings
6262
* @return the Mongo client
6363
*/
@@ -85,8 +85,7 @@ private MongoClient createEmbeddedMongoClient(MongoClientSettings settings,
8585
String host = this.properties.getHost() == null ? "localhost"
8686
: this.properties.getHost();
8787
ClusterSettings clusterSettings = ClusterSettings.builder()
88-
.hosts(Collections.singletonList(new ServerAddress(host, port)))
89-
.build();
88+
.hosts(Collections.singletonList(new ServerAddress(host, port))).build();
9089
builder.clusterSettings(clusterSettings);
9190
return MongoClients.create(builder.build());
9291
}
@@ -101,12 +100,12 @@ private MongoClient createNetworkMongoClient(MongoClientSettings settings) {
101100
Builder builder = builder(settings);
102101
if (hasCustomCredentials()) {
103102
List<MongoCredential> credentials = new ArrayList<MongoCredential>();
104-
String database = this.properties.getAuthenticationDatabase() == null ? this.properties
105-
.getMongoClientDatabase() : this.properties
106-
.getAuthenticationDatabase();
107-
credentials.add(MongoCredential.createCredential(
108-
this.properties.getUsername(), database,
109-
this.properties.getPassword()));
103+
String database = this.properties.getAuthenticationDatabase() == null
104+
? this.properties.getMongoClientDatabase()
105+
: this.properties.getAuthenticationDatabase();
106+
credentials.add(
107+
MongoCredential.createCredential(this.properties.getUsername(),
108+
database, this.properties.getPassword()));
110109
builder.credentialList(credentials);
111110
}
112111
String host = this.properties.getHost() == null ? "localhost"
@@ -127,22 +126,17 @@ private MongoClient createNetworkMongoClient(MongoClientSettings settings) {
127126
private Builder createBuilder(MongoClientSettings settings,
128127
ConnectionString connectionString) {
129128
Builder builder = builder(settings)
130-
.clusterSettings(
131-
ClusterSettings.builder().applyConnectionString(connectionString)
132-
.build())
133-
.connectionPoolSettings(
134-
ConnectionPoolSettings.builder()
135-
.applyConnectionString(connectionString).build())
136-
.serverSettings(
137-
ServerSettings.builder().applyConnectionString(connectionString)
138-
.build())
129+
.clusterSettings(ClusterSettings.builder()
130+
.applyConnectionString(connectionString).build())
131+
.connectionPoolSettings(ConnectionPoolSettings.builder()
132+
.applyConnectionString(connectionString).build())
133+
.serverSettings(ServerSettings.builder()
134+
.applyConnectionString(connectionString).build())
139135
.credentialList(connectionString.getCredentialList())
140-
.sslSettings(
141-
SslSettings.builder().applyConnectionString(connectionString)
142-
.build())
143-
.socketSettings(
144-
SocketSettings.builder().applyConnectionString(connectionString)
145-
.build());
136+
.sslSettings(SslSettings.builder().applyConnectionString(connectionString)
137+
.build())
138+
.socketSettings(SocketSettings.builder()
139+
.applyConnectionString(connectionString).build());
146140
if (connectionString.getReadPreference() != null) {
147141
builder.readPreference(connectionString.getReadPreference());
148142
}

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ public EmbeddedMongoDependencyConfiguration() {
235235
@Configuration
236236
@ConditionalOnClass({ com.mongodb.reactivestreams.client.MongoClient.class,
237237
ReactiveMongoClientFactoryBean.class })
238-
protected static class EmbeddedReactiveMongoDependencyConfiguration extends
239-
ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor {
238+
protected static class EmbeddedReactiveMongoDependencyConfiguration
239+
extends ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor {
240240

241241
public EmbeddedReactiveMongoDependencyConfiguration() {
242242
super("embeddedMongoServer");

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/core/ReactorCoreAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @author Brian Clozel
3333
*/
3434
@Configuration
35-
@ConditionalOnClass({Mono.class, Flux.class})
35+
@ConditionalOnClass({ Mono.class, Flux.class })
3636
@EnableConfigurationProperties(ReactorCoreProperties.class)
3737
public class ReactorCoreAutoConfiguration {
3838

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/core/ReactorCoreProperties.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@ public boolean isEnabled() {
4747
public void setEnabled(boolean enabled) {
4848
this.enabled = enabled;
4949
}
50+
5051
}
52+
5153
}

0 commit comments

Comments
 (0)