Skip to content

Commit

Permalink
Don't use markdown syntax in javadoc or error messages
Browse files Browse the repository at this point in the history
Closes gh-28408
  • Loading branch information
philwebb committed Oct 21, 2021
1 parent d6a1001 commit 2f6651c
Show file tree
Hide file tree
Showing 25 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class MetricsProperties {

/**
* 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<>();

Expand Down Expand Up @@ -220,15 +220,15 @@ public static class Distribution {
* Whether meter IDs starting with the specified name should publish percentile
* histograms. For monitoring systems that support aggregable percentile
* 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
* configure all meters.
* this has no effect. The longest match wins, the key {@code "all"} can also be
* used to configure all meters.
*/
private final Map<String, Boolean> percentilesHistogram = new LinkedHashMap<>();

/**
* 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
* also be used to configure all meters.
* IDs starting-with the specified name. The longest match wins, the key
* {@code "all"} can also be used to configure all meters.
*/
private final Map<String, double[]> percentiles = new LinkedHashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public class ManagementServerProperties {
private InetAddress address;

/**
* Management endpoint base path (for instance, `/management`). Requires a custom
* management.server.port.
* Management endpoint base path (for instance, {@code '/management'}). Requires a
* custom management.server.port.
*/
private String basePath = "";

Expand Down Expand Up @@ -128,8 +128,8 @@ private String cleanBasePath(String basePath) {
public static class Servlet {

/**
* Management endpoint context-path (for instance, `/management`). Requires a
* custom management.server.port.
* Management endpoint context-path (for instance, {@code '/management'}).
* Requires a custom management.server.port.
*/
private String contextPath = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public abstract class AbstractEndpointDocumentationTests {

protected String describeEnumValues(Class<? extends Enum<?>> enumType) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void configProps() throws Exception {
preprocessResponse(limit("contexts", getApplicationContext().getId(), "beans")),
responseFields(fieldWithPath("contexts").description("Application contexts keyed by id."),
fieldWithPath("contexts.*.beans.*")
.description("`@ConfigurationProperties` beans keyed by bean name."),
.description("@ConfigurationProperties beans keyed by bean name."),
fieldWithPath("contexts.*.beans.*.prefix")
.description("Prefix applied to the names of the bean's properties."),
subsectionWithPath("contexts.*.beans.*.properties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void health() throws Exception {
.description("The nested components that make up the health.").optional();
FieldDescriptor componentDetails = subsectionWithPath("components.*.details")
.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();
this.mockMvc.perform(get("/actuator/health").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk())
.andDo(document("health",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void metricWithTags() throws Exception {
"id:Compressed Class Space"))
.andExpect(status().isOk())
.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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void jsonThreadDump() throws Exception {
.optional().type(JsonFieldType.NUMBER),
fieldWithPath("threads.[].lockOwnerId")
.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."),
fieldWithPath("threads.[].lockOwnerName")
.description("Name of the thread that owns the "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,12 +853,12 @@ public static class Template {
private Boolean mandatory;

/**
* Timeout for `receive()` operations.
* Timeout for {@code receive()} operations.
*/
private Duration receiveTimeout;

/**
* Timeout for `sendAndReceive()` operations.
* Timeout for {@code sendAndReceive()} operations.
*/
private Duration replyTimeout;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static class Job {

/**
* 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 = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected FailureAnalysis analyze(Throwable rootFailure, RedisUrlSyntaxException
}
if (!"redis".equals(uri.getScheme()) && !"rediss".equals(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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class JacksonProperties {

/**
* 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class MailProperties {
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected FailureAnalysis analyze(Throwable rootFailure, NonUniqueSessionReposit
StringBuilder action = new StringBuilder();
action.append(String.format("Consider any of the following:%n"));
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"));
return new FailureAnalysis(message.toString(), action.toString(), cause);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ public static class Remoteip {

/**
* 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ public void setStaticPathPattern(String staticPathPattern) {
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;

/**
* Time format to use, for example `HH:mm:ss`.
* Time format to use, for example {@code "HH:mm:ss"}.
*/
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
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;

Expand Down Expand Up @@ -493,17 +493,17 @@ public void setUseRegisteredSuffixPattern(boolean useRegisteredSuffixPattern) {
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;

/**
* Time format to use, for example `HH:mm:ss`.
* Time format to use, for example {@code "HH:mm:ss"}.
*/
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void analyzeRedisHttpUrl() {
FailureAnalysis analysis = new RedisUrlSyntaxFailureAnalyzer().analyze(exception);
assertThat(analysis.getDescription()).contains("The URL 'http://127.0.0.1:26379/mymaster' is not valid")
.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private void processExecutableElement(String prefix, ExecutableElement element,
element.toString());
if (this.metadataCollector.hasSimilarGroup(group)) {
this.processingEnv.getMessager().printMessage(Kind.ERROR,
"Duplicate `@ConfigurationProperties` definition for prefix '" + prefix + "'", element);
"Duplicate @ConfigurationProperties definition for prefix '" + prefix + "'", element);
}
else {
this.metadataCollector.add(group);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GettingStartedDocumentationTests {

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

@TestTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* layer.
* <p>
* 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 Andy Wilkinson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PatternParseFailureAnalyzer extends AbstractFailureAnalyzer<PatternParseEx
protected FailureAnalysis analyze(Throwable rootFailure, PatternParseException cause) {
return new FailureAnalysis("Invalid mapping pattern detected: " + cause.toDetailedString(),
"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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
public interface ErrorController {

/**
* The return value from this method is not used; the property `server.error.path`
* must be set to override the default error page path.
* The return value from this method is not used; the property
* {@code "server.error.path"} must be set to override the default error page path.
* @return the error path
* @deprecated since 2.3.0 for removal in 2.5.0 in favor of setting the property
* `server.error.path`
* {@code server.error.path}
*/
@Deprecated
String getErrorPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ void isValidWhenNotValidShouldReturnFalse() {
void hashCodeIsStored() {
ConfigurationPropertyName name = ConfigurationPropertyName.of("hash.code");
int hashCode = name.hashCode();
// hasFieldOrPropertyWithValue would lookup for `hashCode()`.
// hasFieldOrPropertyWithValue would lookup for hashCode()
assertThat(ReflectionTestUtils.getField(name, "hashCode")).isEqualTo(hashCode);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void patternParseFailureQuotesPattern() {
assertThat(failureAnalysis.getDescription()).contains("Invalid mapping pattern detected: /spring/**/framework");
assertThat(failureAnalysis.getAction())
.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) {
Expand Down

0 comments on commit 2f6651c

Please sign in to comment.