Skip to content

Commit b4c3f4f

Browse files
committed
Merge branch '1.5.x'
2 parents 4870349 + ec73144 commit b4c3f4f

File tree

14 files changed

+39
-34
lines changed

14 files changed

+39
-34
lines changed

spring-boot-actuator-docs/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
<main.basedir>${basedir}/..</main.basedir>
1919
</properties>
2020
<dependencies>
21+
<!-- Compile -->
2122
<dependency>
2223
<groupId>org.springframework.hateoas</groupId>
2324
<artifactId>spring-hateoas</artifactId>
2425
</dependency>
25-
2626
<!-- Provided -->
2727
<dependency>
2828
<groupId>org.springframework.boot</groupId>

spring-boot-autoconfigure/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,6 @@
627627
<dependency>
628628
<groupId>org.springframework.kafka</groupId>
629629
<artifactId>spring-kafka-test</artifactId>
630-
<version>${spring-kafka.version}</version>
631630
<scope>test</scope>
632631
<exclusions>
633632
<exclusion>

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
public class CouchbaseAutoConfiguration {
5050

5151
@Configuration
52-
@ConditionalOnMissingBean(value = CouchbaseConfiguration.class,
53-
type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
52+
@ConditionalOnMissingBean(value = CouchbaseConfiguration.class, type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
5453
public static class CouchbaseConfiguration {
5554

5655
private final CouchbaseProperties properties;
@@ -124,8 +123,9 @@ protected DefaultCouchbaseEnvironment.Builder initializeEnvironmentBuilder(
124123
* Determine if Couchbase should be configured. This happens if either the
125124
* user-configuration defines a {@code CouchbaseConfigurer} or if at least the
126125
* "bootstrapHosts" property is specified.
127-
* <p>The reason why we check for the presence of {@code CouchbaseConfigurer} is
128-
* that it might use {@link CouchbaseProperties} for its internal customization.
126+
* <p>
127+
* The reason why we check for the presence of {@code CouchbaseConfigurer} is that it
128+
* might use {@link CouchbaseProperties} for its internal customization.
129129
*/
130130
static class CouchbaseCondition extends AnyNestedCondition {
131131

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ protected <T> T createDataSource(DataSourceProperties properties,
4242
return (T) properties.initializeDataSourceBuilder().type(type).build();
4343
}
4444

45+
/**
46+
* Tomcat Pool DataSource configuration.
47+
*/
4548
@ConditionalOnClass(org.apache.tomcat.jdbc.pool.DataSource.class)
4649
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.tomcat.jdbc.pool.DataSource", matchIfMissing = true)
4750
static class Tomcat extends DataSourceConfiguration {
@@ -64,6 +67,9 @@ public org.apache.tomcat.jdbc.pool.DataSource dataSource(
6467

6568
}
6669

70+
/**
71+
* Hikari DataSource configuration.
72+
*/
6773
@ConditionalOnClass(HikariDataSource.class)
6874
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true)
6975
static class Hikari extends DataSourceConfiguration {
@@ -75,6 +81,9 @@ public HikariDataSource dataSource(DataSourceProperties properties) {
7581
}
7682
}
7783

84+
/**
85+
* DBCP DataSource configuration.
86+
*/
7887
@ConditionalOnClass(org.apache.commons.dbcp2.BasicDataSource.class)
7988
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp2.BasicDataSource", matchIfMissing = true)
8089
static class Dbcp2 extends DataSourceConfiguration {
@@ -88,6 +97,9 @@ public org.apache.commons.dbcp2.BasicDataSource dataSource(
8897
}
8998
}
9099

100+
/**
101+
* Generic DataSource configuration.
102+
*/
91103
@ConditionalOnMissingBean(DataSource.class)
92104
@ConditionalOnProperty(name = "spring.datasource.type")
93105
static class Generic {

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ static class OnValidatorAvailableCondition extends SpringBootCondition {
5858
@Override
5959
public ConditionOutcome getMatchOutcome(ConditionContext context,
6060
AnnotatedTypeMetadata metadata) {
61-
ConditionMessage.Builder message = ConditionMessage.forCondition(
62-
getClass().getName());
61+
ConditionMessage.Builder message = ConditionMessage
62+
.forCondition(getClass().getName());
6363
try {
6464
Validation.buildDefaultValidatorFactory().getValidator();
6565
return ConditionOutcome.match(message.available("JSR-303 provider"));

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public void createClusterWithOverrides() {
6666
public void createCustomizeCluster() {
6767
load(ClusterConfig.class);
6868
assertThat(this.context.getBeanNamesForType(Cluster.class).length).isEqualTo(1);
69-
assertThat(this.context.getBeanNamesForType(ClusterCustomizer.class).length).isEqualTo(1);
69+
assertThat(this.context.getBeanNamesForType(ClusterCustomizer.class).length)
70+
.isEqualTo(1);
7071
}
7172

7273
private void load(String... environment) {
@@ -85,7 +86,6 @@ private void load(Class<?> config, String... environment) {
8586
this.context = ctx;
8687
}
8788

88-
8989
@Configuration
9090
static class ClusterConfig {
9191

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBeanWithFilteredClasspathTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public void testNameOnMissingBeanTypeWithMissingImport() {
5353
assertThat(this.context.containsBean("foo")).isTrue();
5454
}
5555

56-
5756
@Configuration
5857
static class OnBeanTypeConfiguration {
5958

@@ -66,6 +65,7 @@ public String foo() {
6665
}
6766

6867
static class TestCacheManager extends CaffeineCacheManager {
68+
6969
}
7070

7171
}

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcastTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ public void customFlushMode() {
7070
"spring.session.hazelcast.flush-mode=immediate");
7171
HazelcastSessionRepository repository = validateSessionRepository(
7272
HazelcastSessionRepository.class);
73-
assertThat(new DirectFieldAccessor(repository).getPropertyValue(
74-
"hazelcastFlushMode")).isEqualTo(HazelcastFlushMode.IMMEDIATE);
73+
assertThat(new DirectFieldAccessor(repository)
74+
.getPropertyValue("hazelcastFlushMode"))
75+
.isEqualTo(HazelcastFlushMode.IMMEDIATE);
7576
}
7677

7778
@Configuration

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ public void springSessionTimeoutIsNotAValidProperty() {
9797
}
9898

9999
@Test
100-
@SuppressWarnings("unchecked")
101100
public void mongoSessionStore() {
102101
load(Arrays.asList(EmbeddedMongoAutoConfiguration.class,
103102
MongoAutoConfiguration.class, MongoDataAutoConfiguration.class),
@@ -106,7 +105,6 @@ public void mongoSessionStore() {
106105
}
107106

108107
@Test
109-
@SuppressWarnings("unchecked")
110108
public void mongoSessionStoreWithCustomizations() {
111109
load(Arrays.asList(EmbeddedMongoAutoConfiguration.class,
112110
MongoAutoConfiguration.class, MongoDataAutoConfiguration.class),

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public void userDefinedMethodValidationPostProcessorTakesPrecedence() {
6565
load(SampleConfiguration.class);
6666
assertThat(this.context.getBean(MethodValidationPostProcessor.class))
6767
.isSameAs(this.context.getBean("testMethodValidationPostProcessor"));
68-
assertThat(this.context.getBeansOfType(MethodValidationPostProcessor.class)).hasSize(1);
68+
assertThat(this.context.getBeansOfType(MethodValidationPostProcessor.class))
69+
.hasSize(1);
6970
}
7071

7172
public void load(Class<?> config) {
@@ -84,6 +85,7 @@ static class SampleService {
8485
public void doSomething(@Size(min = 3, max = 10) String name) {
8586

8687
}
88+
8789
}
8890

8991
@Configuration

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithHibernateValidatorMissingElImplTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import static org.assertj.core.api.Assertions.assertThat;
2929

3030
/**
31-
* Test for {{@link ValidationAutoConfiguration} when Hibernate validator is present
32-
* but no EL implementation is available.
31+
* Test for {@link ValidationAutoConfiguration} when Hibernate validator is present but no
32+
* EL implementation is available.
3333
*
3434
* @author Stephane Nicoll
3535
*/

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,8 @@ public void customTomcatRemoteIpValve() throws Exception {
425425
map.put("server.tomcat.port-header", "x-my-forward-port");
426426
map.put("server.tomcat.protocol-header-https-value", "On");
427427
bindProperties(map);
428-
429428
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
430429
this.properties.customize(container);
431-
432430
assertThat(container.getEngineValves()).hasSize(1);
433431
Valve valve = container.getEngineValves().iterator().next();
434432
assertThat(valve).isInstanceOf(RemoteIpValve.class);
@@ -445,7 +443,6 @@ public void customTomcatAcceptCount() {
445443
Map<String, String> map = new HashMap<String, String>();
446444
map.put("server.tomcat.accept-count", "10");
447445
bindProperties(map);
448-
449446
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
450447
this.properties.customize(container);
451448
TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container
@@ -459,7 +456,6 @@ public void customTomcatMaxConnections() {
459456
Map<String, String> map = new HashMap<String, String>();
460457
map.put("server.tomcat.max-connections", "5");
461458
bindProperties(map);
462-
463459
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
464460
this.properties.customize(container);
465461
TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container
@@ -473,7 +469,6 @@ public void customTomcatMaxHttpPostSize() {
473469
Map<String, String> map = new HashMap<String, String>();
474470
map.put("server.tomcat.max-http-post-size", "10000");
475471
bindProperties(map);
476-
477472
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
478473
this.properties.customize(container);
479474
TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container

spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestDatabaseAutoConfigurationTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public void replaceWithUniqueDatabase() {
6060
DataSource datasource = this.context.getBean(DataSource.class);
6161
JdbcTemplate jdbcTemplate = new JdbcTemplate(datasource);
6262
jdbcTemplate.execute("create table example (id int, name varchar);");
63-
6463
ConfigurableApplicationContext anotherContext = doLoad(
6564
ExistingDataSourceConfiguration.class);
6665
try {

spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,24 +198,23 @@ private void setFile(URL context, String file) {
198198

199199
@Override
200200
protected int hashCode(URL u) {
201-
int result = 0;
202-
String protocol = u.getProtocol();
203-
if (protocol != null) {
204-
result += protocol.hashCode();
205-
}
206-
String file = u.getFile();
201+
return hashCode(u.getProtocol(), u.getFile());
202+
}
203+
204+
private int hashCode(String protocol, String file) {
205+
int result = (protocol == null ? 0 : protocol.hashCode());
207206
int separatorIndex = file.indexOf(SEPARATOR);
208207
if (separatorIndex == -1) {
209208
return result + file.hashCode();
210209
}
211-
String fileWithoutEntry = file.substring(0, separatorIndex);
210+
String source = file.substring(0, separatorIndex);
211+
String entry = canonicalize(file.substring(separatorIndex + 2));
212212
try {
213-
result += new URL(fileWithoutEntry).hashCode();
213+
result += new URL(source).hashCode();
214214
}
215215
catch (MalformedURLException ex) {
216-
result += fileWithoutEntry.hashCode();
216+
result += source.hashCode();
217217
}
218-
String entry = canonicalize(file.substring(separatorIndex + 2));
219218
result += entry.hashCode();
220219
return result;
221220
}

0 commit comments

Comments
 (0)