mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Consistently use American English spelling
Since the Spring Framework uses American English spelling, this commit
updates Javadoc and the reference manual to ensure consistency in that
regard. However, there are two exceptions to this rule that arise due
to their use within a technical context.
- We use "cancelled/cancelling" instead of "canceled/canceling" in
numerous places (including error messages).
- We use "implementor" instead of "implementer".
Closes gh-36470
(cherry picked from commit 17699103dc)
This commit is contained in:
@@ -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.
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+2
-2
@@ -120,7 +120,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() {
|
||||
@@ -261,7 +261,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.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -98,7 +98,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
|
||||
|
||||
+1
-1
@@ -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
|
||||
*/
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
+1
-1
@@ -213,7 +213,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) {
|
||||
|
||||
+10
-10
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-16
@@ -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
|
||||
|
||||
}
|
||||
+10
-10
@@ -99,11 +99,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;
|
||||
|
||||
@@ -388,12 +388,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() {
|
||||
@@ -413,12 +413,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() {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* A {@link BeanPostProcessor} that honours {@link ImportAware} callback using
|
||||
* A {@link BeanPostProcessor} that honors {@link ImportAware} callback using
|
||||
* a mapping computed at build time.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*
|
||||
* <p>Allows for registration of {@link ScheduledExecutorTask ScheduledExecutorTasks},
|
||||
* automatically starting the {@link ScheduledExecutorService} on initialization and
|
||||
* canceling it on destruction of the context. In scenarios that only require static
|
||||
* cancelling it on destruction of the context. In scenarios that only require static
|
||||
* registration of tasks at startup, there is no need to access the
|
||||
* {@link ScheduledExecutorService} instance itself in application code at all;
|
||||
* {@code ScheduledExecutorFactoryBean} is then just being used for lifecycle integration.
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+32
-32
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -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
|
||||
|
||||
+1
-1
@@ -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.springframework.lang.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}.
|
||||
*
|
||||
|
||||
+2
-2
@@ -220,7 +220,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.
|
||||
@@ -389,7 +389,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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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();
|
||||
})
|
||||
|
||||
+6
-6
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
+1
-1
@@ -135,7 +135,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 {
|
||||
|
||||
+1
-1
@@ -151,7 +151,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) {
|
||||
|
||||
+9
-12
@@ -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;
|
||||
@@ -447,8 +447,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();
|
||||
@@ -464,13 +464,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();
|
||||
@@ -486,7 +486,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();
|
||||
}
|
||||
|
||||
@@ -659,10 +659,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"));
|
||||
@@ -684,7 +681,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);
|
||||
|
||||
+3
-6
@@ -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;
|
||||
@@ -741,10 +741,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"));
|
||||
@@ -763,7 +760,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();
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ import jakarta.servlet.jsp.tagext.Tag;
|
||||
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.lang.Nullable;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -482,7 +482,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"));
|
||||
|
||||
+5
-5
@@ -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;
|
||||
@@ -595,9 +595,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"));
|
||||
@@ -612,7 +612,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");
|
||||
|
||||
Reference in New Issue
Block a user