From 17699103dc776778a527cddbb8f8859bd6cbf418 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Sun, 15 Mar 2026 15:22:21 +0100 Subject: [PATCH] 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 --- .../core/beans/context-introduction.adoc | 2 +- .../annotation/AspectJProxyFactory.java | 2 +- ...ntiationModelAwarePointcutAdvisorImpl.java | 4 +- ...erTargetObjectIntroductionInterceptor.java | 2 +- .../DelegatingIntroductionInterceptor.java | 2 +- .../support/DynamicMethodMatcherPointcut.java | 2 +- .../AbstractAspectJAdvisorFactoryTests.java | 4 +- .../factory/xml/XmlBeanDefinitionReader.java | 2 +- .../annotation/AutowiredKotlinTests.kt | 20 +++--- .../beans/{Colour.java => Color.java} | 18 +----- .../beans/testfixture/beans/TestBean.java | 20 +++--- .../ImportAwareAotBeanPostProcessor.java | 2 +- .../ScheduledExecutorFactoryBean.java | 2 +- .../AspectJAutoProxyCreatorTests.java | 2 +- .../autoproxy/benchmark/BenchmarkTests.java | 2 +- .../factory/xml/XmlBeanFactoryTests.java | 2 +- .../CacheResolverCustomizationTests.java | 2 +- .../AutowiredConfigurationTests.java | 64 +++++++++---------- .../ScriptFactoryPostProcessorTests.java | 8 +-- .../validation/DataBinderTests.java | 8 +-- .../jndi/ExpectedLookupTemplate.java | 2 +- .../aot/hint/AbstractTypeReference.java | 2 +- .../codec/AbstractDecoderTests.java | 4 +- .../codec/AbstractEncoderTests.java | 2 +- .../expression/MethodFilter.java | 2 +- .../spel/ExpressionLanguageScenarioTests.java | 4 +- ...rEntityManagerFactoryIntegrationTests.java | 2 +- .../test/json/JsonContent.java | 4 +- .../RuleBasedTransactionAttributeTests.java | 12 ++-- .../web/util/pattern/PathPatternTests.java | 2 +- .../tags/form/AbstractHtmlElementBodyTag.java | 2 +- .../view/AbstractCachingViewResolver.java | 2 +- .../servlet/tags/form/CheckboxTagTests.java | 21 +++--- .../servlet/tags/form/CheckboxesTagTests.java | 9 +-- .../web/servlet/tags/form/OptionTagTests.java | 4 +- .../tags/form/RadioButtonsTagTests.java | 10 +-- 36 files changed, 117 insertions(+), 137 deletions(-) rename spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/{Colour.java => Color.java} (65%) diff --git a/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc b/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc index 4bafff8d45f..5c9a06d1620 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc @@ -575,7 +575,7 @@ Kotlin:: ---- ====== -NOTE: Do not define such beans to be lazy as the `ApplicationContext` will honour that and will not register the method to listen to events. +NOTE: Do not define such beans to be lazy as the `ApplicationContext` will honor that and will not register the method to listen to events. The method signature once again declares the event type to which it listens, but, this time, with a flexible name and without implementing a specific listener interface. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java index 28cf4cb8620..ffd6d00ad21 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java @@ -83,7 +83,7 @@ public class AspectJProxyFactory extends ProxyCreatorSupport { /** * Add the supplied aspect instance to the chain. The type of the aspect instance - * supplied must be a singleton aspect. True singleton lifecycle is not honoured when + * supplied must be a singleton aspect. True singleton lifecycle is not honored when * using this method - the caller is responsible for managing the lifecycle of any * aspects added in this way. * @param aspectInstance the AspectJ aspect instance diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java index 7e59bfe6256..98ed619760e 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java @@ -119,7 +119,7 @@ final class InstantiationModelAwarePointcutAdvisorImpl /** * The pointcut for Spring AOP to use. - * Actual behaviour of the pointcut will change depending on the state of the advice. + * Actual behavior of the pointcut will change depending on the state of the advice. */ @Override public Pointcut getPointcut() { @@ -258,7 +258,7 @@ final class InstantiationModelAwarePointcutAdvisorImpl /** - * Pointcut implementation that changes its behaviour when the advice is instantiated. + * Pointcut implementation that changes its behavior when the advice is instantiated. * Note that this is a dynamic pointcut; otherwise it might be optimized out * if it does not at first match statically. */ diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java index 6bc92ca9dda..b1fe7913e20 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java @@ -82,7 +82,7 @@ public class DelegatePerTargetObjectIntroductionInterceptor extends Introduction /** * Subclasses may need to override this if they want to perform custom - * behaviour in around advice. However, subclasses should invoke this + * behavior in around advice. However, subclasses should invoke this * method, which handles introduced interfaces and forwarding to the target. */ @Override diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java index cc951638aa4..ffdd4c31630 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java @@ -97,7 +97,7 @@ public class DelegatingIntroductionInterceptor extends IntroductionInfoSupport /** * Subclasses may need to override this if they want to perform custom - * behaviour in around advice. However, subclasses should invoke this + * behavior in around advice. However, subclasses should invoke this * method, which handles introduced interfaces and forwarding to the target. */ @Override diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java index 698c80f1447..5f93bfad3f8 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java @@ -24,7 +24,7 @@ import org.springframework.aop.Pointcut; * Convenient superclass when we want to force subclasses to * implement MethodMatcher interface, but subclasses * will want to be pointcuts. The getClassFilter() method can - * be overridden to customize ClassFilter behaviour as well. + * be overridden to customize ClassFilter behavior as well. * * @author Rod Johnson */ diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java index fdd5006f9a4..c88562fbd53 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java @@ -430,8 +430,8 @@ abstract class AbstractAspectJAdvisorFactoryTests { assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(itb::getAge); } - // TODO document this behaviour. - // Is it different AspectJ behaviour, at least for checked exceptions? + // TODO document this behavior. + // Is it different AspectJ behavior, at least for checked exceptions? @Test void aspectMethodThrowsExceptionIllegalOnSignature() { TestBean target = new TestBean(); diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java index 530e9c241cf..b7b4cf63431 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java @@ -211,7 +211,7 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { /** * Specify which {@link org.springframework.beans.factory.parsing.ProblemReporter} to use. *

The default implementation is {@link org.springframework.beans.factory.parsing.FailFastProblemReporter} - * which exhibits fail fast behaviour. External tools can provide an alternative implementation + * which exhibits fail fast behavior. External tools can provide an alternative implementation * that collates errors and warnings for display in the tool UI. */ public void setProblemReporter(@Nullable ProblemReporter problemReporter) { diff --git a/spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/AutowiredKotlinTests.kt b/spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/AutowiredKotlinTests.kt index 5d8b290176f..916d8edfca5 100644 --- a/spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/AutowiredKotlinTests.kt +++ b/spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/AutowiredKotlinTests.kt @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.BeanCreationException import org.springframework.beans.factory.support.DefaultListableBeanFactory import org.springframework.beans.factory.support.RootBeanDefinition -import org.springframework.beans.testfixture.beans.Colour +import org.springframework.beans.testfixture.beans.Color import org.springframework.beans.testfixture.beans.TestBean /** @@ -129,13 +129,13 @@ class AutowiredKotlinTests { bf.registerBeanDefinition("bean", bd) val tb = TestBean() bf.registerSingleton("testBean", tb) - val colour = Colour.BLUE - bf.registerSingleton("colour", colour) + val color = Color.BLUE + bf.registerSingleton("color", color) val kb = bf.getBean("bean", KotlinBeanWithAutowiredSecondaryConstructor::class.java) assertThat(kb.injectedFromConstructor).isSameAs(tb) assertThat(kb.optional).isEqualTo("bar") - assertThat(kb.injectedFromSecondaryConstructor).isSameAs(colour) + assertThat(kb.injectedFromSecondaryConstructor).isSameAs(color) } @Test // SPR-16012 @@ -193,8 +193,8 @@ class AutowiredKotlinTests { bf.registerBeanDefinition("bean", bd) val tb = TestBean() bf.registerSingleton("testBean", tb) - val colour = Colour.BLUE - bf.registerSingleton("colour", colour) + val color = Color.BLUE + bf.registerSingleton("color", color) assertThatExceptionOfType(BeanCreationException::class.java).isThrownBy { bf.getBean("bean", KotlinBeanWithSecondaryConstructor::class.java) @@ -246,12 +246,12 @@ class AutowiredKotlinTests { val optional: String = "foo", val injectedFromConstructor: TestBean ) { - @Autowired constructor(injectedFromSecondaryConstructor: Colour, injectedFromConstructor: TestBean, + @Autowired constructor(injectedFromSecondaryConstructor: Color, injectedFromConstructor: TestBean, optional: String = "bar") : this(optional, injectedFromConstructor) { this.injectedFromSecondaryConstructor = injectedFromSecondaryConstructor } - var injectedFromSecondaryConstructor: Colour? = null + var injectedFromSecondaryConstructor: Color? = null } @Suppress("unused") @@ -268,12 +268,12 @@ class AutowiredKotlinTests { val optional: String = "foo", val injectedFromConstructor: TestBean ) { - constructor(injectedFromSecondaryConstructor: Colour, injectedFromConstructor: TestBean, + constructor(injectedFromSecondaryConstructor: Color, injectedFromConstructor: TestBean, optional: String = "bar") : this(optional, injectedFromConstructor) { this.injectedFromSecondaryConstructor = injectedFromSecondaryConstructor } - var injectedFromSecondaryConstructor: Colour? = null + var injectedFromSecondaryConstructor: Color? = null } } diff --git a/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/Colour.java b/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/Color.java similarity index 65% rename from spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/Colour.java rename to spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/Color.java index 53f638a8980..1eb38c323b2 100644 --- a/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/Colour.java +++ b/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/Color.java @@ -20,22 +20,8 @@ package org.springframework.beans.testfixture.beans; * @author Rob Harrop * @author Juergen Hoeller */ -public class Colour { +public enum Color { - public static final Colour RED = new Colour("RED"); - public static final Colour BLUE = new Colour("BLUE"); - public static final Colour GREEN = new Colour("GREEN"); - public static final Colour PURPLE = new Colour("PURPLE"); - - private final String name; - - public Colour(String name) { - this.name = name; - } - - @Override - public String toString() { - return this.name; - } + RED, BLUE, GREEN, PURPLE } diff --git a/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/TestBean.java b/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/TestBean.java index 76ea5a53fed..02eab490ea3 100644 --- a/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/TestBean.java +++ b/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/TestBean.java @@ -100,11 +100,11 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt private Number someNumber; - private Colour favouriteColour; + private Color favoriteColor; private Boolean someBoolean; - private List otherColours; + private List otherColors; private List pets; @@ -389,12 +389,12 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt this.someNumber = someNumber; } - public Colour getFavouriteColour() { - return favouriteColour; + public Color getFavoriteColor() { + return favoriteColor; } - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; + public void setFavouriteColor(Color favoriteColor) { + this.favoriteColor = favoriteColor; } public Boolean getSomeBoolean() { @@ -414,12 +414,12 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt this.nestedIndexedBean = nestedIndexedBean; } - public List getOtherColours() { - return otherColours; + public List getOtherColors() { + return otherColors; } - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; + public void setOtherColors(List otherColors) { + this.otherColors = otherColors; } public List getPets() { diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ImportAwareAotBeanPostProcessor.java b/spring-context/src/main/java/org/springframework/context/annotation/ImportAwareAotBeanPostProcessor.java index c0c196aa5b1..2fa7eced761 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ImportAwareAotBeanPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ImportAwareAotBeanPostProcessor.java @@ -30,7 +30,7 @@ import org.springframework.core.type.classreading.MetadataReaderFactory; 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 diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java index c48600f98fe..8099b4d48c2 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java @@ -39,7 +39,7 @@ import org.springframework.util.ObjectUtils; * *

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. diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java index b1399b9e363..16ab1ad88a0 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java @@ -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 diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java index 25d73e2791c..df0268e7570 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java @@ -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 diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java index 20704a2a690..3efb7f590ca 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java @@ -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); diff --git a/spring-context/src/test/java/org/springframework/cache/interceptor/CacheResolverCustomizationTests.java b/spring-context/src/test/java/org/springframework/cache/interceptor/CacheResolverCustomizationTests.java index 97731324ab9..82c2a96e9ba 100644 --- a/spring-context/src/test/java/org/springframework/cache/interceptor/CacheResolverCustomizationTests.java +++ b/spring-context/src/test/java/org/springframework/cache/interceptor/CacheResolverCustomizationTests.java @@ -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 diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java index 4c621ccd63b..8d3e29544b4 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java @@ -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 colours) { - return new TestBean(colour.toString() + "-" + colours.get(0).toString()); + public TestBean testBean(Color color, List 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, Optional> colours) { - if (colour.isEmpty() && colours.isEmpty()) { + public TestBean testBean(Optional color, Optional> 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, Optional> colours) { - if (!colour.isEmpty() || !colours.isEmpty()) { - throw new IllegalStateException("Unexpected match: " + colour + " " + colours); + public TestBean testBean(Optional color, Optional> 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 colourFactory) { - this.colour = colourFactory.getObject(); + ObjectFactoryConstructorConfig(ObjectFactory 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; } } diff --git a/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java b/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java index 28860171eca..35bfcb66705 100644 --- a/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java @@ -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... diff --git a/spring-context/src/test/java/org/springframework/validation/DataBinderTests.java b/spring-context/src/test/java/org/springframework/validation/DataBinderTests.java index e54d2b24f72..afd94228ba7 100644 --- a/spring-context/src/test/java/org/springframework/validation/DataBinderTests.java +++ b/spring-context/src/test/java/org/springframework/validation/DataBinderTests.java @@ -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 diff --git a/spring-context/src/testFixtures/java/org/springframework/context/testfixture/jndi/ExpectedLookupTemplate.java b/spring-context/src/testFixtures/java/org/springframework/context/testfixture/jndi/ExpectedLookupTemplate.java index 1be8176797c..d87fea48e47 100644 --- a/spring-context/src/testFixtures/java/org/springframework/context/testfixture/jndi/ExpectedLookupTemplate.java +++ b/spring-context/src/testFixtures/java/org/springframework/context/testfixture/jndi/ExpectedLookupTemplate.java @@ -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 */ diff --git a/spring-core/src/main/java/org/springframework/aot/hint/AbstractTypeReference.java b/spring-core/src/main/java/org/springframework/aot/hint/AbstractTypeReference.java index 5f03ea04567..966d88fcb36 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/AbstractTypeReference.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/AbstractTypeReference.java @@ -21,7 +21,7 @@ import java.util.Objects; import org.jspecify.annotations.Nullable; /** - * Base {@link TypeReference} implementation that ensures consistent behaviour + * Base {@link TypeReference} implementation that ensures consistent behavior * for {@code equals()}, {@code hashCode()}, and {@code toString()} based on * the {@linkplain #getCanonicalName() canonical name}. * diff --git a/spring-core/src/testFixtures/java/org/springframework/core/testfixture/codec/AbstractDecoderTests.java b/spring-core/src/testFixtures/java/org/springframework/core/testfixture/codec/AbstractDecoderTests.java index ff2abe363b8..1043fa31577 100644 --- a/spring-core/src/testFixtures/java/org/springframework/core/testfixture/codec/AbstractDecoderTests.java +++ b/spring-core/src/testFixtures/java/org/springframework/core/testfixture/codec/AbstractDecoderTests.java @@ -213,7 +213,7 @@ public abstract class AbstractDecoderTests> extends Abstrac } /** - * Test a {@link Decoder#decode decode} scenario where the input stream is canceled. + * Test a {@link Decoder#decode decode} scenario where the input stream is cancelled. * This test method will feed the first element of the {@code input} stream to the decoder, * followed by a cancel signal. * The result is expected to contain one "normal" element. @@ -377,7 +377,7 @@ public abstract class AbstractDecoderTests> extends Abstrac } /** - * Test a {@link Decoder#decodeToMono decode} scenario where the input stream is canceled. + * Test a {@link Decoder#decodeToMono decode} scenario where the input stream is cancelled. * This test method will immediately cancel the output stream. * * @param input the input to be provided to the decoder diff --git a/spring-core/src/testFixtures/java/org/springframework/core/testfixture/codec/AbstractEncoderTests.java b/spring-core/src/testFixtures/java/org/springframework/core/testfixture/codec/AbstractEncoderTests.java index 207dd206583..b18f0cbd209 100644 --- a/spring-core/src/testFixtures/java/org/springframework/core/testfixture/codec/AbstractEncoderTests.java +++ b/spring-core/src/testFixtures/java/org/springframework/core/testfixture/codec/AbstractEncoderTests.java @@ -187,7 +187,7 @@ public abstract class AbstractEncoderTests> extends Abstrac } /** - * Test a {@link Encoder#encode encode} scenario where the input stream is canceled. + * Test a {@link Encoder#encode encode} scenario where the input stream is cancelled. * This test method will feed the first element of the {@code input} stream to the decoder, * followed by a cancel signal. * The result is expected to contain one "normal" element. diff --git a/spring-expression/src/main/java/org/springframework/expression/MethodFilter.java b/spring-expression/src/main/java/org/springframework/expression/MethodFilter.java index a88d5bdda88..f555bf40b7f 100644 --- a/spring-expression/src/main/java/org/springframework/expression/MethodFilter.java +++ b/spring-expression/src/main/java/org/springframework/expression/MethodFilter.java @@ -20,7 +20,7 @@ import java.lang.reflect.Method; import java.util.List; /** - * MethodFilter instances allow SpEL users to fine tune the behaviour of the method + * MethodFilter instances allow SpEL users to fine tune the behavior of the method * resolution process. Method resolution (which translates from a method name in an * expression to a real method to invoke) will normally retrieve candidate methods for * invocation via a simple call to 'Class.getMethods()' and will choose the first one that diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/ExpressionLanguageScenarioTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/ExpressionLanguageScenarioTests.java index 245d7ba2b17..1aa82d54830 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/ExpressionLanguageScenarioTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/ExpressionLanguageScenarioTests.java @@ -243,7 +243,7 @@ class ExpressionLanguageScenarioTests extends AbstractExpressionTests { /** - * Regardless of the current context object, or root context object, this resolver can tell you what colour a fruit is ! + * Regardless of the current context object, or root context object, this resolver can tell you what color a fruit is ! * It only supports property reading, not writing. To support writing it would need to override canWrite() and write() */ private static class FruitColourAccessor implements PropertyAccessor { @@ -284,7 +284,7 @@ class ExpressionLanguageScenarioTests extends AbstractExpressionTests { /** - * Regardless of the current context object, or root context object, this resolver can tell you what colour a vegetable is ! + * Regardless of the current context object, or root context object, this resolver can tell you what color a vegetable is ! * It only supports property reading, not writing. */ private static class VegetableColourAccessor implements PropertyAccessor { diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/AbstractContainerEntityManagerFactoryIntegrationTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/AbstractContainerEntityManagerFactoryIntegrationTests.java index 5ddd424e1bd..0e87ef93b6c 100644 --- a/spring-orm/src/test/java/org/springframework/orm/jpa/AbstractContainerEntityManagerFactoryIntegrationTests.java +++ b/spring-orm/src/test/java/org/springframework/orm/jpa/AbstractContainerEntityManagerFactoryIntegrationTests.java @@ -106,7 +106,7 @@ public abstract class AbstractContainerEntityManagerFactoryIntegrationTests void testGetReferenceWhenNoRow() { assertThatException().isThrownBy(() -> { Person notThere = sharedEntityManager.getReference(Person.class, 666); - // We may get here (as with Hibernate). Either behaviour is valid: + // We may get here (as with Hibernate). Either behavior is valid: // throw exception on first access or on getReference itself. notThere.getFirstName(); }) diff --git a/spring-test/src/main/java/org/springframework/test/json/JsonContent.java b/spring-test/src/main/java/org/springframework/test/json/JsonContent.java index a18ec6a4f15..7d149349ffc 100644 --- a/spring-test/src/main/java/org/springframework/test/json/JsonContent.java +++ b/spring-test/src/main/java/org/springframework/test/json/JsonContent.java @@ -54,7 +54,7 @@ public final class JsonContent implements AssertProvider { * use to deserialize content. * @param json the actual JSON content * @param converter the content converter to use - * @deprecated in favour of {@link #JsonContent(String, JsonConverterDelegate)} + * @deprecated in favor of {@link #JsonContent(String, JsonConverterDelegate)} */ @SuppressWarnings("removal") @Deprecated(since = "7.0", forRemoval = true) @@ -97,7 +97,7 @@ public final class JsonContent implements AssertProvider { /** * Return the {@link HttpMessageContentConverter} to use to deserialize content. - * @deprecated in favour of {@link #getJsonConverterDelegate()} + * @deprecated in favor of {@link #getJsonConverterDelegate()} */ @SuppressWarnings("removal") @Deprecated(since = "7.0", forRemoval = true) diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttributeTests.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttributeTests.java index 62216d0e825..a7022c9f5f4 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttributeTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttributeTests.java @@ -58,7 +58,7 @@ class RuleBasedTransactionAttributeTests { assertThat(rta.rollbackOn(new RuntimeException())).isTrue(); assertThat(rta.rollbackOn(new MyRuntimeException())).isTrue(); assertThat(rta.rollbackOn(new Exception())).isFalse(); - // Check that default behaviour is overridden + // Check that default behavior is overridden assertThat(rta.rollbackOn(new IOException())).isTrue(); } @@ -70,10 +70,10 @@ class RuleBasedTransactionAttributeTests { RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list); assertThat(rta.rollbackOn(new RuntimeException())).isTrue(); - // Check default behaviour is overridden + // Check default behavior is overridden assertThat(rta.rollbackOn(new MyRuntimeException())).isFalse(); assertThat(rta.rollbackOn(new Exception())).isFalse(); - // Check that default behaviour is overridden + // Check that default behavior is overridden assertThat(rta.rollbackOn(new IOException())).isTrue(); } @@ -94,9 +94,9 @@ class RuleBasedTransactionAttributeTests { private void doTestRuleForSelectiveRollbackOnChecked(RuleBasedTransactionAttribute rta) { assertThat(rta.rollbackOn(new RuntimeException())).isTrue(); - // Check default behaviour is overridden + // Check default behavior is overridden assertThat(rta.rollbackOn(new Exception())).isFalse(); - // Check that default behaviour is overridden + // Check that default behavior is overridden assertThat(rta.rollbackOn(new RemoteException())).isTrue(); } @@ -115,7 +115,7 @@ class RuleBasedTransactionAttributeTests { assertThat(rta.rollbackOn(new RuntimeException())).isTrue(); assertThat(rta.rollbackOn(new Exception())).isTrue(); - // Check that default behaviour is overridden + // Check that default behavior is overridden assertThat(rta.rollbackOn(new IOException())).isFalse(); } diff --git a/spring-web/src/test/java/org/springframework/web/util/pattern/PathPatternTests.java b/spring-web/src/test/java/org/springframework/web/util/pattern/PathPatternTests.java index 34728d77703..77940a32f5b 100644 --- a/spring-web/src/test/java/org/springframework/web/util/pattern/PathPatternTests.java +++ b/spring-web/src/test/java/org/springframework/web/util/pattern/PathPatternTests.java @@ -655,7 +655,7 @@ class PathPatternTests { assertMatches(pp,"/"); assertMatches(pp,"//"); - // Confirming AntPathMatcher behaviour: + // Confirming AntPathMatcher behavior: assertThat(new AntPathMatcher().match("/{foo}", "/")).isFalse(); assertThat(new AntPathMatcher().match("/{foo}", "/a")).isTrue(); assertThat(new AntPathMatcher().match("/{foo}{bar}", "/a")).isTrue(); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementBodyTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementBodyTag.java index f2fe00ffee3..d8aa000431e 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementBodyTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementBodyTag.java @@ -133,7 +133,7 @@ public abstract class AbstractHtmlElementBodyTag extends AbstractHtmlElementTag } /** - * The user customised the output of the error messages - flush the + * The user customized the output of the error messages - flush the * buffered content into the main {@link jakarta.servlet.jsp.JspWriter}. */ protected void flushBufferedBodyContent(BodyContent bodyContent) throws JspException { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractCachingViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractCachingViewResolver.java index c8b52f495b7..a420803dc5e 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractCachingViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractCachingViewResolver.java @@ -150,7 +150,7 @@ public abstract class AbstractCachingViewResolver extends WebApplicationObjectSu /** * Set the filter that determines if view should be cached. - *

Default behaviour is to cache all views. + *

Default behavior is to cache all views. * @since 5.2 */ public void setCacheFilter(CacheFilter cacheFilter) { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxTagTests.java index 25ea888b007..9565da38083 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxTagTests.java @@ -32,7 +32,7 @@ import org.dom4j.io.SAXReader; import org.junit.jupiter.api.Test; import org.springframework.beans.propertyeditors.StringTrimmerEditor; -import org.springframework.beans.testfixture.beans.Colour; +import org.springframework.beans.testfixture.beans.Color; import org.springframework.beans.testfixture.beans.Pet; import org.springframework.beans.testfixture.beans.TestBean; import org.springframework.validation.BeanPropertyBindingResult; @@ -448,8 +448,8 @@ class CheckboxTagTests extends AbstractFormTagTests { } @Test - void collectionOfColoursSelected() throws Exception { - this.tag.setPath("otherColours"); + void collectionOfColorsSelected() throws Exception { + this.tag.setPath("otherColors"); this.tag.setValue("RED"); int result = this.tag.doStartTag(); @@ -465,13 +465,13 @@ class CheckboxTagTests extends AbstractFormTagTests { Element checkboxElement = document.getRootElement().elements().get(0); assertThat(checkboxElement.getName()).isEqualTo("input"); assertThat(checkboxElement.attribute("type").getValue()).isEqualTo("checkbox"); - assertThat(checkboxElement.attribute("name").getValue()).isEqualTo("otherColours"); + assertThat(checkboxElement.attribute("name").getValue()).isEqualTo("otherColors"); assertThat(checkboxElement.attribute("checked").getValue()).isEqualTo("checked"); } @Test - void collectionOfColoursNotSelected() throws Exception { - this.tag.setPath("otherColours"); + void collectionOfColorsNotSelected() throws Exception { + this.tag.setPath("otherColors"); this.tag.setValue("PURPLE"); int result = this.tag.doStartTag(); @@ -487,7 +487,7 @@ class CheckboxTagTests extends AbstractFormTagTests { Element checkboxElement = document.getRootElement().elements().get(0); assertThat(checkboxElement.getName()).isEqualTo("input"); assertThat(checkboxElement.attribute("type").getValue()).isEqualTo("checkbox"); - assertThat(checkboxElement.attribute("name").getValue()).isEqualTo("otherColours"); + assertThat(checkboxElement.attribute("name").getValue()).isEqualTo("otherColors"); assertThat(checkboxElement.attribute("checked")).isNull(); } @@ -660,10 +660,7 @@ class CheckboxTagTests extends AbstractFormTagTests { @Override protected TestBean createTestBean() { - List colours = new ArrayList(); - colours.add(Colour.BLUE); - colours.add(Colour.RED); - colours.add(Colour.GREEN); + List colors = List.of(Color.BLUE, Color.RED, Color.GREEN); List pets = new ArrayList(); pets.add(new Pet("Rudiger")); @@ -685,7 +682,7 @@ class CheckboxTagTests extends AbstractFormTagTests { this.bean.setSomeBoolean(Boolean.TRUE); this.bean.setStringArray(new String[] {"bar", "foo"}); this.bean.setSomeIntegerArray(new Integer[] {2, 1}); - this.bean.setOtherColours(colours); + this.bean.setOtherColors(colors); this.bean.setPets(pets); this.bean.setSomeList(someList); this.bean.setSomeMap(someMap); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java index f183fe57097..4472e740e01 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java @@ -35,7 +35,7 @@ import org.dom4j.io.SAXReader; import org.junit.jupiter.api.Test; import org.springframework.beans.propertyeditors.StringTrimmerEditor; -import org.springframework.beans.testfixture.beans.Colour; +import org.springframework.beans.testfixture.beans.Color; import org.springframework.beans.testfixture.beans.Pet; import org.springframework.beans.testfixture.beans.TestBean; import org.springframework.format.Formatter; @@ -742,10 +742,7 @@ public class CheckboxesTagTests extends AbstractFormTagTests { @Override protected TestBean createTestBean() { - List colours = new ArrayList(); - colours.add(Colour.BLUE); - colours.add(Colour.RED); - colours.add(Colour.GREEN); + List colors = List.of(Color.BLUE, Color.RED, Color.GREEN); List pets = new ArrayList(); pets.add(new Pet("Rudiger")); @@ -764,7 +761,7 @@ public class CheckboxesTagTests extends AbstractFormTagTests { this.bean.setSomeBoolean(Boolean.TRUE); this.bean.setStringArray(new String[] {"bar", "foo"}); this.bean.setSomeIntegerArray(new Integer[] {2, 1}); - this.bean.setOtherColours(colours); + this.bean.setOtherColors(colors); this.bean.setPets(pets); this.bean.setSomeSet(someObjects); List list = new ArrayList(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionTagTests.java index 279393f19b7..d2732a42ee6 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionTagTests.java @@ -28,7 +28,7 @@ import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; -import org.springframework.beans.testfixture.beans.Colour; +import org.springframework.beans.testfixture.beans.Color; import org.springframework.beans.testfixture.beans.TestBean; import org.springframework.util.StringUtils; import org.springframework.validation.BeanPropertyBindingResult; @@ -483,7 +483,7 @@ class OptionTagTests extends AbstractHtmlElementTagTests { protected void extendRequest(MockHttpServletRequest request) { TestBean bean = new TestBean(); bean.setName("foo"); - bean.setFavouriteColour(Colour.GREEN); + bean.setFavouriteColor(Color.GREEN); bean.setStringArray(ARRAY); bean.setSpouse(new TestBean("Sally")); bean.setSomeNumber(Float.valueOf("12.34")); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java index cd0764f656c..5b1e5b09167 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java @@ -35,7 +35,7 @@ import org.dom4j.io.SAXReader; import org.junit.jupiter.api.Test; import org.springframework.beans.propertyeditors.StringTrimmerEditor; -import org.springframework.beans.testfixture.beans.Colour; +import org.springframework.beans.testfixture.beans.Color; import org.springframework.beans.testfixture.beans.Pet; import org.springframework.beans.testfixture.beans.TestBean; import org.springframework.validation.BeanPropertyBindingResult; @@ -596,9 +596,9 @@ public class RadioButtonsTagTests extends AbstractFormTagTests { @Override protected TestBean createTestBean() { List colours = new ArrayList(); - colours.add(Colour.BLUE); - colours.add(Colour.RED); - colours.add(Colour.GREEN); + colours.add(Color.BLUE); + colours.add(Color.RED); + colours.add(Color.GREEN); List pets = new ArrayList(); pets.add(new Pet("Rudiger")); @@ -613,7 +613,7 @@ public class RadioButtonsTagTests extends AbstractFormTagTests { this.bean.setSomeBoolean(Boolean.TRUE); this.bean.setStringArray(new String[] {"bar", "foo"}); this.bean.setSomeIntegerArray(new Integer[] {2, 1}); - this.bean.setOtherColours(colours); + this.bean.setOtherColors(colours); this.bean.setPets(pets); List list = new ArrayList(); list.add("foo");