Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: spring-projects/spring-framework
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3.20.RELEASE
Choose a base ref
...
head repository: spring-projects/spring-framework
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.3.21.RELEASE
Choose a head ref

Commits on Oct 15, 2018

  1. Copy the full SHA
    f7c625c View commit details

Commits on Oct 22, 2018

  1. Restore log level for resolved exceptions

    The fix for SPR-17178 switched from debug to warn level warning for
    all sub-classes of AbstractHandlerExceptionResolver where the request
    concerned the DefaultHandlerExceptionResolver only.
    
    This commit restores the original DEBUG level logging that was in
    AbstractHandlerExceptionResolver from before SPR-17178. In addition
    DefaultHandlerExceptionResolver registers a warnLogCategory by default
    which enables warn logging and hence fulfilling the original goal
    for SPR-17178.
    
    Issue: SPR-17383
    rstoyanchev committed Oct 22, 2018
    Copy the full SHA
    8e980d9 View commit details

Commits on Oct 24, 2018

  1. Fix ResourceUrlEncodingFilter lifecycle

    Prior to this commit, the `ResourceUrlEncodingFilter` would wrap the
    response and keep a reference to the request. When
    `HttpServletResponse.encodeURL` is later called during view rendering,
    the filter looks at the request and extracts context mapping information
    in order to resolve resource paths in views.
    
    This approach is flawed, when the filter is used with JSPs - if the
    request is forwarded to the container by the `InternalResourceView`,
    the request information is overwritten by the container. When the view
    is being rendered, the information available in the request is outdated
    and does not allow to correctly compute that context mapping
    information.
    
    This commit ensures that that information is being extracted from the
    request as soon as the `ResourceUrlProvider` is set as a request
    attribute.
    
    Issue: SPR-17421
    (Cherry-picked from cf25efc)
    bclozel committed Oct 24, 2018
    Copy the full SHA
    9efe37e View commit details
  2. Clarify destruction order effect in @dependsOn annotation javadoc

    Issue: SPR-17384
    
    (cherry picked from commit 00b7782)
    jhoeller committed Oct 24, 2018
    Copy the full SHA
    a3bdeb2 View commit details
  3. Clarify FactoryBean initialization effect in getBeanNamesForAnnotation

    Issue: SPR-17392
    
    (cherry picked from commit da23505)
    jhoeller committed Oct 24, 2018
    Copy the full SHA
    cd66467 View commit details
  4. Avoid stacktrace if root resource is not resolvable in file system

    Issue: SPR-17417
    
    (cherry picked from commit 83a54db)
    jhoeller committed Oct 24, 2018
    Copy the full SHA
    3a4fd2c View commit details
  5. SpringFactoriesLoader tolerates whitespace around class names

    Issue: SPR-17413
    
    (cherry picked from commit dd2ce20)
    jhoeller committed Oct 24, 2018
    Copy the full SHA
    46bc145 View commit details
  6. Copy the full SHA
    448182f View commit details
  7. Polishing

    jhoeller committed Oct 24, 2018
    Copy the full SHA
    47ca7b3 View commit details

Commits on Oct 27, 2018

  1. Exclude FactoryBean implementation methods on CGLIB proxies as well

    Issue: SPR-17374
    
    (cherry picked from commit dc1e3b4)
    jhoeller committed Oct 27, 2018
    Copy the full SHA
    6711515 View commit details
  2. Polishing

    jhoeller committed Oct 27, 2018
    Copy the full SHA
    b43e733 View commit details

Commits on Nov 5, 2018

  1. Explicit notes on class/method-level semantics in class hierarchies

    Issue: SPR-17445
    
    (cherry picked from commit ea3250c)
    jhoeller committed Nov 5, 2018
    Copy the full SHA
    f002ebd View commit details
  2. Polishing

    jhoeller committed Nov 5, 2018
    Copy the full SHA
    79e7ba7 View commit details
  3. Copy the full SHA
    8f1f36d View commit details

Commits on Nov 8, 2018

  1. Consistently return empty array in case of empty batch arguments

    Issue: SPR-17476
    
    (cherry picked from commit 362c59c)
    jhoeller committed Nov 8, 2018
    Copy the full SHA
    4f5ae22 View commit details
  2. Up-to-date version and link in ASM/CGLIB/Objenesis package javadoc

    Issue: SPR-16405
    Issue: SPR-15600
    jhoeller committed Nov 8, 2018
    Copy the full SHA
    8d668ac View commit details

Commits on Nov 21, 2018

  1. BEST_MATCHING_HANDLER_ATTRIBUTE for spring-webmvc

    Issue: SPR-17518
    rstoyanchev committed Nov 21, 2018
    Copy the full SHA
    abacc6d View commit details

Commits on Nov 22, 2018

  1. SerializedBeanFactoryReference falls back to dummy with specific id

    Issue: SPR-17508
    
    (cherry picked from commit f5aeb81)
    jhoeller committed Nov 22, 2018
    Copy the full SHA
    22f4b1c View commit details
  2. FastByteArrayOutputStream.read byte-to-int conversion

    Issue: SPR-17492
    jhoeller committed Nov 22, 2018
    Copy the full SHA
    ed9afa3 View commit details
  3. Polishing

    jhoeller committed Nov 22, 2018
    Copy the full SHA
    85b5c5a View commit details

Commits on Nov 23, 2018

  1. Copy the full SHA
    1c1b942 View commit details

Commits on Nov 24, 2018

  1. Upgrade to Tomcat 8.5.35, Netty 4.1.31, Gson 2.8.5, Jackson 2.8.11.3

    Also includes Apache HttpClient 4.5.6 and HttpAsyncClient 4.1.4.
    jhoeller committed Nov 24, 2018
    Copy the full SHA
    cf8479c View commit details

Commits on Nov 25, 2018

  1. ResolvableType-based matching consistently respects generic factory m…

    …ethod return type (even for pre-initialized raw singleton instance)
    
    Issue: SPR-17524
    
    (cherry picked from commit ebbe14c)
    jhoeller committed Nov 25, 2018
    Copy the full SHA
    e9f7c35 View commit details
  2. Revised alias definition example in reference documentation

    Issue: SPR-17536
    jhoeller committed Nov 25, 2018
    Copy the full SHA
    9600e01 View commit details

Commits on Nov 27, 2018

  1. Copy the full SHA
    ca50a47 View commit details
Showing with 1,054 additions and 717 deletions.
  1. +11 −12 build.gradle
  2. +1 −1 gradle.properties
  3. +5 −1 spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java
  4. +7 −3 spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java
  5. +9 −10 .../src/main/java/org/springframework/beans/factory/annotation/AnnotationBeanWiringInfoResolver.java
  6. +13 −3 spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
  7. +3 −1 spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
  8. +7 −1 spring-context/src/main/java/org/springframework/context/annotation/DependsOn.java
  9. +17 −2 ...text/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java
  10. +167 −3 ...xt/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorTests.java
  11. +3 −2 spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java
  12. +13 −14 spring-context/src/test/java/org/springframework/tests/mock/jndi/ExpectedLookupTemplate.java
  13. +7 −7 spring-context/src/test/java/org/springframework/tests/mock/jndi/SimpleNamingContextBuilder.java
  14. +23 −1 ...ng-context/src/test/java/org/springframework/validation/beanvalidation/MethodValidationTests.java
  15. +2 −2 spring-core/src/main/java/org/springframework/asm/package-info.java
  16. +2 −2 spring-core/src/main/java/org/springframework/cglib/package-info.java
  17. +12 −5 ...g-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
  18. +10 −8 spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java
  19. +2 −2 spring-core/src/main/java/org/springframework/objenesis/package-info.java
  20. +4 −4 spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java
  21. +3 −3 spring-core/src/main/java/org/springframework/util/MultiValueMap.java
  22. +7 −9 spring-core/src/main/java/org/springframework/util/ObjectUtils.java
  23. +15 −14 spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
  24. +5 −6 spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java
  25. +28 −26 spring-core/src/test/java/org/springframework/util/FastByteArrayOutputStreamTests.java
  26. +12 −10 spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java
  27. +2 −2 spring-core/src/test/resources/META-INF/spring.factories
  28. +2 −2 ...pression/src/main/java/org/springframework/expression/spel/support/StandardEvaluationContext.java
  29. +9 −4 spring-jdbc/src/main/java/org/springframework/jdbc/core/BatchUpdateUtils.java
  30. +2 −1 spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java
  31. +2 −6 spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
  32. +6 −5 ...g-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterBatchUpdateUtils.java
  33. +8 −8 spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java
  34. +4 −4 spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java
  35. +15 −16 spring-jdbc/src/main/java/org/springframework/jdbc/object/SqlCall.java
  36. +84 −174 spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java
  37. +92 −114 ...-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java
  38. +17 −17 spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java
  39. +1 −1 ...saging/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java
  40. +2 −2 ...essaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java
  41. +23 −1 ...nate4/src/test/java/org/springframework/validation/hibernatevalidator5/MethodValidationTests.java
  42. +2 −1 spring-test/src/main/java/org/springframework/mock/jndi/ExpectedLookupTemplate.java
  43. +6 −6 spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java
  44. +6 −1 spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java
  45. +38 −22 spring-web/src/main/java/org/springframework/http/HttpStatus.java
  46. +18 −17 spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java
  47. +29 −8 spring-web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java
  48. +2 −2 spring-web/src/main/java/org/springframework/web/client/ResponseErrorHandler.java
  49. +2 −2 spring-web/src/main/java/org/springframework/web/method/annotation/MapMethodProcessor.java
  50. +6 −11 ...rc/main/java/org/springframework/web/method/annotation/RequestParamMapMethodArgumentResolver.java
  51. +8 −10 ...b/src/main/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolver.java
  52. +54 −6 spring-web/src/test/java/org/springframework/web/client/DefaultResponseErrorHandlerTests.java
  53. +4 −5 ...t/java/org/springframework/web/method/annotation/RequestHeaderMapMethodArgumentResolverTests.java
  54. +3 −3 ...test/java/org/springframework/web/method/annotation/RequestHeaderMethodArgumentResolverTests.java
  55. +10 −9 ...st/java/org/springframework/web/method/annotation/RequestParamMapMethodArgumentResolverTests.java
  56. +10 −10 .../test/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverTests.java
  57. +8 −1 spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerMapping.java
  58. +2 −2 ...ebmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java
  59. +1 −0 ...ng-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java
  60. +1 −0 spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractUrlHandlerMapping.java
  61. +1 −2 ...src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java
  62. +6 −4 ...java/org/springframework/web/servlet/mvc/method/annotation/RequestPartMethodArgumentResolver.java
  63. +1 −0 ...vc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java
  64. +10 −7 spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java
  65. +63 −40 spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceUrlEncodingFilter.java
  66. +7 −2 spring-webmvc/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java
  67. +7 −4 ...ng-webmvc/src/test/java/org/springframework/web/servlet/handler/SimpleUrlHandlerMappingTests.java
  68. +25 −9 ...webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlEncodingFilterTests.java
  69. +41 −5 ...vc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlProviderJavaConfigTests.java
  70. +2 −2 spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java
  71. +15 −15 src/asciidoc/core-beans.adoc
  72. +7 −0 src/asciidoc/data-access.adoc
  73. +2 −2 src/asciidoc/web-mvc.adoc
23 changes: 11 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ configure(allprojects) { project ->
ext.fileuploadVersion = "1.3.3"
ext.freemarkerVersion = "2.3.23"
ext.groovyVersion = "2.4.15"
ext.gsonVersion = "2.8.2"
ext.gsonVersion = "2.8.5"
ext.guavaVersion = "20.0"
ext.hamcrestVersion = "1.3"
ext.hibernate3Version = "3.6.10.Final"
@@ -50,9 +50,9 @@ configure(allprojects) { project ->
ext.hibval4Version = "4.3.2.Final"
ext.hibval5Version = "5.2.5.Final"
ext.hsqldbVersion = "2.3.4"
ext.httpasyncVersion = "4.1.3"
ext.httpclientVersion = "4.5.5"
ext.jackson2Version = "2.8.11.2"
ext.httpasyncVersion = "4.1.4"
ext.httpclientVersion = "4.5.6"
ext.jackson2Version = "2.8.11.3"
ext.jasperreportsVersion = "6.2.1" // our tests fail with JR-internal NPEs against 6.2.2 and higher
ext.javamailVersion = "1.5.6"
ext.jettyVersion = "9.3.14.v20161028" // as of 9.3.15, Jetty has hard Servlet 3.1 requirement
@@ -62,7 +62,7 @@ configure(allprojects) { project ->
ext.jtaVersion = "1.2"
ext.junitVersion = "4.12"
ext.log4jVersion = "1.2.17"
ext.nettyVersion = "4.1.29.Final"
ext.nettyVersion = "4.1.31.Final"
ext.okhttpVersion = "2.7.5"
ext.okhttp3Version = "3.8.1"
ext.openjpaVersion = "2.4.2"
@@ -71,11 +71,11 @@ configure(allprojects) { project ->
ext.romeVersion = "1.7.4"
ext.slf4jVersion = "1.7.25"
ext.snakeyamlVersion = "1.17"
ext.snifferVersion = "1.16"
ext.snifferVersion = "1.17"
ext.testngVersion = "6.9.10"
ext.tiles2Version = "2.2.2"
ext.tiles3Version = "3.0.7"
ext.tomcatVersion = "8.5.33"
ext.tiles3Version = "3.0.8"
ext.tomcatVersion = "8.5.35"
ext.tyrusVersion = "1.3.5" // constrained by WebLogic 12.1.3 support
ext.undertowVersion = "1.3.33.Final"
ext.xmlunitVersion = "1.6"
@@ -289,10 +289,9 @@ project("spring-build-src") {
project("spring-core") {
description = "Spring Core"

// As of Spring 4.0.3, spring-core includes asm 5.x and repackages cglib 3.2, inlining
// both into the spring-core jar. cglib 3.2 itself depends on asm 5.x and is therefore
// further transformed by the JarJar task to depend on org.springframework.asm; this
// avoids including two different copies of asm unnecessarily.
// spring-core includes asm and repackages cglib, inlining both into the spring-core jar.
// cglib itself depends on asm and is therefore further transformed by the JarJar task to
// depend on org.springframework.asm; this avoids including two different copies of asm.
def cglibVersion = "3.2.6"
def objenesisVersion = "2.6"

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=4.3.20.BUILD-SNAPSHOT
version=4.3.21.RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,8 +43,10 @@
* Decorator for a standard {@link BeanInfo} object, e.g. as created by
* {@link Introspector#getBeanInfo(Class)}, designed to discover and register static
* and/or non-void returning setter methods. For example:
*
* <pre class="code">
* public class Bean {
*
* private Foo foo;
*
* public Foo getFoo() {
@@ -56,6 +58,7 @@
* return this;
* }
* }</pre>
*
* The standard JavaBeans {@code Introspector} will discover the {@code getFoo} read
* method, but will bypass the {@code #setFoo(Foo)} write method, because its non-void
* returning signature does not comply with the JavaBeans specification.
@@ -68,6 +71,7 @@
* indexed properties</a> are fully supported.
*
* @author Chris Beams
* @author Juergen Hoeller
* @since 3.1
* @see #ExtendedBeanInfo(BeanInfo)
* @see ExtendedBeanInfoFactory
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -243,7 +243,9 @@ <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, b

/**
* Find all names of beans whose {@code Class} has the supplied {@link Annotation}
* type, without creating any bean instances yet.
* type, without creating corresponding bean instances yet.
* <p>Note that this method considers objects created by FactoryBeans, which means
* that FactoryBeans will get initialized in order to determine their object type.
* @param annotationType the type of annotation to look for
* @return the names of all matching beans
* @since 4.0
@@ -253,6 +255,8 @@ <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, b
/**
* Find all beans whose {@code Class} has the supplied {@link Annotation} type,
* returning a Map of bean names with corresponding bean instances.
* <p>Note that this method considers objects created by FactoryBeans, which means
* that FactoryBeans will get initialized in order to determine their object type.
* @param annotationType the type of annotation to look for
* @return a Map with the matching beans, containing the bean names as
* keys and the corresponding bean instances as values
@@ -267,7 +271,7 @@ <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, b
* found on the given class itself.
* @param beanName the name of the bean to look for annotations on
* @param annotationType the annotation class to look for
* @return the annotation of the given type if found, or {@code null}
* @return the annotation of the given type if found, or {@code null} otherwise
* @throws NoSuchBeanDefinitionException if there is no bean with the given name
* @since 3.0
*/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,24 +44,23 @@ public BeanWiringInfo resolveWiringInfo(Object beanInstance) {
}

/**
* Build the BeanWiringInfo for the given Configurable annotation.
* Build the {@link BeanWiringInfo} for the given {@link Configurable} annotation.
* @param beanInstance the bean instance
* @param annotation the Configurable annotation found on the bean class
* @return the resolved BeanWiringInfo
*/
protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) {
if (!Autowire.NO.equals(annotation.autowire())) {
// Autowiring by name or by type
return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck());
}
else if (!"".equals(annotation.value())) {
// Explicitly specified bean name for bean definition to take property values from
return new BeanWiringInfo(annotation.value(), false);
}
else {
if (!"".equals(annotation.value())) {
// explicitly specified bean name
return new BeanWiringInfo(annotation.value(), false);
}
else {
// default bean name
return new BeanWiringInfo(getDefaultBeanName(beanInstance), true);
}
// Default bean name for bean definition to take property values from
return new BeanWiringInfo(getDefaultBeanName(beanInstance), true);
}
}

Original file line number Diff line number Diff line change
@@ -509,12 +509,21 @@ else if (typeToMatch.hasGenerics() && containsBeanDefinition(beanName)) {
// Generics potentially only match on the target class, not on the proxy...
RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName);
Class<?> targetType = mbd.getTargetType();
if (targetType != null && targetType != ClassUtils.getUserClass(beanInstance) &&
typeToMatch.isAssignableFrom(targetType)) {
if (targetType != null && targetType != ClassUtils.getUserClass(beanInstance)) {
// Check raw class match as well, making sure it's exposed on the proxy.
Class<?> classToMatch = typeToMatch.resolve();
return (classToMatch == null || classToMatch.isInstance(beanInstance));
if (classToMatch != null && !classToMatch.isInstance(beanInstance)) {
return false;
}
if (typeToMatch.isAssignableFrom(targetType)) {
return true;
}
}
ResolvableType resolvableType = mbd.targetType;
if (resolvableType == null) {
resolvableType = mbd.factoryMethodReturnType;
}
return (resolvableType != null && typeToMatch.isAssignableFrom(resolvableType));
}
}
return false;
@@ -1363,6 +1372,7 @@ public void clearMetadataCache() {
*/
protected Class<?> resolveBeanClass(final RootBeanDefinition mbd, String beanName, final Class<?>... typesToMatch)
throws CannotLoadBeanClassException {

try {
if (mbd.hasBeanClass()) {
return mbd.getBeanClass();
Original file line number Diff line number Diff line change
@@ -1574,7 +1574,9 @@ private Object readResolve() {
}
}
// Lenient fallback: dummy factory in case of original factory not found...
return new DefaultListableBeanFactory();
DefaultListableBeanFactory dummyFactory = new DefaultListableBeanFactory();
dummyFactory.serializationId = this.id;
return dummyFactory;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,12 @@
* does not explicitly depend on another through properties or constructor arguments,
* but rather depends on the side effects of another bean's initialization.
*
* <p>A depends-on declaration can specify both an initialization-time dependency and,
* in the case of singleton beans only, a corresponding destruction-time dependency.
* Dependent beans that define a depends-on relationship with a given bean are destroyed
* first, prior to the given bean itself being destroyed. Thus, a depends-on declaration
* can also control shutdown order.
*
* <p>May be used on any class directly or indirectly annotated with
* {@link org.springframework.stereotype.Component} or on methods annotated
* with {@link Bean}.
Original file line number Diff line number Diff line change
@@ -171,8 +171,23 @@ public Object invoke(MethodInvocation invocation) throws Throwable {

private boolean isFactoryBeanMetadataMethod(Method method) {
Class<?> clazz = method.getDeclaringClass();
return ((clazz == FactoryBean.class || clazz == SmartFactoryBean.class) &&
!method.getName().equals("getObject"));

// Call from interface-based proxy handle, allowing for an efficient check?
if (clazz.isInterface()) {
return ((clazz == FactoryBean.class || clazz == SmartFactoryBean.class) &&
!method.getName().equals("getObject"));
}

// Call from CGLIB proxy handle, potentially implementing a FactoryBean method?
Class<?> factoryBeanType = null;
if (SmartFactoryBean.class.isAssignableFrom(clazz)) {
factoryBeanType = SmartFactoryBean.class;
}
else if (FactoryBean.class.isAssignableFrom(clazz)) {
factoryBeanType = FactoryBean.class;
}
return (factoryBeanType != null && !method.getName().equals("getObject") &&
ClassUtils.hasMethod(factoryBeanType, method.getName(), method.getParameterTypes()));
}

/**
Loading