Skip to content

Commit ed49ce8

Browse files
committed
Executable instead of Object for constructor or factory method
Issue: SPR-13188
1 parent 4a85309 commit ed49ce8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ public int getAssignabilityWeight(Class<?>[] paramTypes) {
898898
return Integer.MAX_VALUE - 1024;
899899
}
900900

901-
public void storeCache(RootBeanDefinition mbd, Object constructorOrFactoryMethod) {
901+
public void storeCache(RootBeanDefinition mbd, Executable constructorOrFactoryMethod) {
902902
synchronized (mbd.constructorArgumentLock) {
903903
mbd.resolvedConstructorOrFactoryMethod = constructorOrFactoryMethod;
904904
mbd.constructorArgumentsResolved = true;

spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.beans.factory.support;
1818

19+
import java.lang.reflect.Executable;
1920
import java.lang.reflect.Member;
2021
import java.lang.reflect.Method;
2122
import java.util.HashSet;
@@ -59,7 +60,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
5960
final Object constructorArgumentLock = new Object();
6061

6162
/** Package-visible field for caching the resolved constructor or factory method */
62-
Object resolvedConstructorOrFactoryMethod;
63+
Executable resolvedConstructorOrFactoryMethod;
6364

6465
/** Package-visible field for caching the return type of a generically typed factory method */
6566
volatile Class<?> resolvedFactoryMethodReturnType;
@@ -250,7 +251,7 @@ public boolean isFactoryMethod(Method candidate) {
250251
*/
251252
public Method getResolvedFactoryMethod() {
252253
synchronized (this.constructorArgumentLock) {
253-
Object candidate = this.resolvedConstructorOrFactoryMethod;
254+
Executable candidate = this.resolvedConstructorOrFactoryMethod;
254255
return (candidate instanceof Method ? (Method) candidate : null);
255256
}
256257
}

0 commit comments

Comments
 (0)