Merge branch '7.0.x'

This commit is contained in:
Sam Brannen
2026-03-15 17:06:18 +01:00
60 changed files with 163 additions and 183 deletions
@@ -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.
@@ -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:
@@ -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.
@@ -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
@@ -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
@@ -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
@@ -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 <i>dynamic</i> pointcut; otherwise it might be optimized out
* if it does not at first match statically.
*/
@@ -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
@@ -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
@@ -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
*/
@@ -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();
@@ -211,7 +211,7 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader {
/**
* Specify which {@link org.springframework.beans.factory.parsing.ProblemReporter} to use.
* <p>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) {
@@ -600,7 +600,7 @@ class ConstructorResolverAotTests {
}
}
@SuppressWarnings("unnused")
@SuppressWarnings("unused")
static class ConstructorPrimitiveFallback {
public ConstructorPrimitiveFallback(boolean useDefaultExecutor) {
@@ -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
}
}
@@ -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
}
@@ -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() {
@@ -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:
*
@@ -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
@@ -39,7 +39,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.
@@ -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,
@@ -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
*/
@@ -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}.
*
@@ -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;
}
@@ -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 {
}
@@ -213,7 +213,7 @@ public abstract class AbstractDecoderTests<D extends Decoder<?>> 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<D extends Decoder<?>> 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
@@ -187,7 +187,7 @@ public abstract class AbstractEncoderTests<E extends Encoder<?>> 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.
@@ -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
@@ -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.
@@ -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>
@@ -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 {
@@ -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));
}
@@ -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 {
}
@@ -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");
@@ -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");
}
@@ -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();
})
@@ -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.
@@ -54,7 +54,7 @@ public final class JsonContent implements AssertProvider<JsonContentAssert> {
* 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<JsonContentAssert> {
/**
* 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)
@@ -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();
}
@@ -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
@@ -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();
@@ -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}"),
@@ -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}.
@@ -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 {
@@ -150,7 +150,7 @@ public abstract class AbstractCachingViewResolver extends WebApplicationObjectSu
/**
* Set the filter that determines if view should be cached.
* <p>Default behaviour is to cache all views.
* <p>Default behavior is to cache all views.
* @since 5.2
*/
public void setCacheFilter(CacheFilter cacheFilter) {
@@ -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);
@@ -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();
@@ -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"));
@@ -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");
@@ -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.