Skip to content

Commit 45c20e3

Browse files
committed
Merge branch '6.0.x'
# Conflicts: # spring-context/src/test/java/org/springframework/context/annotation/PropertySourceAnnotationTests.java
2 parents 9c74c25 + 2ce75dc commit 45c20e3

File tree

7 files changed

+31
-28
lines changed

7 files changed

+31
-28
lines changed

spring-beans/src/test/resources/org/springframework/beans/factory/FactoryBeanTests-withAutowiring.xml

+14-12
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,27 @@
44
<beans default-lazy-init="true">
55

66
<bean name="beta" class="org.springframework.beans.factory.FactoryBeanTests$Beta" autowire="byType">
7-
<property name="name" value="${myName}"/>
7+
<property name="name" value="${myName}"/>
88
</bean>
99

1010
<bean id="alpha" class="org.springframework.beans.factory.FactoryBeanTests$Alpha" autowire="byType"/>
1111

1212
<bean id="gamma" class="org.springframework.beans.factory.FactoryBeanTests$Gamma"/>
1313

14-
<bean id="betaFactory" class="org.springframework.beans.factory.FactoryBeanTests$BetaFactoryBean" autowire="constructor">
15-
<property name="beta" ref="beta"/>
16-
</bean>
14+
<bean id="betaFactory" class="org.springframework.beans.factory.FactoryBeanTests$BetaFactoryBean" autowire="constructor">
15+
<property name="beta" ref="beta"/>
16+
</bean>
1717

18-
<bean id="gammaFactory" factory-bean="betaFactory" factory-method="getGamma"/>
18+
<bean id="gammaFactory" factory-bean="${gammaFactory}" factory-method="${gamma}"/>
1919

20-
<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
21-
<property name="properties">
22-
<props>
23-
<prop key="myName">yourName</prop>
24-
</props>
25-
</property>
26-
</bean>
20+
<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
21+
<property name="properties">
22+
<props>
23+
<prop key="myName">yourName</prop>
24+
<prop key="gammaFactory">betaFactory</prop>
25+
<prop key="gamma">getGamma</prop>
26+
</props>
27+
</property>
28+
</bean>
2729

2830
</beans>

spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/BeanFactoryJCacheOperationSourceAdvisor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public boolean matches(Method method, Class<?> targetClass) {
8282

8383
@Override
8484
public boolean equals(@Nullable Object other) {
85-
return (this == other || (other instanceof JCacheOperationSourcePointcut otherPc &&
86-
ObjectUtils.nullSafeEquals(this.cacheOperationSource, otherPc.cacheOperationSource)));
85+
return (this == other || (other instanceof JCacheOperationSourcePointcut that &&
86+
ObjectUtils.nullSafeEquals(this.cacheOperationSource, that.cacheOperationSource)));
8787
}
8888

8989
@Override

spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationSourcePointcut.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public boolean matches(Method method, Class<?> targetClass) {
5858

5959
@Override
6060
public boolean equals(@Nullable Object other) {
61-
return (this == other || (other instanceof CacheOperationSourcePointcut otherPc &&
62-
ObjectUtils.nullSafeEquals(this.cacheOperationSource, otherPc.cacheOperationSource)));
61+
return (this == other || (other instanceof CacheOperationSourcePointcut that &&
62+
ObjectUtils.nullSafeEquals(this.cacheOperationSource, that.cacheOperationSource)));
6363
}
6464

6565
@Override

spring-context/src/main/java/org/springframework/context/annotation/PropertySourceRegistry.java

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,14 +42,12 @@ class PropertySourceRegistry {
4242

4343
private final List<PropertySourceDescriptor> descriptors;
4444

45+
4546
public PropertySourceRegistry(PropertySourceProcessor propertySourceProcessor) {
4647
this.propertySourceProcessor = propertySourceProcessor;
4748
this.descriptors = new ArrayList<>();
4849
}
4950

50-
public List<PropertySourceDescriptor> getDescriptors() {
51-
return Collections.unmodifiableList(this.descriptors);
52-
}
5351

5452
/**
5553
* Process the given <code>@PropertySource</code> annotation metadata.
@@ -70,12 +68,16 @@ void processPropertySource(AnnotationAttributes propertySource) throws IOExcepti
7068
boolean ignoreResourceNotFound = propertySource.getBoolean("ignoreResourceNotFound");
7169

7270
Class<? extends PropertySourceFactory> factoryClass = propertySource.getClass("factory");
73-
Class<? extends PropertySourceFactory> factorClassToUse =
71+
Class<? extends PropertySourceFactory> factoryClassToUse =
7472
(factoryClass != PropertySourceFactory.class ? factoryClass : null);
75-
PropertySourceDescriptor descriptor = new PropertySourceDescriptor(Arrays.asList(locations), ignoreResourceNotFound, name,
76-
factorClassToUse, encoding);
73+
PropertySourceDescriptor descriptor = new PropertySourceDescriptor(Arrays.asList(locations),
74+
ignoreResourceNotFound, name, factoryClassToUse, encoding);
7775
this.propertySourceProcessor.processPropertySource(descriptor);
7876
this.descriptors.add(descriptor);
7977
}
8078

79+
public List<PropertySourceDescriptor> getDescriptors() {
80+
return Collections.unmodifiableList(this.descriptors);
81+
}
82+
8183
}

spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public T mapRow(ResultSet rs, int rowNumber) throws SQLException {
343343
bw.setPropertyValue(pd.getName(), value);
344344
}
345345
catch (TypeMismatchException ex) {
346-
if (value == null && this.primitivesDefaultedForNullValue) {
346+
if (value == null && isPrimitivesDefaultedForNullValue()) {
347347
if (logger.isDebugEnabled()) {
348348
String propertyType = ClassUtils.getQualifiedName(pd.getPropertyType());
349349
logger.debug("""

spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/PayloadMethodArgumentResolver.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ protected Class<?> resolveTargetClass(MethodParameter parameter, Message<?> mess
197197
/**
198198
* Validate the payload if applicable.
199199
* <p>The default implementation checks for {@code @jakarta.validation.Valid},
200-
* Spring's {@link Validated},
201-
* and custom annotations whose name starts with "Valid".
200+
* Spring's {@link Validated}, and custom annotations whose name starts with "Valid".
202201
* @param message the currently processed message
203202
* @param parameter the method parameter
204203
* @param target the target payload object

spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public boolean matches(Method method, Class<?> targetClass) {
5757

5858
@Override
5959
public boolean equals(@Nullable Object other) {
60-
return (this == other || (other instanceof TransactionAttributeSourcePointcut otherPc &&
61-
ObjectUtils.nullSafeEquals(this.transactionAttributeSource, otherPc.transactionAttributeSource)));
60+
return (this == other || (other instanceof TransactionAttributeSourcePointcut that &&
61+
ObjectUtils.nullSafeEquals(this.transactionAttributeSource, that.transactionAttributeSource)));
6262
}
6363

6464
@Override

0 commit comments

Comments
 (0)