Skip to content

Commit 0f47929

Browse files
marcwrobelsbrannen
authored andcommitted
Replace use of the <tt> HTML tag in Javadoc
The <tt> 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
1 parent 5f5d383 commit 0f47929

File tree

12 files changed

+20
-20
lines changed

12 files changed

+20
-20
lines changed

spring-context/src/main/java/org/springframework/cache/Cache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Interface that defines common cache operations.
2525
*
2626
* <b>Note:</b> Due to the generic use of caching, it is recommended that
27-
* implementations allow storage of <tt>null</tt> values (for example to
27+
* implementations allow storage of {@code null} values (for example to
2828
* cache methods that return {@code null}).
2929
*
3030
* @author Costin Leau

spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int size() {
160160
* @param index the index to return
161161
* @return the {@link AnnotationTypeMapping}
162162
* @throws IndexOutOfBoundsException if the index is out of range
163-
* (<tt>index &lt; 0 || index &gt;= size()</tt>)
163+
* ({@code index < 0 || index >= size()})
164164
*/
165165
AnnotationTypeMapping get(int index) {
166166
return this.mappings.get(index);

spring-core/src/main/java/org/springframework/core/annotation/AttributeMethods.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Method get(String name) {
168168
* @param index the index of the attribute to return
169169
* @return the attribute method
170170
* @throws IndexOutOfBoundsException if the index is out of range
171-
* (<tt>index &lt; 0 || index &gt;= size()</tt>)
171+
* ({@code index < 0 || index >= size()})
172172
*/
173173
Method get(int index) {
174174
return this.attributeMethods[index];

spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public Annotation[] getAnnotations() {
238238
* <p>As of Spring Framework 4.2, this method supports arbitrary levels
239239
* of meta-annotations.
240240
* @param annotationType the annotation type
241-
* @return <tt>true</tt> if the annotation is present
241+
* @return {@code true} if the annotation is present
242242
*/
243243
public boolean hasAnnotation(Class<? extends Annotation> annotationType) {
244244
if (this.annotatedElement.isEmpty()) {
@@ -273,8 +273,8 @@ public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
273273
* On the other hand, {@code valueOf(Number.class).isAssignableTo(valueOf(Integer.class))}
274274
* returns {@code false} because, while all Integers are Numbers, not all Numbers are Integers.
275275
* <p>For arrays, collections, and maps, element and key/value types are checked if declared.
276-
* For example, a List&lt;String&gt; field value is assignable to a Collection&lt;CharSequence&gt;
277-
* field, but List&lt;Number&gt; is not assignable to List&lt;Integer&gt;.
276+
* For example, a {@code List<String>} field value is assignable to a {@code Collection<CharSequence>}
277+
* field, but {@code List<Number>} is not assignable to {@code List<Integer>}.
278278
* @return {@code true} if this type is assignable to the type represented by the provided
279279
* type descriptor
280280
* @see #getObjectType()
@@ -576,7 +576,7 @@ public static TypeDescriptor collection(Class<?> collectionType, @Nullable TypeD
576576
/**
577577
* Create a new type descriptor from a {@link java.util.Map} type.
578578
* <p>Useful for converting to typed Maps.
579-
* <p>For example, a Map&lt;String, String&gt; could be converted to a Map&lt;Id, EmailAddress&gt;
579+
* <p>For example, a {@code Map<String, String>} could be converted to a {@code Map<Id, EmailAddress>}
580580
* by converting to a targetType built with this method:
581581
* The method call to construct such a TypeDescriptor would look something like:
582582
* <pre class="code">

spring-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static <K, V> ConvertingComparator<Map.Entry<K, V>, V> mapEntryValues(Com
104104

105105

106106
/**
107-
* Adapts a {@link ConversionService} and <tt>targetType</tt> to a {@link Converter}.
107+
* Adapts a {@link ConversionService} and {@code targetType} to a {@link Converter}.
108108
*/
109109
private static class ConversionServiceConverter<S, T> implements Converter<S, T> {
110110

spring-core/src/main/java/org/springframework/core/io/buffer/DataBuffer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
* the following invariant holds for the read and write positions, and the capacity:
3939
*
4040
* <blockquote>
41-
* <tt>0</tt> <tt>&lt;=</tt>
42-
* <i>readPosition</i> <tt>&lt;=</tt>
43-
* <i>writePosition</i> <tt>&lt;=</tt>
41+
* {@code 0} {@code <=}
42+
* <i>readPosition</i> {@code <=}
43+
* <i>writePosition</i> {@code <=}
4444
* <i>capacity</i>
4545
* </blockquote>
4646
*

spring-core/src/main/java/org/springframework/util/AntPathMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ public Comparator<String> getPatternComparator(String path) {
638638
/**
639639
* Tests whether a string matches against a pattern via a {@link Pattern}.
640640
* <p>The pattern may contain special characters: '*' means zero or more characters; '?' means one and
641-
* only one character; '{' and '}' indicate a URI template pattern. For example <tt>/users/{user}</tt>.
641+
* only one character; '{' and '}' indicate a URI template pattern. For example {@code /users/{user}}.
642642
*/
643643
protected static class AntPathStringMatcher {
644644

spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void close() {
150150

151151
/**
152152
* Convert the buffer's contents into a string decoding bytes using the
153-
* platform's default character set. The length of the new <tt>String</tt>
153+
* platform's default character set. The length of the new {@code String}
154154
* is a function of the character set, and hence may not be equal to the
155155
* size of the buffer.
156156
* <p>This method always replaces malformed-input and unmappable-character

spring-web/src/main/java/org/springframework/web/util/WebUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,17 +628,17 @@ public static String findParameterValue(ServletRequest request, String name) {
628628
* following algorithm:
629629
* <ol>
630630
* <li>Try to get the parameter value using just the given <i>logical</i> name.
631-
* This handles parameters of the form <tt>logicalName = value</tt>. For normal
631+
* This handles parameters of the form {@code logicalName = value}. For normal
632632
* parameters, e.g. submitted using a hidden HTML form field, this will return
633633
* the requested value.</li>
634634
* <li>Try to obtain the parameter value from the parameter name, where the
635-
* parameter name in the request is of the form <tt>logicalName_value = xyz</tt>
635+
* parameter name in the request is of the form {@code logicalName_value = xyz}
636636
* with "_" being the configured delimiter. This deals with parameter values
637637
* submitted using an HTML form submit button.</li>
638638
* <li>If the value obtained in the previous step has a ".x" or ".y" suffix,
639639
* remove that. This handles cases where the value was submitted using an
640640
* HTML form image button. In this case the parameter in the request would
641-
* actually be of the form <tt>logicalName_value.x = 123</tt>. </li>
641+
* actually be of the form {@code logicalName_value.x = 123}.</li>
642642
* </ol>
643643
* @param parameters the available parameter map
644644
* @param name the <i>logical</i> name of the request parameter

spring-web/src/main/java/org/springframework/web/util/pattern/InternalPathPatternParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ else if ((this.pos > (this.variableCaptureStart + 1 + (this.isCaptureTheRestVari
192192
* Just hit a ':' and want to jump over the regex specification for this
193193
* variable. pos will be pointing at the ':', we want to skip until the }.
194194
* <p>
195-
* Nested {...} pairs don't have to be escaped: <tt>/abc/{var:x{1,2}}/def</tt>
196-
* <p>An escaped } will not be treated as the end of the regex: <tt>/abc/{var:x\\{y:}/def</tt>
195+
* Nested {...} pairs don't have to be escaped: <code>/abc/{var:x{1,2}}/def</code>
196+
* <p>An escaped } will not be treated as the end of the regex: <code>/abc/{var:x\\{y:}/def</code>
197197
* <p>A separator that should not indicate the end of the regex can be escaped:
198198
*/
199199
private void skipCaptureRegex() {

spring-web/src/main/java/org/springframework/web/util/pattern/RegexPathElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* A regex path element. Used to represent any complicated element of the path.
29-
* For example in '<tt>/foo/&ast;_&ast;/&ast;_{foobar}</tt>' both <tt>*_*</tt> and <tt>*_{foobar}</tt>
29+
* For example in '<code>/foo/&#42;_&#42;/&#42;_{foobar}</code>' both {@code *_*} and {@code *_{foobar}}
3030
* are {@link RegexPathElement} path elements. Derived from the general
3131
* {@link org.springframework.util.AntPathMatcher} approach.
3232
*

spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void setJsonPrefix(String jsonPrefix) {
9797
}
9898

9999
/**
100-
* Indicates whether the JSON output by this view should be prefixed with <tt>")]}', "</tt>.
100+
* Indicates whether the JSON output by this view should be prefixed with <code>")]}', "</code>.
101101
* Default is {@code false}.
102102
* <p>Prefixing the JSON string in this manner is used to help prevent JSON Hijacking.
103103
* The prefix renders the string syntactically invalid as a script so that it cannot be hijacked.

0 commit comments

Comments
 (0)