mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Fix common typos and grammatical mistakes
Closes gh-36471
This commit is contained in:
@@ -378,7 +378,7 @@ The container also supports creating a bean with {spring-framework-api}++/beans/
|
||||
|
||||
. The custom arguments require dynamic introspection of a matching constructor or factory method.
|
||||
Those arguments cannot be detected by AOT, so the necessary reflection hints will have to be provided manually.
|
||||
. By-passing the instance supplier means that all other optimizations after creation are skipped as well.
|
||||
. Bypassing the instance supplier means that all other optimizations after creation are skipped as well.
|
||||
For instance, autowiring on fields and methods will be skipped as they are handled in the instance supplier.
|
||||
|
||||
Rather than having prototype-scoped beans created with custom arguments, we recommend a manual factory pattern where a bean is responsible for the creation of the instance.
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ Kotlin::
|
||||
Next, you can provide the information for the candidate bean definitions. You can add
|
||||
`<qualifier/>` tags as sub-elements of the `<bean/>` tag and then specify the `type` and
|
||||
`value` to match your custom qualifier annotations. The type is matched against the
|
||||
fully-qualified class name of the annotation. Alternately, as a convenience if no risk of
|
||||
fully-qualified class name of the annotation. Alternatively, as a convenience if no risk of
|
||||
conflicting names exists, you can use the short class name. The following example
|
||||
demonstrates both approaches:
|
||||
|
||||
|
||||
+1
-1
@@ -270,7 +270,7 @@ is applicable for typical implementations of indexed structures.
|
||||
NOTE: `ReflectiveIndexAccessor` also implements `CompilableIndexAccessor` in order to
|
||||
support xref:core/expressions/evaluation.adoc#expressions-spel-compilation[compilation]
|
||||
to bytecode for read access. Note, however, that the configured read-method must be
|
||||
invokable via a `public` class or `public` interface for compilation to succeed.
|
||||
invocable via a `public` class or `public` interface for compilation to succeed.
|
||||
|
||||
The following code listings define a `Color` enum and `FruitMap` type that behaves like a
|
||||
map but does not implement the `java.util.Map` interface. Thus, if you want to index into
|
||||
|
||||
@@ -347,10 +347,10 @@ recognized and used as the `PropertyEditor` for `Something`-typed properties.
|
||||
[literal,subs="verbatim,quotes"]
|
||||
----
|
||||
com
|
||||
chank
|
||||
pop
|
||||
Something
|
||||
SomethingEditor // the PropertyEditor for the Something class
|
||||
└── example
|
||||
└── things
|
||||
├── *Something*
|
||||
└── *SomethingEditor* // the PropertyEditor for the Something class
|
||||
----
|
||||
|
||||
Note that you can also use the standard `BeanInfo` JavaBeans mechanism here as well
|
||||
@@ -362,10 +362,10 @@ following example uses the `BeanInfo` mechanism to explicitly register one or mo
|
||||
[literal,subs="verbatim,quotes"]
|
||||
----
|
||||
com
|
||||
chank
|
||||
pop
|
||||
Something
|
||||
SomethingBeanInfo // the BeanInfo for the Something class
|
||||
└── example
|
||||
└── things
|
||||
├── *Something*
|
||||
└── *SomethingBeanInfo* // the BeanInfo for the Something class
|
||||
----
|
||||
|
||||
The following Java source code for the referenced `SomethingBeanInfo` class
|
||||
|
||||
@@ -19,6 +19,6 @@ meta-annotation. If a bootstrapper is not explicitly configured by using
|
||||
`WebTestContextBootstrapper` is used, depending on the presence of `@WebAppConfiguration`.
|
||||
|
||||
Since the `TestContextBootstrapper` SPI is likely to change in the future (to accommodate
|
||||
new requirements), we strongly encourage implementers not to implement this interface
|
||||
new requirements), we strongly encourage implementors not to implement this interface
|
||||
directly but rather to extend `AbstractTestContextBootstrapper` or one of its concrete
|
||||
subclasses instead.
|
||||
|
||||
@@ -182,7 +182,7 @@ The parameters to any of the above macros have consistent meanings:
|
||||
For strictly sorted maps, you can use a `SortedMap` (such as a `TreeMap`) with a
|
||||
suitable `Comparator` and, for arbitrary Maps that should return values in insertion
|
||||
order, use a `LinkedHashMap` or a `LinkedMap` from `commons-collections`.
|
||||
* `separator`: Where multiple options are available as discreet elements (radio buttons
|
||||
* `separator`: Where multiple options are available as discrete elements (radio buttons
|
||||
or checkboxes), the sequence of characters used to separate each one in the list
|
||||
(such as `<br>`).
|
||||
* `attributes`: An additional string of arbitrary tags or text to be included within
|
||||
|
||||
+1
-1
@@ -188,7 +188,7 @@ the content negotiation during the error handling phase will decide which conten
|
||||
| `View`
|
||||
| A `View` instance to use for rendering together with the implicit model -- determined
|
||||
through command objects and `@ModelAttribute` methods. The handler method may also
|
||||
programmatically enrich the model by declaring a `Model` argument (descried earlier).
|
||||
programmatically enrich the model by declaring a `Model` argument (described earlier).
|
||||
|
||||
| `java.util.Map`, `org.springframework.ui.Model`
|
||||
| Attributes to be added to the implicit model with the view name implicitly determined
|
||||
|
||||
+1
-1
@@ -600,7 +600,7 @@ class ConstructorResolverAotTests {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unnused")
|
||||
@SuppressWarnings("unused")
|
||||
static class ConstructorPrimitiveFallback {
|
||||
|
||||
public ConstructorPrimitiveFallback(boolean useDefaultExecutor) {
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ public class MimeMessageHelper {
|
||||
|
||||
/**
|
||||
* Constant indicating a multipart message with a single root multipart
|
||||
* element of type "mixed". Texts, inline elements and attachements
|
||||
* element of type "mixed". Texts, inline elements and attachments
|
||||
* will all get added to that root element.
|
||||
* <p>This was Spring 1.0's default behavior. It is known to work properly
|
||||
* on Outlook. However, other mail clients tend to misinterpret inline
|
||||
@@ -123,7 +123,7 @@ public class MimeMessageHelper {
|
||||
|
||||
/**
|
||||
* Constant indicating a multipart message with a single root multipart
|
||||
* element of type "related". Texts, inline elements and attachements
|
||||
* element of type "related". Texts, inline elements and attachments
|
||||
* will all get added to that root element.
|
||||
* <p>This was the default behavior from Spring 1.1 up to 1.2 final.
|
||||
* This is the "Microsoft multipart mode", as natively sent by Outlook.
|
||||
|
||||
@@ -206,7 +206,7 @@ import org.springframework.core.annotation.AliasFor;
|
||||
* ({@code BPP}) types. Because {@code BPP} objects must be instantiated early in the container
|
||||
* lifecycle, a non-static {@code @Bean} method that returns a {@code BPP} will cause eager
|
||||
* initialization of its declaring {@code @Configuration} class, which can make other beans in the
|
||||
* {@code @Configuration} class (as well as depencencies of those beans) ineligible for full
|
||||
* {@code @Configuration} class (as well as dependencies of those beans) ineligible for full
|
||||
* post-processing. To avoid these lifecycle issues, mark {@code BPP}-returning {@code @Bean}
|
||||
* methods as {@code static}. For example:
|
||||
*
|
||||
|
||||
+2
-2
@@ -78,7 +78,7 @@ fun beans(init: BeanDefinitionDsl.() -> Unit) = BeanDefinitionDsl(init)
|
||||
* Class implementing functional bean definition Kotlin DSL.
|
||||
*
|
||||
* @constructor Create a new bean definition DSL.
|
||||
* @param condition the predicate to fulfill in order to take in account the inner
|
||||
* @param condition the predicate to fulfill in order to take into account the inner
|
||||
* bean definition block
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
@@ -1200,7 +1200,7 @@ open class BeanDefinitionDsl internal constructor (private val init: BeanDefinit
|
||||
/**
|
||||
* Take in account bean definitions enclosed in the provided lambda only when the
|
||||
* specified environment-based predicate is true.
|
||||
* @param condition the predicate to fulfill in order to take in account the inner
|
||||
* @param condition the predicate to fulfill in order to take into account the inner
|
||||
* bean definition block
|
||||
*/
|
||||
fun environment(condition: ConfigurableEnvironment.() -> Boolean,
|
||||
|
||||
@@ -158,7 +158,7 @@ public final class Property {
|
||||
return StringUtils.uncapitalize(this.writeMethod.getName().substring(index));
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException("Property is neither readable nor writeable");
|
||||
throw new IllegalStateException("Property is neither readable nor writable");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ public final class Property {
|
||||
MethodParameter write = resolveWriteMethodParameter();
|
||||
if (write == null) {
|
||||
if (read == null) {
|
||||
throw new IllegalStateException("Property is neither readable nor writeable");
|
||||
throw new IllegalStateException("Property is neither readable nor writable");
|
||||
}
|
||||
return read;
|
||||
}
|
||||
|
||||
+4
-4
@@ -256,7 +256,7 @@ class GenericConversionServiceTests {
|
||||
void interfaceToString() {
|
||||
conversionService.addConverter(new MyBaseInterfaceToStringConverter());
|
||||
conversionService.addConverter(new ObjectToStringConverter());
|
||||
Object converted = conversionService.convert(new MyInterfaceImplementer(), String.class);
|
||||
Object converted = conversionService.convert(new MyInterfaceImplementor(), String.class);
|
||||
assertThat(converted).isEqualTo("RESULT");
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ class GenericConversionServiceTests {
|
||||
void interfaceArrayToStringArray() {
|
||||
conversionService.addConverter(new MyBaseInterfaceToStringConverter());
|
||||
conversionService.addConverter(new ArrayToArrayConverter(conversionService));
|
||||
String[] converted = conversionService.convert(new MyInterface[] {new MyInterfaceImplementer()}, String[].class);
|
||||
String[] converted = conversionService.convert(new MyInterface[] {new MyInterfaceImplementor()}, String[].class);
|
||||
assertThat(converted[0]).isEqualTo("RESULT");
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ class GenericConversionServiceTests {
|
||||
void objectArrayToStringArray() {
|
||||
conversionService.addConverter(new MyBaseInterfaceToStringConverter());
|
||||
conversionService.addConverter(new ArrayToArrayConverter(conversionService));
|
||||
String[] converted = conversionService.convert(new MyInterfaceImplementer[] {new MyInterfaceImplementer()}, String[].class);
|
||||
String[] converted = conversionService.convert(new MyInterfaceImplementor[] {new MyInterfaceImplementor()}, String[].class);
|
||||
assertThat(converted[0]).isEqualTo("RESULT");
|
||||
}
|
||||
|
||||
@@ -631,7 +631,7 @@ class GenericConversionServiceTests {
|
||||
}
|
||||
|
||||
|
||||
private static class MyInterfaceImplementer implements MyInterface {
|
||||
private static class MyInterfaceImplementor implements MyInterface {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.expression;
|
||||
|
||||
/**
|
||||
* Implementers of this interface are expected to be able to locate types.
|
||||
* Implementors of this interface are expected to be able to locate types.
|
||||
*
|
||||
* <p>They may use a custom {@link ClassLoader} and/or deal with common package
|
||||
* prefixes (for example, {@code java.lang}) however they wish.
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
*
|
||||
* <p>{@code ReflectiveIndexAccessor} also implements {@link CompilableIndexAccessor}
|
||||
* in order to support compilation to bytecode for read access. Note, however,
|
||||
* that the configured read-method must be invokable via a public class or public
|
||||
* that the configured read-method must be invocable via a public class or public
|
||||
* interface for compilation to succeed.
|
||||
*
|
||||
* <h3>Example</h3>
|
||||
|
||||
+2
-2
@@ -310,7 +310,7 @@ class SetValueTests extends AbstractExpressionTests {
|
||||
if (DEBUG) {
|
||||
SpelUtilities.printAbstractSyntaxTree(System.out, e);
|
||||
}
|
||||
assertThat(e.isWritable(context)).as("Expression is not writeable but should be").isTrue();
|
||||
assertThat(e.isWritable(context)).as("Expression is not writable but should be").isTrue();
|
||||
e.setValue(context, value);
|
||||
assertThat(e.getValue(context, expectedType)).as("Retrieved value was not equal to set value").isEqualTo(value);
|
||||
}
|
||||
@@ -330,7 +330,7 @@ class SetValueTests extends AbstractExpressionTests {
|
||||
if (DEBUG) {
|
||||
SpelUtilities.printAbstractSyntaxTree(System.out, e);
|
||||
}
|
||||
assertThat(e.isWritable(context)).as("Expression is not writeable but should be").isTrue();
|
||||
assertThat(e.isWritable(context)).as("Expression is not writable but should be").isTrue();
|
||||
e.setValue(context, value);
|
||||
assertThat(expectedValue).isEqualTo(e.getValue(context));
|
||||
}
|
||||
|
||||
+3
-3
@@ -186,11 +186,11 @@ class ReflectionHelperTests extends AbstractExpressionTests {
|
||||
// Passing (Super) on call to (Sub[]) is not a match
|
||||
checkMatchVarargs(new Class<?>[] {Super.class}, new Class<?>[] {Sub[].class}, tc, null);
|
||||
|
||||
checkMatchVarargs(new Class<?>[] {Unconvertable.class, String.class}, new Class<?>[] {Sub.class, Super[].class}, tc, null);
|
||||
checkMatchVarargs(new Class<?>[] {Unconvertible.class, String.class}, new Class<?>[] {Sub.class, Super[].class}, tc, null);
|
||||
|
||||
checkMatchVarargs(new Class<?>[] {Integer.class, Integer.class, String.class}, new Class<?>[] {String.class, String.class, Super[].class}, tc, null);
|
||||
|
||||
checkMatchVarargs(new Class<?>[] {Unconvertable.class, String.class}, new Class<?>[] {Sub.class, Super[].class}, tc, null);
|
||||
checkMatchVarargs(new Class<?>[] {Unconvertible.class, String.class}, new Class<?>[] {Sub.class, Super[].class}, tc, null);
|
||||
|
||||
checkMatchVarargs(new Class<?>[] {Integer.class, Integer.class, String.class}, new Class<?>[] {String.class, String.class, Super[].class}, tc, null);
|
||||
|
||||
@@ -519,7 +519,7 @@ class ReflectionHelperTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
|
||||
static class Unconvertable {
|
||||
static class Unconvertible {
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ public abstract class AbstractDataFieldMaxValueIncrementer implements DataFieldM
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String incrementerName;
|
||||
|
||||
/** The length to which a string result should be pre-pended with zeroes. */
|
||||
/** The length to which a string result should be prepended with zeroes. */
|
||||
protected int paddingLength = 0;
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public abstract class AbstractDataFieldMaxValueIncrementer implements DataFieldM
|
||||
|
||||
/**
|
||||
* Set the padding length, i.e. the length to which a string result
|
||||
* should be pre-pended with zeroes.
|
||||
* should be prepended with zeroes.
|
||||
*/
|
||||
public void setPaddingLength(int paddingLength) {
|
||||
this.paddingLength = paddingLength;
|
||||
|
||||
@@ -318,7 +318,7 @@ class StoredProcedureTests {
|
||||
List<Object> rs2 = (List<Object>) res.get("#result-set-2");
|
||||
assertThat(rs2).hasSize(1);
|
||||
Object o2 = rs2.get(0);
|
||||
assertThat(o2).as("wron type returned for result set 2").isInstanceOf(Map.class);
|
||||
assertThat(o2).as("wrong type returned for result set 2").isInstanceOf(Map.class);
|
||||
Map<String, String> m2 = (Map<String, String>) o2;
|
||||
assertThat(m2.get("spam")).isEqualTo("Spam");
|
||||
assertThat(m2.get("eggs")).isEqualTo("Eggs");
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ class DestinationPatternsMessageConditionTests {
|
||||
new DestinationPatternsMessageCondition(new String[] {"foo"}, new AntPathMatcher("."));
|
||||
|
||||
assertThat(c.getPatterns())
|
||||
.as("Pre-pending should be disabled when not using '/' as path separator")
|
||||
.as("Prepending should be disabled when not using '/' as path separator")
|
||||
.containsExactly("foo");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import java.util.List;
|
||||
* <p>Concrete implementations must provide a {@code public} no-args constructor.
|
||||
*
|
||||
* <p><strong>WARNING</strong>: this SPI will likely change in the future in
|
||||
* order to accommodate new requirements. Implementers are therefore strongly encouraged
|
||||
* order to accommodate new requirements. Implementors are therefore strongly encouraged
|
||||
* <strong>not</strong> to implement this interface directly but rather to <em>extend</em>
|
||||
* {@link org.springframework.test.context.support.AbstractTestContextBootstrapper
|
||||
* AbstractTestContextBootstrapper} or one of its concrete subclasses instead.
|
||||
|
||||
@@ -76,8 +76,8 @@ class HttpHeadersTests {
|
||||
void writableHttpHeadersUnwrapsMultiple() {
|
||||
HttpHeaders originalExchangeHeaders = HttpHeaders.readOnlyHttpHeaders(new HttpHeaders());
|
||||
HttpHeaders firewallHeaders = new HttpHeaders(originalExchangeHeaders);
|
||||
HttpHeaders writeable = new HttpHeaders(firewallHeaders);
|
||||
writeable.setContentType(MediaType.APPLICATION_JSON);
|
||||
HttpHeaders writable = new HttpHeaders(firewallHeaders);
|
||||
writable.setContentType(MediaType.APPLICATION_JSON);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -843,10 +843,10 @@ class PathPatternTests {
|
||||
parse("/hotels/{hotel}/booking"))).isEqualTo(1);
|
||||
|
||||
assertThat(comparator.compare(
|
||||
parse("/hotels/{hotel}/bookings/{booking}/cutomers/{customer}"),
|
||||
parse("/hotels/{hotel}/bookings/{booking}/customers/{customer}"),
|
||||
parse("/**"))).isEqualTo(-1);
|
||||
assertThat(comparator.compare(parse("/**"),
|
||||
parse("/hotels/{hotel}/bookings/{booking}/cutomers/{customer}"))).isEqualTo(1);
|
||||
parse("/hotels/{hotel}/bookings/{booking}/customers/{customer}"))).isEqualTo(1);
|
||||
assertThat(comparator.compare(parse("/**"), parse("/**"))).isEqualTo(0);
|
||||
|
||||
assertThat(comparator.compare(parse("/hotels/{hotel}"), parse("/hotels/*"))).isEqualTo(-1);
|
||||
@@ -861,10 +861,10 @@ class PathPatternTests {
|
||||
|
||||
// SPR-6741
|
||||
assertThat(comparator.compare(
|
||||
parse("/hotels/{hotel}/bookings/{booking}/cutomers/{customer}"),
|
||||
parse("/hotels/{hotel}/bookings/{booking}/customers/{customer}"),
|
||||
parse("/hotels/**"))).isEqualTo(-1);
|
||||
assertThat(comparator.compare(parse("/hotels/**"),
|
||||
parse("/hotels/{hotel}/bookings/{booking}/cutomers/{customer}"))).isEqualTo(1);
|
||||
parse("/hotels/{hotel}/bookings/{booking}/customers/{customer}"))).isEqualTo(1);
|
||||
assertThat(comparator.compare(parse("/hotels/foo/bar/**"),
|
||||
parse("/hotels/{hotel}"))).isEqualTo(1);
|
||||
assertThat(comparator.compare(parse("/hotels/{hotel}"),
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ public class RedirectView extends AbstractUrlBasedView {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the target URL and, if necessary, pre-pend the contextPath, expand
|
||||
* Create the target URL and, if necessary, prepend the contextPath, expand
|
||||
* URI template variables, append the current request query, and apply the
|
||||
* configured {@link #getRequestDataValueProcessor()
|
||||
* RequestDataValueProcessor}.
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ import org.springframework.web.context.ContextLoader;
|
||||
* <p>Since JSR-356 only allows Encoder/Decoder to be registered by type, instances
|
||||
* of this class are therefore managed by the WebSocket runtime, and do not need to
|
||||
* be registered as Spring Beans. They can, however, by injected with Spring-managed
|
||||
* dependencies via {@link Autowired @Autowire}.
|
||||
* dependencies via {@link Autowired @Autowired}.
|
||||
*
|
||||
* <p>Converters to convert between the {@link #getType() type} and {@code String} or
|
||||
* {@code ByteBuffer} should be registered.
|
||||
|
||||
Reference in New Issue
Block a user