Polishing
This commit is contained in:
parent
a6b0261000
commit
4cb453bbdc
|
|
@ -21,7 +21,6 @@ import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.lang.reflect.TypeVariable;
|
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import java.security.PrivilegedActionException;
|
import java.security.PrivilegedActionException;
|
||||||
|
|
@ -666,9 +665,8 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||||
if (Modifier.isStatic(factoryMethod.getModifiers()) == isStatic &&
|
if (Modifier.isStatic(factoryMethod.getModifiers()) == isStatic &&
|
||||||
factoryMethod.getName().equals(mbd.getFactoryMethodName()) &&
|
factoryMethod.getName().equals(mbd.getFactoryMethodName()) &&
|
||||||
factoryMethod.getParameterTypes().length >= minNrOfArgs) {
|
factoryMethod.getParameterTypes().length >= minNrOfArgs) {
|
||||||
TypeVariable<Method>[] declaredTypeVariables = factoryMethod.getTypeParameters();
|
|
||||||
// No declared type variables to inspect, so just process the standard return type.
|
// No declared type variables to inspect, so just process the standard return type.
|
||||||
if (declaredTypeVariables.length > 0) {
|
if (factoryMethod.getTypeParameters().length > 0) {
|
||||||
// Fully resolve parameter names and argument values.
|
// Fully resolve parameter names and argument values.
|
||||||
Class<?>[] paramTypes = factoryMethod.getParameterTypes();
|
Class<?>[] paramTypes = factoryMethod.getParameterTypes();
|
||||||
String[] paramNames = null;
|
String[] paramNames = null;
|
||||||
|
|
|
||||||
|
|
@ -654,17 +654,12 @@ public class BeanFactoryGenericsTests {
|
||||||
/**
|
/**
|
||||||
* Tests support for parameterized static {@code factory-method} declarations such as
|
* Tests support for parameterized static {@code factory-method} declarations such as
|
||||||
* Mockito's {@code mock()} method which has the following signature.
|
* Mockito's {@code mock()} method which has the following signature.
|
||||||
*
|
|
||||||
* <pre>
|
* <pre>
|
||||||
* {@code
|
* {@code
|
||||||
* public static <T> T mock(Class<T> classToMock)
|
* public static <T> T mock(Class<T> classToMock)
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
* <p>See SPR-9493
|
||||||
* <p>
|
|
||||||
* See SPR-9493
|
|
||||||
*
|
|
||||||
* @since 3.2
|
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void parameterizedStaticFactoryMethod() {
|
public void parameterizedStaticFactoryMethod() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue