Skip to content

Commit cfbe28f

Browse files
committed
Merge pull request #5815 from izeye/polish-20160428
* pr/5815: Polish
2 parents 373cf83 + 0efa003 commit cfbe28f

File tree

21 files changed

+148
-150
lines changed

21 files changed

+148
-150
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/NamePatternFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* must provide implementations of {@link #getValue(Object, String)} and
2828
* {@link #getNames(Object, NameCallback)}.
2929
*
30-
* @param <T> The source data type
30+
* @param <T> the source data type
3131
* @author Phillip Webb
3232
* @author Sergei Egorov
3333
* @author Andy Wilkinson

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* Base class for a mutable buffer containing a timestamp and a value.
2121
*
22-
* @param <T> The value type
22+
* @param <T> the value type
2323
* @author Dave Syer
2424
* @author Phillip Webb
2525
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Callback interface that can be implemented by beans wishing to customize the cache
2323
* manager before it is fully initialized, in particular to tune its configuration.
2424
*
25-
* @param <T> The type of the {@link CacheManager}
25+
* @param <T> the type of the {@link CacheManager}
2626
* @author Stephane Nicoll
2727
* @since 1.3.3
2828
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* A base {@link DataSourcePoolMetadata} implementation.
2323
*
24-
* @param <T> The datasource type
24+
* @param <T> the data source type
2525
* @author Stephane Nicoll
2626
* @since 1.2.0
2727
*/

spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* public void testWriteJson() {
5454
* ExampleObject object = //...
5555
* assertThat(json.write(object)).isEqualToJson("expected.json");
56-
* assertThat(json.read("expected.json)).isEqualTo(object);
56+
* assertThat(json.read("expected.json")).isEqualTo(object);
5757
* }
5858
*
5959
* }
@@ -62,7 +62,7 @@
6262
* <p>
6363
* To use this library JSONAssert must be on the test classpath.
6464
*
65-
* @param <T> The type under test
65+
* @param <T> the type under test
6666
* @author Phillip Webb
6767
* @since 1.4.0
6868
* @see JsonContentAssert
@@ -271,8 +271,8 @@ private void closeQuietly(Closeable closeable) {
271271

272272
/**
273273
* Write the specified object to a JSON string.
274-
* @param value the source value ({@code never null})
275-
* @param type the resulting type ({@code never null})
274+
* @param value the source value (never {@code null})
275+
* @param type the resulting type (never {@code null})
276276
* @return the JSON string
277277
* @throws IOException on write error
278278
*/
@@ -281,9 +281,9 @@ protected abstract String writeObject(T value, ResolvableType type)
281281

282282
/**
283283
* Read from the specified input stream to create an object of the specified type. The
284-
* default implementation delegates to {@link #readObject(Reader, ResolvableType)}
285-
* @param inputStream the source input stream ({@code never null})
286-
* @param type the resulting type ({@code never null})
284+
* default implementation delegates to {@link #readObject(Reader, ResolvableType)}.
285+
* @param inputStream the source input stream (never {@code null})
286+
* @param type the resulting type (never {@code null})
287287
* @return the resulting object
288288
* @throws IOException on read error
289289
*/
@@ -295,16 +295,16 @@ protected T readObject(InputStream inputStream, ResolvableType type)
295295

296296
/**
297297
* Read from the specified reader to create an object of the specified type.
298-
* @param reader the source reader ({@code never null})
299-
* @param type the resulting type ({@code never null})
298+
* @param reader the source reader (never {@code null})
299+
* @param type the resulting type (never {@code null})
300300
* @return the resulting object
301301
* @throws IOException on read error
302302
*/
303303
protected abstract T readObject(Reader reader, ResolvableType type)
304304
throws IOException;
305305

306306
/**
307-
* Utility class used to support field initialization. Uses by subclasses to support
307+
* Utility class used to support field initialization. Used by subclasses to support
308308
* {@code initFields}.
309309
* @param <M> The marshaller type
310310
*/

spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424

2525
/**
2626
* AssertJ based JSON tester that works with basic JSON strings. Allows testing of JSON
27-
* payloads created from some any source, for example:<pre class="code">
27+
* payloads created from any source, for example:<pre class="code">
2828
* public class ExampleObjectJsonTests {
2929
*
30-
* private BasicJsonTester = new BasicJsonTester(getClass());
30+
* private BasicJsonTester json = new BasicJsonTester(getClass());
3131
*
3232
* &#064;Test
33-
* public void testWriteJson() {
33+
* public void testWriteJson() throws IOException {
3434
* assertThat(json.from("example.json")).extractingJsonPathStringValue("@.name")
3535
.isEqualTo("Spring");
3636
* }
@@ -70,7 +70,7 @@ public JsonContent<Object> from(CharSequence source) {
7070
/**
7171
* Create JSON content from the specified resource path.
7272
* @param path the path of the resource to load
73-
* @param resourceLoadClass the classloader used load the resource
73+
* @param resourceLoadClass the source class used to load the resource
7474
* @return the JSON content
7575
*/
7676
public JsonContent<Object> from(String path, Class<?> resourceLoadClass) {

spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* }
4040
*
4141
* &#064;Test
42-
* public void testWriteJson() {
42+
* public void testWriteJson() throws IOException {
4343
* ExampleObject object = //...
4444
* assertThat(json.write(object)).isEqualToJson("expected.json");
4545
* }
@@ -49,7 +49,7 @@
4949
*
5050
* See {@link AbstractJsonMarshalTester} for more details.
5151
*
52-
* @param <T> The type under test
52+
* @param <T> the type under test
5353
* @author Phillip Webb
5454
* @since 1.4.0
5555
*/
@@ -81,7 +81,7 @@ protected T readObject(Reader reader, ResolvableType type) throws IOException {
8181
}
8282

8383
/**
84-
* Utility method to initialize {@link JacksonTester} fields. See {@link JacksonTester
84+
* Utility method to initialize {@link GsonTester} fields. See {@link GsonTester
8585
* class-level documentation} for example usage.
8686
* @param testInstance the test instance
8787
* @param gson the Gson instance
@@ -91,7 +91,7 @@ public static void initFields(Object testInstance, Gson gson) {
9191
}
9292

9393
/**
94-
* Utility method to initialize {@link JacksonTester} fields. See {@link JacksonTester
94+
* Utility method to initialize {@link GsonTester} fields. See {@link GsonTester
9595
* class-level documentation} for example usage.
9696
* @param testInstance the test instance
9797
* @param gson an object factory to create the Gson instance
@@ -101,7 +101,7 @@ public static void initFields(Object testInstance, ObjectFactory<Gson> gson) {
101101
}
102102

103103
/**
104-
* {@link JsonTesterFieldInitializer} for Gson.
104+
* {@link FieldInitializer} for Gson.
105105
*/
106106
private static class GsonFieldInitializer extends FieldInitializer<Gson> {
107107

spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* }
4242
*
4343
* &#064;Test
44-
* public void testWriteJson() {
44+
* public void testWriteJson() throws IOException {
4545
* ExampleObject object = //...
4646
* assertThat(json.write(object)).isEqualToJson("expected.json");
4747
* }
@@ -51,7 +51,7 @@
5151
*
5252
* See {@link AbstractJsonMarshalTester} for more details.
5353
*
54-
* @param <T> The type under test
54+
* @param <T> the type under test
5555
* @author Phillip Webb
5656
* @since 1.4.0
5757
*/
@@ -116,7 +116,7 @@ public static void initFields(Object testInstance,
116116
}
117117

118118
/**
119-
* {@link JsonTesterFieldInitializer} for Jackson.
119+
* {@link FieldInitializer} for Jackson.
120120
*/
121121
private static class JacksonFieldInitializer extends FieldInitializer<ObjectMapper> {
122122

spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* {@link AssertProvider provide} {@link JsonContentAssert} to AssertJ {@code assertThat}
2727
* calls.
2828
*
29-
* @param <T> The source type that created the content
29+
* @param <T> the source type that created the content
3030
* @author Phillip Webb
3131
* @since 1.4.0
3232
*/

spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ public JsonContentAssert hasEmptyJsonPathValue(CharSequence expression,
843843
/**
844844
* Verify that the actual value at the given JSON path produces no result. If the JSON
845845
* path expression is not {@linkplain JsonPath#isDefinite() definite}, this method
846-
* verifies that the value at the given path is not <em>empty</em>.
846+
* verifies that the value at the given path is <em>empty</em>.
847847
* @param expression the {@link JsonPath} expression
848848
* @param args arguments to parameterize the {@code JsonPath} expression with, using
849849
* formatting specifiers defined in {@link String#format(String, Object...)}
@@ -990,7 +990,7 @@ private JSONCompareResult compareForNull(CharSequence expectedJson) {
990990
JSONCompareResult result = new JSONCompareResult();
991991
result.passed();
992992
if (expectedJson != null) {
993-
result.fail("Expected non-null JSON");
993+
result.fail("Expected null JSON");
994994
}
995995
return result;
996996
}
@@ -1079,7 +1079,7 @@ public Object getValue(boolean required) {
10791079
if (!required) {
10801080
return null;
10811081
}
1082-
throw new AssertionError(getNoValueMessage() + ex.getMessage());
1082+
throw new AssertionError(getNoValueMessage() + ". " + ex.getMessage());
10831083
}
10841084
}
10851085

spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
import org.springframework.util.Assert;
2323

2424
/**
25-
* Object content usually created from {@link AbstractJsonMarshalTester}.Generally used
25+
* Object content usually created from {@link AbstractJsonMarshalTester}. Generally used
2626
* only to {@link AssertProvider provide} {@link ObjectContentAssert} to AssertJ
2727
* {@code assertThat} calls.
2828
*
29-
* @param <T> The content type
29+
* @param <T> the content type
3030
* @author Phillip Webb
3131
* @since 1.4.0
3232
*/

spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContentAssert.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.assertj.core.internal.Objects;
2727

2828
/**
29-
* AssertJ {@link Assert} for {@link JsonContent}.
29+
* AssertJ {@link Assert} for {@link ObjectContent}.
3030
*
3131
* @param <A> The actual type
3232
* @author Phillip Webb
@@ -42,7 +42,7 @@ protected ObjectContentAssert(A actual) {
4242
/**
4343
* Verifies that the actual value is an array, and returns an array assertion, to
4444
* allow chaining of array-specific assertions from this call.
45-
* @return a list assertion object
45+
* @return an array assertion object
4646
*/
4747
public AbstractObjectArrayAssert<?, Object> asArray() {
4848
Objects.instance().assertIsInstanceOf(this.info, this.actual, Object[].class);
@@ -51,8 +51,8 @@ public AbstractObjectArrayAssert<?, Object> asArray() {
5151

5252
/**
5353
* Verifies that the actual value is a map, and returns a map assertion, to allow
54-
* chaining of list-specific assertions from this call.
55-
* @return a list assertion object
54+
* chaining of map-specific assertions from this call.
55+
* @return a map assertion object
5656
*/
5757
@SuppressWarnings("unchecked")
5858
public AbstractMapAssert<?, ?, Object, Object> asMap() {

spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected abstract AbstractJsonMarshalTester<Object> createTester(
192192
Class<?> resourceLoadClass, ResolvableType type);
193193

194194
/**
195-
* Access to field backed {@link ResolvableType}.
195+
* Access to field backed by {@link ResolvableType}.
196196
*/
197197
public static class ResolvableTypes {
198198

spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void initFieldsWhenTestIsNullShouldThrowException() {
4141
}
4242

4343
@Test
44-
public void initFieldsWhenObjectMapperIsNullShouldThrowException() {
44+
public void initFieldsWhenMarshallerIsNullShouldThrowException() {
4545
this.thrown.expect(IllegalArgumentException.class);
4646
this.thrown.expectMessage("Marshaller must not be null");
4747
GsonTester.initFields(new InitFieldsTestClass(), (Gson) null);

spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void initFieldsWhenTestIsNullShouldThrowException() {
4040
}
4141

4242
@Test
43-
public void initFieldsWhenObjectMapperIsNullShouldThrowException() {
43+
public void initFieldsWhenMarshallerIsNullShouldThrowException() {
4444
this.thrown.expect(IllegalArgumentException.class);
4545
this.thrown.expectMessage("Marshaller must not be null");
4646
JacksonTester.initFields(new InitFieldsTestClass(), (ObjectMapper) null);

0 commit comments

Comments
 (0)