From 0f479293b17765f7077a61a6b7b130754b6176de Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Thu, 14 Jul 2022 12:36:40 +0200 Subject: [PATCH] Replace use of the HTML tag in Javadoc The HTML tag was used in HTML 4 to define teletype text. It is not supported in HTML5, and its use is discouraged. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tt Closes gh-28819 --- .../src/main/java/org/springframework/cache/Cache.java | 2 +- .../core/annotation/AnnotationTypeMappings.java | 2 +- .../springframework/core/annotation/AttributeMethods.java | 2 +- .../org/springframework/core/convert/TypeDescriptor.java | 8 ++++---- .../core/convert/converter/ConvertingComparator.java | 2 +- .../org/springframework/core/io/buffer/DataBuffer.java | 6 +++--- .../java/org/springframework/util/AntPathMatcher.java | 2 +- .../springframework/util/FastByteArrayOutputStream.java | 2 +- .../main/java/org/springframework/web/util/WebUtils.java | 6 +++--- .../web/util/pattern/InternalPathPatternParser.java | 4 ++-- .../web/util/pattern/RegexPathElement.java | 2 +- .../web/servlet/view/json/MappingJackson2JsonView.java | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/cache/Cache.java b/spring-context/src/main/java/org/springframework/cache/Cache.java index dea4505d9ad2..1a33df9bb3b9 100644 --- a/spring-context/src/main/java/org/springframework/cache/Cache.java +++ b/spring-context/src/main/java/org/springframework/cache/Cache.java @@ -24,7 +24,7 @@ * Interface that defines common cache operations. * * Note: Due to the generic use of caching, it is recommended that - * implementations allow storage of null values (for example to + * implementations allow storage of {@code null} values (for example to * cache methods that return {@code null}). * * @author Costin Leau diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java index a676583d570f..dda99ff991aa 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java @@ -160,7 +160,7 @@ int size() { * @param index the index to return * @return the {@link AnnotationTypeMapping} * @throws IndexOutOfBoundsException if the index is out of range - * (index < 0 || index >= size()) + * ({@code index < 0 || index >= size()}) */ AnnotationTypeMapping get(int index) { return this.mappings.get(index); diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AttributeMethods.java b/spring-core/src/main/java/org/springframework/core/annotation/AttributeMethods.java index cceda871eb59..d66fb66096b8 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AttributeMethods.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AttributeMethods.java @@ -168,7 +168,7 @@ Method get(String name) { * @param index the index of the attribute to return * @return the attribute method * @throws IndexOutOfBoundsException if the index is out of range - * (index < 0 || index >= size()) + * ({@code index < 0 || index >= size()}) */ Method get(int index) { return this.attributeMethods[index]; diff --git a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java index 0f2dffcfd46e..f8d93aca145a 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java +++ b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java @@ -238,7 +238,7 @@ public Annotation[] getAnnotations() { *

As of Spring Framework 4.2, this method supports arbitrary levels * of meta-annotations. * @param annotationType the annotation type - * @return true if the annotation is present + * @return {@code true} if the annotation is present */ public boolean hasAnnotation(Class annotationType) { if (this.annotatedElement.isEmpty()) { @@ -273,8 +273,8 @@ public T getAnnotation(Class annotationType) { * On the other hand, {@code valueOf(Number.class).isAssignableTo(valueOf(Integer.class))} * returns {@code false} because, while all Integers are Numbers, not all Numbers are Integers. *

For arrays, collections, and maps, element and key/value types are checked if declared. - * For example, a List<String> field value is assignable to a Collection<CharSequence> - * field, but List<Number> is not assignable to List<Integer>. + * For example, a {@code List} field value is assignable to a {@code Collection} + * field, but {@code List} is not assignable to {@code List}. * @return {@code true} if this type is assignable to the type represented by the provided * type descriptor * @see #getObjectType() @@ -576,7 +576,7 @@ public static TypeDescriptor collection(Class collectionType, @Nullable TypeD /** * Create a new type descriptor from a {@link java.util.Map} type. *

Useful for converting to typed Maps. - *

For example, a Map<String, String> could be converted to a Map<Id, EmailAddress> + *

For example, a {@code Map} could be converted to a {@code Map} * by converting to a targetType built with this method: * The method call to construct such a TypeDescriptor would look something like: *

diff --git a/spring-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java b/spring-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java
index dadf4cdfcad1..f8c78fed4877 100644
--- a/spring-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java
+++ b/spring-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java
@@ -104,7 +104,7 @@ public static  ConvertingComparator, V> mapEntryValues(Com
 
 
 	/**
-	 * Adapts a {@link ConversionService} and targetType to a {@link Converter}.
+	 * Adapts a {@link ConversionService} and {@code targetType} to a {@link Converter}.
 	 */
 	private static class ConversionServiceConverter implements Converter {
 
diff --git a/spring-core/src/main/java/org/springframework/core/io/buffer/DataBuffer.java b/spring-core/src/main/java/org/springframework/core/io/buffer/DataBuffer.java
index 6f5a38bded45..b419d04e28ce 100644
--- a/spring-core/src/main/java/org/springframework/core/io/buffer/DataBuffer.java
+++ b/spring-core/src/main/java/org/springframework/core/io/buffer/DataBuffer.java
@@ -38,9 +38,9 @@
  * the following invariant holds for the read and write positions, and the capacity:
  *
  * 
- * 0 <= - * readPosition <= - * writePosition <= + * {@code 0} {@code <=} + * readPosition {@code <=} + * writePosition {@code <=} * capacity *
* diff --git a/spring-core/src/main/java/org/springframework/util/AntPathMatcher.java b/spring-core/src/main/java/org/springframework/util/AntPathMatcher.java index 396b0afe8654..977f15b9846a 100644 --- a/spring-core/src/main/java/org/springframework/util/AntPathMatcher.java +++ b/spring-core/src/main/java/org/springframework/util/AntPathMatcher.java @@ -638,7 +638,7 @@ public Comparator getPatternComparator(String path) { /** * Tests whether a string matches against a pattern via a {@link Pattern}. *

The pattern may contain special characters: '*' means zero or more characters; '?' means one and - * only one character; '{' and '}' indicate a URI template pattern. For example /users/{user}. + * only one character; '{' and '}' indicate a URI template pattern. For example {@code /users/{user}}. */ protected static class AntPathStringMatcher { diff --git a/spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java b/spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java index 28fc2fff9249..e2673124aa15 100644 --- a/spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java +++ b/spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java @@ -150,7 +150,7 @@ public void close() { /** * Convert the buffer's contents into a string decoding bytes using the - * platform's default character set. The length of the new String + * platform's default character set. The length of the new {@code String} * is a function of the character set, and hence may not be equal to the * size of the buffer. *

This method always replaces malformed-input and unmappable-character diff --git a/spring-web/src/main/java/org/springframework/web/util/WebUtils.java b/spring-web/src/main/java/org/springframework/web/util/WebUtils.java index 6e64f214863d..28c1c515bc6f 100644 --- a/spring-web/src/main/java/org/springframework/web/util/WebUtils.java +++ b/spring-web/src/main/java/org/springframework/web/util/WebUtils.java @@ -628,17 +628,17 @@ public static String findParameterValue(ServletRequest request, String name) { * following algorithm: *

    *
  1. Try to get the parameter value using just the given logical name. - * This handles parameters of the form logicalName = value. For normal + * This handles parameters of the form {@code logicalName = value}. For normal * parameters, e.g. submitted using a hidden HTML form field, this will return * the requested value.
  2. *
  3. Try to obtain the parameter value from the parameter name, where the - * parameter name in the request is of the form logicalName_value = xyz + * parameter name in the request is of the form {@code logicalName_value = xyz} * with "_" being the configured delimiter. This deals with parameter values * submitted using an HTML form submit button.
  4. *
  5. If the value obtained in the previous step has a ".x" or ".y" suffix, * remove that. This handles cases where the value was submitted using an * HTML form image button. In this case the parameter in the request would - * actually be of the form logicalName_value.x = 123.
  6. + * actually be of the form {@code logicalName_value.x = 123}. *
* @param parameters the available parameter map * @param name the logical name of the request parameter diff --git a/spring-web/src/main/java/org/springframework/web/util/pattern/InternalPathPatternParser.java b/spring-web/src/main/java/org/springframework/web/util/pattern/InternalPathPatternParser.java index eb85e45b98d5..1e9a98883898 100644 --- a/spring-web/src/main/java/org/springframework/web/util/pattern/InternalPathPatternParser.java +++ b/spring-web/src/main/java/org/springframework/web/util/pattern/InternalPathPatternParser.java @@ -192,8 +192,8 @@ else if ((this.pos > (this.variableCaptureStart + 1 + (this.isCaptureTheRestVari * Just hit a ':' and want to jump over the regex specification for this * variable. pos will be pointing at the ':', we want to skip until the }. *

- * Nested {...} pairs don't have to be escaped: /abc/{var:x{1,2}}/def - *

An escaped } will not be treated as the end of the regex: /abc/{var:x\\{y:}/def + * Nested {...} pairs don't have to be escaped: /abc/{var:x{1,2}}/def + *

An escaped } will not be treated as the end of the regex: /abc/{var:x\\{y:}/def *

A separator that should not indicate the end of the regex can be escaped: */ private void skipCaptureRegex() { diff --git a/spring-web/src/main/java/org/springframework/web/util/pattern/RegexPathElement.java b/spring-web/src/main/java/org/springframework/web/util/pattern/RegexPathElement.java index d66e7a7ce2dc..e71fbdafa6b0 100644 --- a/spring-web/src/main/java/org/springframework/web/util/pattern/RegexPathElement.java +++ b/spring-web/src/main/java/org/springframework/web/util/pattern/RegexPathElement.java @@ -26,7 +26,7 @@ /** * A regex path element. Used to represent any complicated element of the path. - * For example in '/foo/*_*/*_{foobar}' both *_* and *_{foobar} + * For example in '/foo/*_*/*_{foobar}' both {@code *_*} and {@code *_{foobar}} * are {@link RegexPathElement} path elements. Derived from the general * {@link org.springframework.util.AntPathMatcher} approach. * diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java index 25290cc28196..16b1e354e62f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java @@ -97,7 +97,7 @@ public void setJsonPrefix(String jsonPrefix) { } /** - * Indicates whether the JSON output by this view should be prefixed with ")]}', ". + * Indicates whether the JSON output by this view should be prefixed with ")]}', ". * Default is {@code false}. *

Prefixing the JSON string in this manner is used to help prevent JSON Hijacking. * The prefix renders the string syntactically invalid as a script so that it cannot be hijacked.