Merge branch '2.5.x'

Closes gh-28425
pull/28436/head
Phillip Webb 3 years ago
commit e25f216eab

@ -49,7 +49,7 @@ public class MetricsProperties {
/** /**
* Whether meter IDs starting with the specified name should be enabled. The longest * Whether meter IDs starting with the specified name should be enabled. The longest
* match wins, the key `all` can also be used to configure all meters. * match wins, the key {@code "all"} can also be used to configure all meters.
*/ */
private final Map<String, Boolean> enable = new LinkedHashMap<>(); private final Map<String, Boolean> enable = new LinkedHashMap<>();
@ -301,15 +301,15 @@ public class MetricsProperties {
* Whether meter IDs starting with the specified name should publish percentile * Whether meter IDs starting with the specified name should publish percentile
* histograms. For monitoring systems that support aggregable percentile * histograms. For monitoring systems that support aggregable percentile
* calculation based on a histogram, this can be set to true. For other systems, * calculation based on a histogram, this can be set to true. For other systems,
* this has no effect. The longest match wins, the key `all` can also be used to * this has no effect. The longest match wins, the key {@code "all"} can also be
* configure all meters. * used to configure all meters.
*/ */
private final Map<String, Boolean> percentilesHistogram = new LinkedHashMap<>(); private final Map<String, Boolean> percentilesHistogram = new LinkedHashMap<>();
/** /**
* Specific computed non-aggregable percentiles to ship to the backend for meter * Specific computed non-aggregable percentiles to ship to the backend for meter
* IDs starting-with the specified name. The longest match wins, the key `all` can * IDs starting-with the specified name. The longest match wins, the key
* also be used to configure all meters. * {@code "all"} can also be used to configure all meters.
*/ */
private final Map<String, double[]> percentiles = new LinkedHashMap<>(); private final Map<String, double[]> percentiles = new LinkedHashMap<>();

@ -49,8 +49,8 @@ public class ManagementServerProperties {
private InetAddress address; private InetAddress address;
/** /**
* Management endpoint base path (for instance, `/management`). Requires a custom * Management endpoint base path (for instance, {@code '/management'}). Requires a
* management.server.port. * custom management.server.port.
*/ */
private String basePath = ""; private String basePath = "";

@ -61,7 +61,7 @@ public abstract class AbstractEndpointDocumentationTests {
protected static String describeEnumValues(Class<? extends Enum<?>> enumType) { protected static String describeEnumValues(Class<? extends Enum<?>> enumType) {
return StringUtils.collectionToDelimitedString(Stream.of(enumType.getEnumConstants()) return StringUtils.collectionToDelimitedString(Stream.of(enumType.getEnumConstants())
.map((constant) -> "`" + constant.name() + "`").collect(Collectors.toList()), ", "); .map((constant) -> "'" + constant.name() + "'").collect(Collectors.toList()), ", ");
} }
protected OperationPreprocessor limit(String... keys) { protected OperationPreprocessor limit(String... keys) {

@ -64,7 +64,7 @@ class ConfigurationPropertiesReportEndpointDocumentationTests extends MockMvcEnd
preprocessResponse(limit("contexts", getApplicationContext().getId(), "beans")), preprocessResponse(limit("contexts", getApplicationContext().getId(), "beans")),
responseFields(fieldWithPath("contexts").description("Application contexts keyed by id."), responseFields(fieldWithPath("contexts").description("Application contexts keyed by id."),
fieldWithPath("contexts.*.beans.*") fieldWithPath("contexts.*.beans.*")
.description("`@ConfigurationProperties` beans keyed by bean name."), .description("@ConfigurationProperties beans keyed by bean name."),
fieldWithPath("contexts.*.beans.*.prefix") fieldWithPath("contexts.*.beans.*.prefix")
.description("Prefix applied to the names of the bean's properties."), .description("Prefix applied to the names of the bean's properties."),
subsectionWithPath("contexts.*.beans.*.properties") subsectionWithPath("contexts.*.beans.*.properties")

@ -82,7 +82,7 @@ class HealthEndpointDocumentationTests extends MockMvcEndpointDocumentationTests
.description("The nested components that make up the health.").optional(); .description("The nested components that make up the health.").optional();
FieldDescriptor componentDetails = subsectionWithPath("components.*.details") FieldDescriptor componentDetails = subsectionWithPath("components.*.details")
.description("Details of the health of a specific part of the application. " .description("Details of the health of a specific part of the application. "
+ "Presence is controlled by `management.endpoint.health.show-details`.") + "Presence is controlled by 'management.endpoint.health.show-details'.")
.optional(); .optional();
this.mockMvc.perform(get("/actuator/health").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) this.mockMvc.perform(get("/actuator/health").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk())
.andDo(document("health", .andDo(document("health",

@ -70,7 +70,7 @@ class MetricsEndpointDocumentationTests extends MockMvcEndpointDocumentationTest
"id:Compressed Class Space")) "id:Compressed Class Space"))
.andExpect(status().isOk()) .andExpect(status().isOk())
.andDo(document("metrics/metric-with-tags", requestParameters(parameterWithName("tag") .andDo(document("metrics/metric-with-tags", requestParameters(parameterWithName("tag")
.description("A tag to use for drill-down in the form `name:value`.")))); .description("A tag to use for drill-down in the form 'name:value'."))));
} }
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)

@ -117,7 +117,7 @@ class ThreadDumpEndpointDocumentationTests extends MockMvcEndpointDocumentationT
.optional().type(JsonFieldType.NUMBER), .optional().type(JsonFieldType.NUMBER),
fieldWithPath("threads.[].lockOwnerId") fieldWithPath("threads.[].lockOwnerId")
.description("ID of the thread that owns the object on which " .description("ID of the thread that owns the object on which "
+ "the thread is blocked. `-1` if the " + "the thread is blocked. '-1' if the "
+ "thread is not blocked."), + "thread is not blocked."),
fieldWithPath("threads.[].lockOwnerName") fieldWithPath("threads.[].lockOwnerName")
.description("Name of the thread that owns the " .description("Name of the thread that owns the "

@ -922,12 +922,12 @@ public class RabbitProperties {
private Boolean mandatory; private Boolean mandatory;
/** /**
* Timeout for `receive()` operations. * Timeout for {@code receive()} operations.
*/ */
private Duration receiveTimeout; private Duration receiveTimeout;
/** /**
* Timeout for `sendAndReceive()` operations. * Timeout for {@code sendAndReceive()} operations.
*/ */
private Duration replyTimeout; private Duration replyTimeout;

@ -98,7 +98,7 @@ public class BatchProperties {
/** /**
* Comma-separated list of job names to execute on startup (for instance, * Comma-separated list of job names to execute on startup (for instance,
* `job1,job2`). By default, all Jobs found in the context are executed. * {@code "job1,job2"}). By default, all Jobs found in the context are executed.
*/ */
private String names = ""; private String names = "";

@ -46,7 +46,7 @@ class RedisUrlSyntaxFailureAnalyzer extends AbstractFailureAnalyzer<RedisUrlSynt
} }
if (!"redis".equals(uri.getScheme()) && !"rediss".equals(uri.getScheme())) { if (!"redis".equals(uri.getScheme()) && !"rediss".equals(uri.getScheme())) {
return new FailureAnalysis(getUnsupportedSchemeDescription(cause.getUrl(), uri.getScheme()), return new FailureAnalysis(getUnsupportedSchemeDescription(cause.getUrl(), uri.getScheme()),
"Use the scheme 'redis://` for insecure or `rediss://` for secure Redis standalone configuration.", "Use the scheme 'redis://' for insecure or 'rediss://' for secure Redis standalone configuration.",
cause); cause);
} }
} }

@ -45,7 +45,7 @@ public class JacksonProperties {
/** /**
* Date format string or a fully-qualified date format class name. For instance, * Date format string or a fully-qualified date format class name. For instance,
* `yyyy-MM-dd HH:mm:ss`. * {@code "yyyy-MM-dd HH:mm:ss"}.
*/ */
private String dateFormat; private String dateFormat;

@ -37,7 +37,7 @@ public class MailProperties {
private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
/** /**
* SMTP server host. For instance, `smtp.example.com`. * SMTP server host. For instance, {@code "smtp.example.com"}.
*/ */
private String host; private String host;

@ -37,7 +37,7 @@ class NonUniqueSessionRepositoryFailureAnalyzer extends AbstractFailureAnalyzer<
StringBuilder action = new StringBuilder(); StringBuilder action = new StringBuilder();
action.append(String.format("Consider any of the following:%n")); action.append(String.format("Consider any of the following:%n"));
action.append( action.append(
String.format(" - Define the `spring.session.store-type` property to the store you want to use%n")); String.format(" - Define the 'spring.session.store-type' property to the store you want to use%n"));
action.append(String.format(" - Review your classpath and remove the unwanted store implementation(s)%n")); action.append(String.format(" - Review your classpath and remove the unwanted store implementation(s)%n"));
return new FailureAnalysis(message.toString(), action.toString(), cause); return new FailureAnalysis(message.toString(), action.toString(), cause);
} }

@ -985,7 +985,7 @@ public class ServerProperties {
/** /**
* Name of the HTTP header from which the remote IP is extracted. For * Name of the HTTP header from which the remote IP is extracted. For
* instance, `X-FORWARDED-FOR`. * instance, {@code "X-FORWARDED-FOR"}.
*/ */
private String remoteIpHeader; private String remoteIpHeader;

@ -84,17 +84,17 @@ public class WebFluxProperties {
public static class Format { public static class Format {
/** /**
* Date format to use, for example `dd/MM/yyyy`. * Date format to use, for example {@code "dd/MM/yyyy"}.
*/ */
private String date; private String date;
/** /**
* Time format to use, for example `HH:mm:ss`. * Time format to use, for example {@code "HH:mm:ss"}.
*/ */
private String time; private String time;
/** /**
* Date-time format to use, for example `yyyy-MM-dd HH:mm:ss`. * Date-time format to use, for example {@code "yyyy-MM-dd HH:mm:ss"}.
*/ */
private String dateTime; private String dateTime;

@ -41,7 +41,7 @@ import org.springframework.validation.DefaultMessageCodesResolver;
public class WebMvcProperties { public class WebMvcProperties {
/** /**
* Formatting strategy for message codes. For instance, `PREFIX_ERROR_CODE`. * Formatting strategy for message codes. For instance, {@code PREFIX_ERROR_CODE}.
*/ */
private DefaultMessageCodesResolver.Format messageCodesResolverFormat; private DefaultMessageCodesResolver.Format messageCodesResolverFormat;
@ -456,17 +456,17 @@ public class WebMvcProperties {
public static class Format { public static class Format {
/** /**
* Date format to use, for example `dd/MM/yyyy`. * Date format to use, for example {@code "dd/MM/yyyy"}.
*/ */
private String date; private String date;
/** /**
* Time format to use, for example `HH:mm:ss`. * Time format to use, for example {@code "HH:mm:ss"}.
*/ */
private String time; private String time;
/** /**
* Date-time format to use, for example `yyyy-MM-dd HH:mm:ss`. * Date-time format to use, for example {@code "yyyy-MM-dd HH:mm:ss"}.
*/ */
private String dateTime; private String dateTime;

@ -43,7 +43,7 @@ class RedisUrlSyntaxFailureAnalyzerTests {
FailureAnalysis analysis = new RedisUrlSyntaxFailureAnalyzer().analyze(exception); FailureAnalysis analysis = new RedisUrlSyntaxFailureAnalyzer().analyze(exception);
assertThat(analysis.getDescription()).contains("The URL 'http://127.0.0.1:26379/mymaster' is not valid") assertThat(analysis.getDescription()).contains("The URL 'http://127.0.0.1:26379/mymaster' is not valid")
.contains("The scheme 'http' is not supported"); .contains("The scheme 'http' is not supported");
assertThat(analysis.getAction()).contains("Use the scheme 'redis://` for insecure or `rediss://` for secure"); assertThat(analysis.getAction()).contains("Use the scheme 'redis://' for insecure or 'rediss://' for secure");
} }
@Test @Test

@ -233,7 +233,7 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
element.toString()); element.toString());
if (this.metadataCollector.hasSimilarGroup(group)) { if (this.metadataCollector.hasSimilarGroup(group)) {
this.processingEnv.getMessager().printMessage(Kind.ERROR, this.processingEnv.getMessager().printMessage(Kind.ERROR,
"Duplicate `@ConfigurationProperties` definition for prefix '" + prefix + "'", element); "Duplicate @ConfigurationProperties definition for prefix '" + prefix + "'", element);
} }
else { else {
this.metadataCollector.add(group); this.metadataCollector.add(group);

@ -33,7 +33,7 @@ class GettingStartedDocumentationTests {
GradleBuild gradleBuild; GradleBuild gradleBuild;
// NOTE: We can't run any `apply-plugin` tests because during a release the // NOTE: We can't run any 'apply-plugin' tests because during a release the
// jar won't be there // jar won't be there
@TestTemplate @TestTemplate

@ -42,7 +42,7 @@ import org.springframework.util.MultiValueMap;
* layer. * layer.
* <p> * <p>
* Index files are designed to be compatible with YAML and may be read into a list of * Index files are designed to be compatible with YAML and may be read into a list of
* `Map&lt;String, List&lt;String&gt;&gt;` instances. * {@code Map<String, List<String>>} instances.
* *
* @author Madhura Bhave * @author Madhura Bhave
* @author Andy Wilkinson * @author Andy Wilkinson

@ -32,7 +32,7 @@ class PatternParseFailureAnalyzer extends AbstractFailureAnalyzer<PatternParseEx
protected FailureAnalysis analyze(Throwable rootFailure, PatternParseException cause) { protected FailureAnalysis analyze(Throwable rootFailure, PatternParseException cause) {
return new FailureAnalysis("Invalid mapping pattern detected: " + cause.toDetailedString(), return new FailureAnalysis("Invalid mapping pattern detected: " + cause.toDetailedString(),
"Fix this pattern in your application or switch to the legacy parser implementation with " "Fix this pattern in your application or switch to the legacy parser implementation with "
+ "`spring.mvc.pathpattern.matching-strategy=ant_path_matcher`.", + "'spring.mvc.pathpattern.matching-strategy=ant_path_matcher'.",
cause); cause);
} }

@ -15,6 +15,6 @@
*/ */
/** /**
* Classes and utilities designed to work with the `javax.servlet` specification. * Classes and utilities designed to work with the {@code javax.servlet} specification.
*/ */
package org.springframework.boot.web.servlet; package org.springframework.boot.web.servlet;

@ -709,7 +709,7 @@ class ConfigurationPropertyNameTests {
void hashCodeIsStored() { void hashCodeIsStored() {
ConfigurationPropertyName name = ConfigurationPropertyName.of("hash.code"); ConfigurationPropertyName name = ConfigurationPropertyName.of("hash.code");
int hashCode = name.hashCode(); int hashCode = name.hashCode();
// hasFieldOrPropertyWithValue would lookup for `hashCode()`. // hasFieldOrPropertyWithValue would lookup for hashCode()
assertThat(ReflectionTestUtils.getField(name, "hashCode")).isEqualTo(hashCode); assertThat(ReflectionTestUtils.getField(name, "hashCode")).isEqualTo(hashCode);
} }

@ -39,7 +39,7 @@ class PatternParseFailureAnalyzerTests {
assertThat(failureAnalysis.getDescription()).contains("Invalid mapping pattern detected: /spring/**/framework"); assertThat(failureAnalysis.getDescription()).contains("Invalid mapping pattern detected: /spring/**/framework");
assertThat(failureAnalysis.getAction()) assertThat(failureAnalysis.getAction())
.contains("Fix this pattern in your application or switch to the legacy parser" .contains("Fix this pattern in your application or switch to the legacy parser"
+ " implementation with `spring.mvc.pathpattern.matching-strategy=ant_path_matcher`."); + " implementation with 'spring.mvc.pathpattern.matching-strategy=ant_path_matcher'.");
} }
private FailureAnalysis performAnalysis(String pattern) { private FailureAnalysis performAnalysis(String pattern) {

Loading…
Cancel
Save