Skip to content

Commit 21d80d8

Browse files
committed
Merge branch '1.5.x' into 2.0.x
2 parents 606eb9d + e69296d commit 21d80d8

File tree

94 files changed

+401
-341
lines changed

Some content is hidden

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

94 files changed

+401
-341
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@ public ResourceConfigCustomizer resourceConfigCustomizer(
237237
final ObjectMapper objectMapper) {
238238
addJaxbAnnotationIntrospectorIfPresent(objectMapper);
239239
return (ResourceConfig config) -> {
240-
config.register(JacksonFeature.class);
241-
config.register(new ObjectMapperContextResolver(objectMapper),
240+
JerseyAutoConfiguration.this.config.register(JacksonFeature.class);
241+
JerseyAutoConfiguration.this.config.register(
242+
new ObjectMapperContextResolver(objectMapper),
242243
ContextResolver.class);
243244
};
244245
}

spring-boot-project/spring-boot-parent/src/checkstyle/checkstyle-suppressions.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<suppressions>
66
<suppress files="SpringApplicationTests\.java" checks="FinalClass" />
77
<suppress files=".+Configuration\.java" checks="HideUtilityClassConstructor" />
8-
<suppress files="LaunchScriptTestApplication\.java" checks="HideUtilityClassConstructor" />
9-
<suppress files="DevToolsTestApplication\.java" checks="HideUtilityClassConstructor" />
8+
<suppress files=".+Application\.java" checks="HideUtilityClassConstructor" />
109
<suppress files="SignalUtils\.java" checks="IllegalImport" />
1110
<suppress files="[\\/]src[\\/]test[\\/]java[\\/]cli[\\/]command[\\/]" checks="ImportControl" />
1211
<suppress files="[\\/]src[\\/]main[\\/]java[\\/]sample[\\/]" checks="ImportControl" />
@@ -23,4 +22,8 @@
2322
<suppress files="LogLevel\.java" checks="JavadocVariable" />
2423
<suppress files="HelpMojo\.java" checks=".*"/>
2524
<suppress files="[\\/]org.springframework.boot.configurationprocessor.json[\\/].*\.java$" checks=".*"/>
25+
<suppress files="TripType\.java" checks="JavadocVariable" />
26+
<suppress files="Rating\.java" checks="JavadocVariable" />
27+
<suppress files="Direction\.java" checks="JavadocVariable" />
28+
<suppress files="JooqExamples\.java" checks="AvoidStaticImport"/>
2629
</suppressions>

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/ZipCompression.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.

spring-boot-samples/spring-boot-sample-ant/src/test/java/sample/ant/SampleAntApplicationIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616

1717
package sample.ant;
1818

19-
import static org.assertj.core.api.Assertions.assertThat;
20-
2119
import java.io.File;
2220
import java.io.FileFilter;
2321
import java.io.InputStreamReader;
2422
import java.util.concurrent.TimeUnit;
2523

2624
import org.junit.Test;
25+
2726
import org.springframework.boot.loader.tools.JavaExecutable;
2827
import org.springframework.util.FileCopyUtils;
2928

29+
import static org.assertj.core.api.Assertions.assertThat;
30+
3031
/**
3132
* Integration Tests for {@code SampleAntApplication}.
3233
*
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
name: Phil
1+
name: Phil
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
name: Phil
1+
name: Phil

spring-boot-samples/spring-boot-sample-atmosphere/src/main/java/sample/atmosphere/SampleAtmosphereApplication.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public ServletRegistrationBean<AtmosphereServlet> atmosphereServlet() {
5959
return registration;
6060
}
6161

62+
public static void main(String[] args) throws Exception {
63+
SpringApplication.run(SampleAtmosphereApplication.class, args);
64+
}
65+
6266
@Configuration
6367
static class MvcConfiguration implements WebMvcConfigurer {
6468

@@ -79,8 +83,4 @@ public void onStartup(ServletContext servletContext) throws ServletException {
7983

8084
}
8185

82-
public static void main(String[] args) {
83-
SpringApplication.run(SampleAtmosphereApplication.class, args);
84-
}
85-
8686
}

spring-boot-samples/spring-boot-sample-cache/src/main/java/sample/cache/SampleClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -53,7 +53,7 @@ class SampleClient {
5353

5454
private final Random random;
5555

56-
public SampleClient(CountryRepository countryService) {
56+
SampleClient(CountryRepository countryService) {
5757
this.countryService = countryService;
5858
this.random = new Random();
5959
}

spring-boot-samples/spring-boot-sample-custom-layout/src/main/java/sample/layout/SampleLayout.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import org.springframework.boot.loader.tools.LoaderClassesWriter;
2525

2626
/**
27+
* An example layout.
28+
*
2729
* @author Phillip Webb
2830
*/
2931
public class SampleLayout extends Layouts.Jar implements CustomLoaderLayout {

spring-boot-samples/spring-boot-sample-data-cassandra/src/main/java/sample/data/cassandra/CustomerRepository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2013 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -24,9 +24,9 @@
2424
public interface CustomerRepository extends CrudRepository<Customer, String> {
2525

2626
@Query("Select * from customer where firstname=?0")
27-
public Customer findByFirstName(String firstName);
27+
Customer findByFirstName(String firstName);
2828

2929
@Query("Select * from customer where lastname=?0")
30-
public List<Customer> findByLastName(String lastName);
30+
List<Customer> findByLastName(String lastName);
3131

3232
}

spring-boot-samples/spring-boot-sample-data-elasticsearch/src/main/java/sample/data/elasticsearch/CustomerRepository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2013 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -22,8 +22,8 @@
2222

2323
public interface CustomerRepository extends ElasticsearchRepository<Customer, String> {
2424

25-
public Customer findByFirstName(String firstName);
25+
Customer findByFirstName(String firstName);
2626

27-
public List<Customer> findByLastName(String lastName);
27+
List<Customer> findByLastName(String lastName);
2828

2929
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityServiceImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ class CityServiceImpl implements CityService {
3434

3535
private final HotelRepository hotelRepository;
3636

37-
public CityServiceImpl(CityRepository cityRepository,
38-
HotelRepository hotelRepository) {
37+
CityServiceImpl(CityRepository cityRepository, HotelRepository hotelRepository) {
3938
this.cityRepository = cityRepository;
4039
this.hotelRepository = hotelRepository;
4140
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/HotelServiceImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ class HotelServiceImpl implements HotelService {
4141

4242
private final ReviewRepository reviewRepository;
4343

44-
public HotelServiceImpl(HotelRepository hotelRepository,
45-
ReviewRepository reviewRepository) {
44+
HotelServiceImpl(HotelRepository hotelRepository, ReviewRepository reviewRepository) {
4645
this.hotelRepository = hotelRepository;
4746
this.reviewRepository = reviewRepository;
4847
}
@@ -82,7 +81,7 @@ private static class ReviewsSummaryImpl implements ReviewsSummary {
8281

8382
private final Map<Rating, Long> ratingCount;
8483

85-
public ReviewsSummaryImpl(List<RatingCount> ratingCounts) {
84+
ReviewsSummaryImpl(List<RatingCount> ratingCounts) {
8685
this.ratingCount = new HashMap<>();
8786
for (RatingCount ratingCount : ratingCounts) {
8887
this.ratingCount.put(ratingCount.getRating(), ratingCount.getCount());
@@ -92,7 +91,7 @@ public ReviewsSummaryImpl(List<RatingCount> ratingCounts) {
9291
@Override
9392
public long getNumberOfReviewsWithRating(Rating rating) {
9493
Long count = this.ratingCount.get(rating);
95-
return count == null ? 0 : count;
94+
return (count != null ? count : 0);
9695
}
9796

9897
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
spring.datasource.name=scratchdb
2-
spring.jmx.default-domain=jpa.sample
2+
spring.jmx.default-domain=jpa.sample

spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/sample/data/mongo/Customer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2013 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -24,6 +24,7 @@ public class Customer {
2424
private String id;
2525

2626
private String firstName;
27+
2728
private String lastName;
2829

2930
public Customer() {
@@ -36,8 +37,8 @@ public Customer(String firstName, String lastName) {
3637

3738
@Override
3839
public String toString() {
39-
return String.format("Customer[id=%s, firstName='%s', lastName='%s']", id,
40-
firstName, lastName);
40+
return String.format("Customer[id=%s, firstName='%s', lastName='%s']", this.id,
41+
this.firstName, this.lastName);
4142
}
4243

4344
}

spring-boot-samples/spring-boot-sample-data-mongodb/src/main/resources/application.properties

Whitespace-only changes.

spring-boot-samples/spring-boot-sample-data-neo4j/src/main/java/sample/data/neo4j/Customer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -28,6 +28,7 @@ public class Customer {
2828
private Long id;
2929

3030
private String firstName;
31+
3132
private String lastName;
3233

3334
public Customer() {

spring-boot-samples/spring-boot-sample-data-neo4j/src/main/java/sample/data/neo4j/CustomerRepository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -22,8 +22,8 @@
2222

2323
public interface CustomerRepository extends Neo4jRepository<Customer, Long> {
2424

25-
public Customer findByFirstName(String firstName);
25+
Customer findByFirstName(String firstName);
2626

27-
public List<Customer> findByLastName(String lastName);
27+
List<Customer> findByLastName(String lastName);
2828

2929
}

spring-boot-samples/spring-boot-sample-data-neo4j/src/test/java/sample/data/neo4j/SampleNeo4jApplicationTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -22,7 +22,7 @@
2222

2323
import org.springframework.boot.test.rule.OutputCapture;
2424

25-
import static org.junit.Assert.assertTrue;
25+
import static org.assertj.core.api.Assertions.assertThat;
2626

2727
/**
2828
* Tests for {@link SampleNeo4jApplication}.
@@ -45,8 +45,7 @@ public void testDefaultSettings() {
4545
}
4646
}
4747
String output = this.outputCapture.toString();
48-
assertTrue("Wrong output: " + output,
49-
output.contains("firstName='Alice', lastName='Smith'"));
48+
assertThat(output).contains("firstName='Alice', lastName='Smith'");
5049
}
5150

5251
private boolean neo4jServerRunning(Throwable ex) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
spring.data.rest.base-path=/api
1+
spring.data.rest.base-path=/api

spring-boot-samples/spring-boot-sample-devtools/src/main/java/sample/devtools/Message.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2015 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -16,8 +16,14 @@
1616

1717
package sample.devtools;
1818

19-
public class Message {
19+
public final class Message {
2020

21+
/**
22+
* Sample message.
23+
*/
2124
public static String MESSAGE = "Message";
2225

26+
private Message() {
27+
}
28+
2329
}

spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/Person.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -23,11 +23,14 @@
2323

2424
@Entity
2525
public class Person {
26+
2627
@Id
2728
@SequenceGenerator(name = "person_generator", sequenceName = "person_sequence", allocationSize = 1)
2829
@GeneratedValue(generator = "person_generator")
2930
private Long id;
31+
3032
private String firstName;
33+
3134
private String lastName;
3235

3336
public String getFirstName() {
@@ -51,4 +54,5 @@ public String toString() {
5154
return "Person [firstName=" + this.firstName + ", lastName=" + this.lastName
5255
+ "]";
5356
}
57+
5458
}

spring-boot-samples/spring-boot-sample-integration/src/test/java/sample/integration/consumer/SampleIntegrationApplicationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -119,4 +119,5 @@ private Resource[] getResourcesWithContent() throws IOException {
119119
}
120120
return candidates;
121121
}
122+
122123
}

spring-boot-samples/spring-boot-sample-jersey1/src/main/resources/application.properties

Whitespace-only changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
server.port = 8443
22
server.ssl.key-store = classpath:sample.jks
33
server.ssl.key-store-password = secret
4-
server.ssl.key-password = password
4+
server.ssl.key-password = password

spring-boot-samples/spring-boot-sample-jooq/src/main/java/sample/jooq/JooqExamples.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ public String mapRow(ResultSet rs, int rowNum) throws SQLException {
7676
});
7777
System.out.println("jOOQ SQL " + list);
7878
}
79+
7980
}

spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -68,4 +68,5 @@ private boolean serverNotRunning(IllegalStateException ex) {
6868
}
6969
return false;
7070
}
71+
7172
}

spring-boot-samples/spring-boot-sample-oauth2-client/src/main/java/sample/oauth2/client/SampleOAuth2ClientApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.

spring-boot-samples/spring-boot-sample-oauth2-client/src/test/java/sample/oauth2/client/SampleOAuth2ClientApplicationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.

0 commit comments

Comments
 (0)