renamed 'isJava6VisibilityBridgeMethodPair' to 'isVisibilityBridgeMethodPair' (SPR-8660)

This commit is contained in:
Juergen Hoeller 2011-12-01 13:14:06 +00:00
parent 2b122816af
commit dc41daa3db
2 changed files with 9 additions and 11 deletions

View File

@ -16,9 +16,6 @@
package org.springframework.beans.factory.annotation; package org.springframework.beans.factory.annotation;
import static org.springframework.core.BridgeMethodResolver.findBridgedMethod;
import static org.springframework.core.BridgeMethodResolver.isJava6VisibilityBridgeMethodPair;
import java.beans.PropertyDescriptor; import java.beans.PropertyDescriptor;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject; import java.lang.reflect.AccessibleObject;
@ -38,6 +35,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyValues; import org.springframework.beans.PropertyValues;
@ -52,6 +50,7 @@ import org.springframework.beans.factory.config.InstantiationAwareBeanPostProces
import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor; import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.BridgeMethodResolver;
import org.springframework.core.GenericTypeResolver; import org.springframework.core.GenericTypeResolver;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
@ -343,10 +342,9 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
} }
} }
for (Method method : targetClass.getDeclaredMethods()) { for (Method method : targetClass.getDeclaredMethods()) {
Method bridgedMethod = findBridgedMethod(method); Method bridgedMethod = BridgeMethodResolver.findBridgedMethod(method);
Annotation annotation = isJava6VisibilityBridgeMethodPair(method, bridgedMethod) ? Annotation annotation = BridgeMethodResolver.isVisibilityBridgeMethodPair(method, bridgedMethod) ?
findAutowiredAnnotation(bridgedMethod) : findAutowiredAnnotation(bridgedMethod) : findAutowiredAnnotation(method);
findAutowiredAnnotation(method);
if (annotation != null && method.equals(ClassUtils.getMostSpecificMethod(method, clazz))) { if (annotation != null && method.equals(ClassUtils.getMostSpecificMethod(method, clazz))) {
if (Modifier.isStatic(method.getModifiers())) { if (Modifier.isStatic(method.getModifiers())) {
if (logger.isWarnEnabled()) { if (logger.isWarnEnabled()) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2009 the original author or authors. * Copyright 2002-2011 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -218,14 +218,14 @@ public abstract class BridgeMethodResolver {
* See also http://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html * See also http://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html
* @return whether signatures match as described * @return whether signatures match as described
*/ */
public static boolean isJava6VisibilityBridgeMethodPair(Method bridgeMethod, Method bridgedMethod) { public static boolean isVisibilityBridgeMethodPair(Method bridgeMethod, Method bridgedMethod) {
Assert.isTrue(bridgeMethod != null); Assert.isTrue(bridgeMethod != null);
Assert.isTrue(bridgedMethod != null); Assert.isTrue(bridgedMethod != null);
if (bridgeMethod == bridgedMethod) { if (bridgeMethod == bridgedMethod) {
return true; return true;
} }
return Arrays.equals(bridgeMethod.getParameterTypes(), bridgedMethod.getParameterTypes()) return Arrays.equals(bridgeMethod.getParameterTypes(), bridgedMethod.getParameterTypes()) &&
&& bridgeMethod.getReturnType().equals(bridgedMethod.getReturnType()); bridgeMethod.getReturnType().equals(bridgedMethod.getReturnType());
} }