Consistently use American English spelling

Since the Spring Framework uses American English spelling, this commit
updates Javadoc and the reference manual to ensure consistency in that
regard. However, there are two exceptions to this rule that arise due
to their use within a technical context.

- We use "cancelled/cancelling" instead of "canceled/canceling" in
  numerous places (including error messages).
- We use "implementor" instead of "implementer".

Closes gh-36470

(cherry picked from commit 17699103dc)
This commit is contained in:
Sam Brannen
2026-03-15 17:16:39 +01:00
parent 10faa7fdff
commit 0c4ed55fd2
35 changed files with 115 additions and 135 deletions
@@ -29,7 +29,7 @@ import org.springframework.lang.Nullable;
import org.springframework.util.ClassUtils;
/**
* A {@link BeanPostProcessor} that honours {@link ImportAware} callback using
* A {@link BeanPostProcessor} that honors {@link ImportAware} callback using
* a mapping computed at build time.
*
* @author Stephane Nicoll
@@ -38,7 +38,7 @@ import org.springframework.util.ObjectUtils;
*
* <p>Allows for registration of {@link ScheduledExecutorTask ScheduledExecutorTasks},
* automatically starting the {@link ScheduledExecutorService} on initialization and
* canceling it on destruction of the context. In scenarios that only require static
* cancelling it on destruction of the context. In scenarios that only require static
* registration of tasks at startup, there is no need to access the
* {@link ScheduledExecutorService} instance itself in application code at all;
* {@code ScheduledExecutorFactoryBean} is then just being used for lifecycle integration.
@@ -72,7 +72,7 @@ import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for AspectJ auto-proxying. Includes mixing with Spring AOP Advisors
* to demonstrate that existing autoproxying contract is honoured.
* to demonstrate that existing autoproxying contract is honored.
*
* @author Rod Johnson
* @author Juergen Hoeller
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for AspectJ auto proxying. Includes mixing with Spring AOP
* Advisors to demonstrate that existing autoproxying contract is honoured.
* Advisors to demonstrate that existing autoproxying contract is honored.
*
* @author Rod Johnson
* @author Chris Beams
@@ -1321,7 +1321,7 @@ class XmlBeanFactoryTests {
assertThat(dave2.getName()).isEqualTo("David");
assertThat(dave2).isSameAs(dave1);
// Check unadvised behaviour
// Check unadvised behavior
String str = "woierowijeiowiej";
assertThat(oom.echo(str)).isEqualTo(str);
@@ -47,7 +47,7 @@ import static org.springframework.context.testfixture.cache.CacheTestUtils.asser
import static org.springframework.context.testfixture.cache.CacheTestUtils.assertCacheMiss;
/**
* Provides various {@link CacheResolver} customisations scenario
* Provides various {@link CacheResolver} customizations scenario
*
* @author Stephane Nicoll
* @since 4.1
@@ -36,7 +36,7 @@ import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.beans.testfixture.beans.Colour;
import org.springframework.beans.testfixture.beans.Color;
import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -67,8 +67,8 @@ class AutowiredConfigurationTests {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
AutowiredConfigurationTests.class.getSimpleName() + ".xml", AutowiredConfigurationTests.class);
assertThat(context.getBean("colour", Colour.class)).isEqualTo(Colour.RED);
assertThat(context.getBean("testBean", TestBean.class).getName()).isEqualTo(Colour.RED.toString());
assertThat(context.getBean("color", Color.class)).isEqualTo(Color.RED);
assertThat(context.getBean("testBean", TestBean.class).getName()).isEqualTo(Color.RED.toString());
context.close();
}
@@ -77,7 +77,7 @@ class AutowiredConfigurationTests {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
AutowiredMethodConfig.class, ColorConfig.class);
assertThat(context.getBean(Colour.class)).isEqualTo(Colour.RED);
assertThat(context.getBean(Color.class)).isEqualTo(Color.RED);
assertThat(context.getBean(TestBean.class).getName()).isEqualTo("RED-RED");
context.close();
}
@@ -87,7 +87,7 @@ class AutowiredConfigurationTests {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
OptionalAutowiredMethodConfig.class, ColorConfig.class);
assertThat(context.getBean(Colour.class)).isEqualTo(Colour.RED);
assertThat(context.getBean(Color.class)).isEqualTo(Color.RED);
assertThat(context.getBean(TestBean.class).getName()).isEqualTo("RED-RED");
context.close();
}
@@ -97,7 +97,7 @@ class AutowiredConfigurationTests {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
OptionalAutowiredMethodConfig.class);
assertThat(context.getBeansOfType(Colour.class)).isEmpty();
assertThat(context.getBeansOfType(Color.class)).isEmpty();
assertThat(context.getBean(TestBean.class).getName()).isEmpty();
context.close();
}
@@ -107,7 +107,7 @@ class AutowiredConfigurationTests {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
QualifiedAutowiredMethodConfig.class);
assertThat(context.getBeansOfType(Colour.class)).isEmpty();
assertThat(context.getBeansOfType(Color.class)).isEmpty();
assertThat(context.getBean(TestBean.class).getName()).isEmpty();
context.close();
}
@@ -121,7 +121,7 @@ class AutowiredConfigurationTests {
ctx.registerBeanDefinition("config1", new RootBeanDefinition(AutowiredConstructorConfig.class));
ctx.registerBeanDefinition("config2", new RootBeanDefinition(ColorConfig.class));
ctx.refresh();
assertThat(ctx.getBean(Colour.class)).isSameAs(ctx.getBean(AutowiredConstructorConfig.class).colour);
assertThat(ctx.getBean(Color.class)).isSameAs(ctx.getBean(AutowiredConstructorConfig.class).color);
ctx.close();
}
@@ -134,7 +134,7 @@ class AutowiredConfigurationTests {
ctx.registerBeanDefinition("config1", new RootBeanDefinition(ObjectFactoryConstructorConfig.class));
ctx.registerBeanDefinition("config2", new RootBeanDefinition(ColorConfig.class));
ctx.refresh();
assertThat(ctx.getBean(Colour.class)).isSameAs(ctx.getBean(ObjectFactoryConstructorConfig.class).colour);
assertThat(ctx.getBean(Color.class)).isSameAs(ctx.getBean(ObjectFactoryConstructorConfig.class).color);
ctx.close();
}
@@ -147,7 +147,7 @@ class AutowiredConfigurationTests {
ctx.registerBeanDefinition("config1", new RootBeanDefinition(MultipleConstructorConfig.class));
ctx.registerBeanDefinition("config2", new RootBeanDefinition(ColorConfig.class));
ctx.refresh();
assertThat(ctx.getBean(Colour.class)).isSameAs(ctx.getBean(MultipleConstructorConfig.class).colour);
assertThat(ctx.getBean(Color.class)).isSameAs(ctx.getBean(MultipleConstructorConfig.class).color);
ctx.close();
}
@@ -275,11 +275,11 @@ class AutowiredConfigurationTests {
static class AutowiredConfig {
@Autowired
private Colour colour;
private Color color;
@Bean
public TestBean testBean() {
return new TestBean(colour.toString());
return new TestBean(color.toString());
}
}
@@ -288,8 +288,8 @@ class AutowiredConfigurationTests {
static class AutowiredMethodConfig {
@Bean
public TestBean testBean(Colour colour, List<Colour> colours) {
return new TestBean(colour.toString() + "-" + colours.get(0).toString());
public TestBean testBean(Color color, List<Color> colors) {
return new TestBean(color.toString() + "-" + colors.get(0).toString());
}
}
@@ -298,12 +298,12 @@ class AutowiredConfigurationTests {
static class OptionalAutowiredMethodConfig {
@Bean
public TestBean testBean(Optional<Colour> colour, Optional<List<Colour>> colours) {
if (colour.isEmpty() && colours.isEmpty()) {
public TestBean testBean(Optional<Color> color, Optional<List<Color>> colors) {
if (color.isEmpty() && colors.isEmpty()) {
return new TestBean("");
}
else {
return new TestBean(colour.get() + "-" + colours.get().get(0).toString());
return new TestBean(color.get() + "-" + colors.get().get(0).toString());
}
}
}
@@ -314,9 +314,9 @@ class AutowiredConfigurationTests {
@Bean
@Qualifier("testBean")
public TestBean testBean(Optional<Colour> colour, Optional<List<Colour>> colours) {
if (!colour.isEmpty() || !colours.isEmpty()) {
throw new IllegalStateException("Unexpected match: " + colour + " " + colours);
public TestBean testBean(Optional<Color> color, Optional<List<Color>> colors) {
if (!color.isEmpty() || !colors.isEmpty()) {
throw new IllegalStateException("Unexpected match: " + color + " " + colors);
}
return new TestBean("");
}
@@ -331,11 +331,11 @@ class AutowiredConfigurationTests {
@Configuration
static class AutowiredConstructorConfig {
Colour colour;
Color color;
// @Autowired
AutowiredConstructorConfig(Colour colour) {
this.colour = colour;
AutowiredConstructorConfig(Color color) {
this.color = color;
}
}
@@ -343,11 +343,11 @@ class AutowiredConfigurationTests {
@Configuration
static class ObjectFactoryConstructorConfig {
Colour colour;
Color color;
// @Autowired
ObjectFactoryConstructorConfig(ObjectFactory<Colour> colourFactory) {
this.colour = colourFactory.getObject();
ObjectFactoryConstructorConfig(ObjectFactory<Color> colorFactory) {
this.color = colorFactory.getObject();
}
}
@@ -355,15 +355,15 @@ class AutowiredConfigurationTests {
@Configuration
static class MultipleConstructorConfig {
Colour colour;
Color color;
@Autowired
MultipleConstructorConfig(Colour colour) {
this.colour = colour;
MultipleConstructorConfig(Color color) {
this.color = color;
}
MultipleConstructorConfig(String test) {
this.colour = new Colour(test);
this.color = Color.BLUE;
}
}
@@ -372,8 +372,8 @@ class AutowiredConfigurationTests {
static class ColorConfig {
@Bean
public Colour colour() {
return Colour.RED;
public Color color() {
return Color.RED;
}
}
@@ -102,7 +102,7 @@ class ScriptFactoryPostProcessorTests {
Messenger messenger = (Messenger) ctx.getBean(MESSENGER_BEAN_NAME);
assertThat(messenger.getMessage()).isEqualTo(MESSAGE_TEXT);
// cool; now let's change the script and check the refresh behaviour...
// cool; now let's change the script and check the refresh behavior...
pauseToLetRefreshDelayKickIn(DEFAULT_SECONDS_TO_PAUSE);
StaticScriptSource source = getScriptSource(ctx);
source.setScript(CHANGED_SCRIPT);
@@ -123,7 +123,7 @@ class ScriptFactoryPostProcessorTests {
Messenger messenger = (Messenger) ctx.getBean(MESSENGER_BEAN_NAME);
assertThat(messenger.getMessage()).isEqualTo(MESSAGE_TEXT);
// cool; now let's change the script and check the refresh behaviour...
// cool; now let's change the script and check the refresh behavior...
pauseToLetRefreshDelayKickIn(DEFAULT_SECONDS_TO_PAUSE);
StaticScriptSource source = getScriptSource(ctx);
source.setScript(CHANGED_SCRIPT);
@@ -147,7 +147,7 @@ class ScriptFactoryPostProcessorTests {
Messenger messenger = (Messenger) ctx.getBean(MESSENGER_BEAN_NAME);
assertThat(messenger.getMessage()).isEqualTo(MESSAGE_TEXT);
// cool; now let's change the script and check the refresh behaviour...
// cool; now let's change the script and check the refresh behavior...
pauseToLetRefreshDelayKickIn(DEFAULT_SECONDS_TO_PAUSE);
StaticScriptSource source = getScriptSource(ctx);
source.setScript(CHANGED_SCRIPT);
@@ -199,7 +199,7 @@ class ScriptFactoryPostProcessorTests {
Messenger messenger = (Messenger) ctx.getBean(MESSENGER_BEAN_NAME);
assertThat(messenger.getMessage()).isEqualTo(MESSAGE_TEXT);
// cool; now let's change the script and check the refresh behaviour...
// cool; now let's change the script and check the refresh behavior...
pauseToLetRefreshDelayKickIn(DEFAULT_SECONDS_TO_PAUSE);
StaticScriptSource source = getScriptSource(ctx);
// needs The Sundays compiler; must NOT throw any exception here...
@@ -718,19 +718,19 @@ class DataBinderTests {
void bindingWithDisallowedFields() throws BindException {
TestBean rod = new TestBean();
DataBinder binder = new DataBinder(rod);
binder.setDisallowedFields(" ", "\t", "favouriteColour", null, "age");
binder.setDisallowedFields(" ", "\t", "favoriteColor", null, "age");
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.add("name", "Rod");
pvs.add("age", "32x");
pvs.add("favouriteColour", "BLUE");
pvs.add("favoriteColor", "BLUE");
binder.bind(pvs);
binder.close();
assertThat(rod.getName()).as("changed name correctly").isEqualTo("Rod");
assertThat(rod.getAge()).as("did not change age").isZero();
assertThat(rod.getFavouriteColour()).as("did not change favourite colour").isNull();
assertThat(binder.getBindingResult().getSuppressedFields()).containsExactlyInAnyOrder("age", "favouriteColour");
assertThat(rod.getFavoriteColor()).as("did not change favorite color").isNull();
assertThat(binder.getBindingResult().getSuppressedFields()).containsExactlyInAnyOrder("age", "favoriteColor");
}
@Test
@@ -49,7 +49,7 @@ public class ExpectedLookupTemplate extends JndiTemplate {
/**
* Construct a new JndiTemplate that will always return the given object,
* but honour only requests for the given name.
* but honor only requests for the given name.
* @param name the name the client is expected to look up
* @param object the object that will be returned
*/