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: v5.2.15.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: v5.2.16.RELEASE
Choose a head ref

Commits on May 12, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7c74459 View commit details
  2. Ignore delimiter enclosed in double quotes in ScriptUtils

    Prior to this commit, the containsSqlScriptDelimiters() method in
    ScriptUtils ignored delimiters enclosed in single quotes but not those
    enclosed within double quotes, which contradicts the algorithm in
    splitSqlScript() and therefore constitutes a bug.
    
    This commit fixes this bug in the ScriptUtils implementation in
    spring-jdbc.
    
    Closes gh-26935
    sbrannen committed May 12, 2021
    Copy the full SHA
    2225696 View commit details

Commits on May 14, 2021

  1. Ignore comments when searching for statement delimiter in ScriptUtils

    Prior to this commit, the implementation of
    ScriptUtils.containsSqlScriptDelimiters() did not ignore comments when
    searching for the statement delimiter within an SQL script. This
    resulted in subtle bugs if a comment contained a single single-quote or
    single double-quote, since the absence of the closing single-quote or
    double-quote led the algorithm to believe that it was still "within a
    text literal". Similar issues could arise if a comment contained the
    sought statement delimiter but the rest of the script did not contain
    the sought statement delimiter. In such cases, the algorithms in
    ScriptUtils could erroneously choose an incorrect statement delimiter
    -- for example, using the fallback statement delimiter instead of the
    delimiter specified by the user.
    
    This commit avoids such bugs by ignoring single-line comments and block
    comments when searching for the statement delimiter within an SQL
    script.
    
    Closes gh-26911
    sbrannen committed May 14, 2021
    Copy the full SHA
    e4d843e View commit details
  2. Copy the full SHA
    9ae6268 View commit details

Commits on May 18, 2021

  1. Copy the full SHA
    b5ce514 View commit details
  2. Deprecate internal APIs in ScriptUtils

    Many of the utility methods in ScriptUtils are public only because they
    were once invoked from JdbdTestUtils in spring-test, which is no longer
    the case. Consequently, there should no longer be a need for any
    external clients to invoke such methods.
    
    To address, this commit formally deprecates the following methods in
    ScriptUtils in spring-jdbc.
    
    - readScript(...)
    - containsSqlScriptDelimiters(...)
    - splitSqlScript(...)
    
    Closes gh-26947
    sbrannen committed May 18, 2021
    Copy the full SHA
    9018356 View commit details

Commits on May 26, 2021

  1. Doc tx semantics for @TransactionalEventListener after completion phases

    This commit improves the Javadoc regarding transactional semantics for
    @TransactionalEventListener methods invoked in the AFTER_COMMIT,
    AFTER_ROLLBACK, or AFTER_COMPLETION phase. Specifically, the
    documentation now points out that interactions with the underlying
    transactional resource will not be committed in those phases.
    
    Closes gh-26974
    sbrannen committed May 26, 2021
    Copy the full SHA
    911aca1 View commit details

Commits on May 30, 2021

  1. Fix @transactional docs regarding method visibility

    Closes gh-27001
    hrybs authored and sbrannen committed May 30, 2021
    Copy the full SHA
    5b55cef View commit details
  2. Copy the full SHA
    70e6606 View commit details

Commits on Jun 8, 2021

  1. Copy the full SHA
    67fccc3 View commit details

Commits on Jun 15, 2021

  1. Copy the full SHA
    1f098e1 View commit details
  2. Ensure DefaultPathSegment does not allow parameters to be mutated

    Prior to this commit, if a PathContainer was created using
    Options.MESSAGE_ROUTE, DefaultPathSegment#parameters() returned a
    mutable map which would allow the user to modify the contents of the
    static, shared EMPTY_PARAMS map in DefaultPathContainer.
    
    This commit prevents corruption of the shared EMPTY_PARAMS map by
    ensuring that parameters stored in DefaultPathSegment are always
    immutable.
    
    Closes gh-27064
    sbrannen committed Jun 15, 2021
    Copy the full SHA
    c5a138a View commit details

Commits on Jun 23, 2021

  1. Synchronoss should create temp directory lazily

    The SynchronossPartHttpMessageReader should only create temp directory
    when needed, not at startup.
    
    Closes gh-27092
    poutsma committed Jun 23, 2021
    Copy the full SHA
    7b34bf2 View commit details

Commits on Jun 24, 2021

  1. Fix bug in SimpleMethodMetadataReadingVisitor.Source.toString()

    Prior to this commit, the toString() implementation did not separate
    method argument types with a comma or any form of separator, leading
    to results such as:
    
        org.example.MyClass.myMethod(java.lang.Stringjava.lang.Integer)
    
    instead of:
    
        org.example.MyClass.myMethod(java.lang.String,java.lang.Integer)
    
    Closes gh-27095
    sbrannen committed Jun 24, 2021
    Copy the full SHA
    43901b2 View commit details

Commits on Jul 12, 2021

  1. Fix CI build badge in README

    snicoll committed Jul 12, 2021
    Copy the full SHA
    348dc82 View commit details

Commits on Jul 13, 2021

  1. BeanCreationException message includes declaring class of constructor…

    …/factory method
    
    Closes gh-27139
    
    (cherry picked from commit 74f9133)
    jhoeller committed Jul 13, 2021
    Copy the full SHA
    bc4af15 View commit details
  2. Make proxyTargetClass=true with introduction advice work for JDK prox…

    …y targets
    
    Closes gh-27044
    
    (cherry picked from commit c45c46d)
    jhoeller committed Jul 13, 2021
    Copy the full SHA
    bdbd999 View commit details
  3. Upgrade to Reactor Dysprosium-SR21

    Closes gh-27163
    jhoeller committed Jul 13, 2021
    Copy the full SHA
    11c51d8 View commit details
  4. Polishing (backported)

    jhoeller committed Jul 13, 2021
    Copy the full SHA
    fe3357d View commit details

Commits on Jul 14, 2021

  1. Copy the full SHA
    14adefa View commit details
  2. Release v5.2.16.RELEASE

    spring-builds committed Jul 14, 2021
    Copy the full SHA
    f5a7a83 View commit details
Showing with 894 additions and 606 deletions.
  1. +1 −1 README.md
  2. +1 −1 build.gradle
  3. +1 −1 gradle.properties
  4. +0 −3 gradle/docs.gradle
  5. +12 −1 spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java
  6. +3 −2 spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java
  7. +2 −2 spring-aop/src/test/java/org/springframework/aop/framework/ProxyFactoryTests.java
  8. +7 −7 spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
  9. +8 −4 spring-beans/src/test/java/org/springframework/beans/factory/Spr5475Tests.java
  10. +2 −2 ...t/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java
  11. +1 −0 spring-context/src/main/java/org/springframework/context/event/EventListener.java
  12. +6 −3 spring-context/src/main/java/org/springframework/validation/support/BindingAwareConcurrentModel.java
  13. +4 −3 spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java
  14. +21 −5 spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AutoProxyCreatorTests.java
  15. +3 −2 spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java
  16. +10 −6 .../src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadataReadingVisitor.java
  17. +4 −4 spring-core/src/main/java/org/springframework/util/ClassUtils.java
  18. +1 −1 spring-core/src/main/java/org/springframework/util/StringUtils.java
  19. +6 −5 spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java
  20. +449 −370 spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptUtils.java
  21. +50 −13 spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/ScriptUtilsUnitTests.java
  22. +4 −1 .../resources/org/springframework/jdbc/datasource/init/test-data-with-multi-line-nested-comments.sql
  23. +1 −2 .../org/springframework/messaging/handler/annotation/support/DefaultMessageHandlerMethodFactory.java
  24. +0 −1 ...va/org/springframework/messaging/rsocket/annotation/support/RSocketFrameTypeMessageCondition.java
  25. +11 −8 spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java
  26. +20 −10 spring-tx/src/main/java/org/springframework/transaction/event/TransactionPhase.java
  27. +18 −6 spring-tx/src/main/java/org/springframework/transaction/event/TransactionalEventListener.java
  28. +36 −18 ...-web/src/main/java/org/springframework/http/codec/multipart/SynchronossPartHttpMessageReader.java
  29. +29 −19 spring-web/src/main/java/org/springframework/http/server/DefaultPathContainer.java
  30. +8 −6 spring-web/src/main/java/org/springframework/http/server/PathContainer.java
  31. +2 −2 spring-web/src/main/java/org/springframework/http/server/reactive/JettyHeadersAdapter.java
  32. +2 −2 spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java
  33. +4 −3 spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java
  34. +2 −3 spring-web/src/main/java/org/springframework/web/cors/CorsConfiguration.java
  35. +70 −44 spring-web/src/test/java/org/springframework/http/server/DefaultPathContainerTests.java
  36. +7 −2 ...-webmvc/src/main/java/org/springframework/web/servlet/function/support/RouterFunctionMapping.java
  37. +2 −1 ...ng-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java
  38. +3 −1 ...vc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMapping.java
  39. +4 −4 src/docs/asciidoc/core/core-beans.adoc
  40. +79 −37 src/docs/asciidoc/data-access.adoc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="src/docs/asciidoc/images/spring-framework.png" width="80" height="80"> Spring Framework [![Build Status](https://build.spring.io/plugins/servlet/wittified/build-status/SPR-PUBM)](https://build.spring.io/browse/SPR)
# <img src="src/docs/asciidoc/images/spring-framework.png" width="80" height="80"> Spring Framework [![Build Status](https://ci.spring.io/api/v1/teams/spring-framework/pipelines/spring-framework-5.2.x/jobs/build/badge)](https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-5.2.x?groups=Build")

This is the home of the Spring Framework: the foundation for all [Spring projects](https://spring.io/projects). Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ configure(allprojects) { project ->
imports {
mavenBom "com.fasterxml.jackson:jackson-bom:2.10.5"
mavenBom "io.netty:netty-bom:4.1.51.Final"
mavenBom "io.projectreactor:reactor-bom:Dysprosium-SR20"
mavenBom "io.projectreactor:reactor-bom:Dysprosium-SR21"
mavenBom "io.rsocket:rsocket-bom:1.0.4"
mavenBom "org.eclipse.jetty:jetty-bom:9.4.31.v20200723"
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.3.72"
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=5.2.15.BUILD-SNAPSHOT
version=5.2.16.RELEASE
org.gradle.jvmargs=-Xmx1536M
org.gradle.caching=true
org.gradle.parallel=true
3 changes: 0 additions & 3 deletions gradle/docs.gradle
Original file line number Diff line number Diff line change
@@ -103,9 +103,6 @@ dokka {
externalDocumentationLink {
url = new URL("https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/")
}
externalDocumentationLink {
url = new URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/")
}
}
}

Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
package org.springframework.aop.framework.autoproxy;

import java.lang.reflect.Constructor;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -449,7 +450,17 @@ protected Object createProxy(Class<?> beanClass, @Nullable String beanName,
ProxyFactory proxyFactory = new ProxyFactory();
proxyFactory.copyFrom(this);

if (!proxyFactory.isProxyTargetClass()) {
if (proxyFactory.isProxyTargetClass()) {
// Explicit handling of JDK proxy targets (for introduction advice scenarios)
if (Proxy.isProxyClass(beanClass)) {
// Must allow for introductions; can't just set interfaces to the proxy's interfaces only.
for (Class<?> ifc : beanClass.getInterfaces()) {
proxyFactory.addInterface(ifc);
}
}
}
else {
// No proxyTargetClass flag enforced, let's apply our default checks...
if (shouldProxyTargetClass(beanClass, beanName)) {
proxyFactory.setProxyTargetClass(true);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -71,7 +71,8 @@ public DefaultIntroductionAdvisor(Advice advice, @Nullable IntroductionInfo intr
if (introductionInfo != null) {
Class<?>[] introducedInterfaces = introductionInfo.getInterfaces();
if (introducedInterfaces.length == 0) {
throw new IllegalArgumentException("IntroductionAdviceSupport implements no interfaces");
throw new IllegalArgumentException(
"IntroductionInfo defines no interfaces to introduce: " + introductionInfo);
}
for (Class<?> ifc : introducedInterfaces) {
addInterface(ifc);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -183,7 +183,7 @@ public void testAddRepeatedInterface() {
}

@Test
public void testGetsAllInterfaces() throws Exception {
public void testGetsAllInterfaces() {
// Extend to get new interface
class TestBeanSubclass extends TestBean implements Comparable<Object> {
@Override
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 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.
@@ -276,12 +276,12 @@ else if (constructorToUse != null && typeDiffWeight == minTypeDiffWeight) {
throw ex;
}
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
"Could not resolve matching constructor " +
"Could not resolve matching constructor on bean class [" + mbd.getBeanClassName() + "] " +
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)");
}
else if (ambiguousConstructors != null && !mbd.isLenientConstructorResolution()) {
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
"Ambiguous constructor matches found in bean '" + beanName + "' " +
"Ambiguous constructor matches found on bean class [" + mbd.getBeanClassName() + "] " +
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities): " +
ambiguousConstructors);
}
@@ -607,7 +607,7 @@ else if (resolvedValues != null) {
}
String argDesc = StringUtils.collectionToCommaDelimitedString(argTypes);
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
"No matching factory method found: " +
"No matching factory method found on class [" + factoryClass.getName() + "]: " +
(mbd.getFactoryBeanName() != null ?
"factory bean '" + mbd.getFactoryBeanName() + "'; " : "") +
"factory method '" + mbd.getFactoryMethodName() + "(" + argDesc + ")'. " +
@@ -618,12 +618,12 @@ else if (resolvedValues != null) {
}
else if (void.class == factoryMethodToUse.getReturnType()) {
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
"Invalid factory method '" + mbd.getFactoryMethodName() +
"': needs to have a non-void return type!");
"Invalid factory method '" + mbd.getFactoryMethodName() + "' on class [" +
factoryClass.getName() + "]: needs to have a non-void return type!");
}
else if (ambiguousFactoryMethods != null) {
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
"Ambiguous factory method matches found in bean '" + beanName + "' " +
"Ambiguous factory method matches found on class [" + factoryClass.getName() + "] " +
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities): " +
ambiguousFactoryMethods);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -31,6 +31,7 @@
* invoking a factory method is not instructive to the user and rather misleading.
*
* @author Chris Beams
* @author Juergen Hoeller
*/
public class Spr5475Tests {

@@ -40,7 +41,8 @@ public void noArgFactoryMethodInvokedWithOneArg() {
rootBeanDefinition(Foo.class)
.setFactoryMethod("noArgFactory")
.addConstructorArgValue("bogusArg").getBeanDefinition(),
"Error creating bean with name 'foo': No matching factory method found: factory method 'noArgFactory(String)'. " +
"Error creating bean with name 'foo': No matching factory method found on class " +
"[org.springframework.beans.factory.Spr5475Tests$Foo]: factory method 'noArgFactory(String)'. " +
"Check that a method with the specified name and arguments exists and that it is static.");
}

@@ -51,7 +53,8 @@ public void noArgFactoryMethodInvokedWithTwoArgs() {
.setFactoryMethod("noArgFactory")
.addConstructorArgValue("bogusArg1")
.addConstructorArgValue("bogusArg2".getBytes()).getBeanDefinition(),
"Error creating bean with name 'foo': No matching factory method found: factory method 'noArgFactory(String,byte[])'. " +
"Error creating bean with name 'foo': No matching factory method found on class " +
"[org.springframework.beans.factory.Spr5475Tests$Foo]: factory method 'noArgFactory(String,byte[])'. " +
"Check that a method with the specified name and arguments exists and that it is static.");
}

@@ -65,7 +68,8 @@ public void noArgFactoryMethodInvokedWithTwoArgsAndTypesSpecified() {
def.setConstructorArgumentValues(cav);

assertExceptionMessageForMisconfiguredFactoryMethod(def,
"Error creating bean with name 'foo': No matching factory method found: factory method 'noArgFactory(CharSequence,byte[])'. " +
"Error creating bean with name 'foo': No matching factory method found on class " +
"[org.springframework.beans.factory.Spr5475Tests$Foo]: factory method 'noArgFactory(CharSequence,byte[])'. " +
"Check that a method with the specified name and arguments exists and that it is static.");
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -244,7 +244,7 @@ public String getName() {
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Qualifier
private static @interface TestQualifier {
private @interface TestQualifier {
}

}
Original file line number Diff line number Diff line change
@@ -83,6 +83,7 @@
* @author Sam Brannen
* @since 4.2
* @see EventListenerMethodProcessor
* @see org.springframework.transaction.event.TransactionalEventListener
*/
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2021 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.
@@ -18,6 +18,7 @@

import java.util.Map;

import org.springframework.lang.Nullable;
import org.springframework.ui.ConcurrentModel;
import org.springframework.validation.BindingResult;

@@ -36,17 +37,19 @@
* @author Rossen Stoyanchev
* @since 5.0
* @see BindingResult
* @see BindingAwareModelMap
*/
@SuppressWarnings("serial")
public class BindingAwareConcurrentModel extends ConcurrentModel {

@Override
public Object put(String key, Object value) {
@Nullable
public Object put(String key, @Nullable Object value) {
removeBindingResultIfNecessary(key, value);
return super.put(key, value);
}

private void removeBindingResultIfNecessary(String key, Object value) {
private void removeBindingResultIfNecessary(String key, @Nullable Object value) {
if (!key.startsWith(BindingResult.MODEL_KEY_PREFIX)) {
String resultKey = BindingResult.MODEL_KEY_PREFIX + key;
BindingResult result = (BindingResult) get(resultKey);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 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.
@@ -18,6 +18,7 @@

import java.util.Map;

import org.springframework.lang.Nullable;
import org.springframework.ui.ExtendedModelMap;
import org.springframework.validation.BindingResult;

@@ -39,7 +40,7 @@
public class BindingAwareModelMap extends ExtendedModelMap {

@Override
public Object put(String key, Object value) {
public Object put(String key, @Nullable Object value) {
removeBindingResultIfNecessary(key, value);
return super.put(key, value);
}
@@ -50,7 +51,7 @@ public void putAll(Map<? extends String, ?> map) {
super.putAll(map);
}

private void removeBindingResultIfNecessary(Object key, Object value) {
private void removeBindingResultIfNecessary(Object key, @Nullable Object value) {
if (key instanceof String) {
String attributeName = (String) key;
if (!attributeName.startsWith(BindingResult.MODEL_KEY_PREFIX)) {
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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,7 @@
import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.support.AopUtils;
import org.springframework.aop.support.DefaultIntroductionAdvisor;
import org.springframework.aop.target.SingletonTargetSource;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.BeanFactory;
@@ -219,7 +220,7 @@ public void testAutoProxyCreatorWithFallbackToDynamicProxy() {

MutablePropertyValues pvs = new MutablePropertyValues();
pvs.add("proxyFactoryBean", "false");
sac.registerSingleton("testAutoProxyCreator", TestAutoProxyCreator.class, pvs);
sac.registerSingleton("testAutoProxyCreator", IntroductionTestAutoProxyCreator.class, pvs);

sac.registerSingleton("noInterfaces", NoInterfaces.class);
sac.registerSingleton("containerCallbackInterfacesOnly", ContainerCallbackInterfacesOnly.class);
@@ -248,9 +249,9 @@ public void testAutoProxyCreatorWithFallbackToDynamicProxy() {
singletonNoInterceptor.getName();
assertThat(tapc.testInterceptor.nrOfInvocations).isEqualTo(0);
singletonToBeProxied.getAge();
assertThat(tapc.testInterceptor.nrOfInvocations).isEqualTo(1);
prototypeToBeProxied.getSpouse();
assertThat(tapc.testInterceptor.nrOfInvocations).isEqualTo(2);
prototypeToBeProxied.getSpouse();
assertThat(tapc.testInterceptor.nrOfInvocations).isEqualTo(4);
}

@Test
@@ -404,7 +405,7 @@ protected Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String name,
else if (name.endsWith("ToBeProxied")) {
boolean isFactoryBean = FactoryBean.class.isAssignableFrom(beanClass);
if ((this.proxyFactoryBean && isFactoryBean) || (this.proxyObject && !isFactoryBean)) {
return new Object[] {this.testInterceptor};
return getAdvicesAndAdvisors();
}
else {
return DO_NOT_PROXY;
@@ -414,6 +415,10 @@ else if (name.endsWith("ToBeProxied")) {
return PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS;
}
}

protected Object[] getAdvicesAndAdvisors() {
return new Object[] {this.testInterceptor};
}
}


@@ -426,6 +431,17 @@ public FallbackTestAutoProxyCreator() {
}


@SuppressWarnings("serial")
public static class IntroductionTestAutoProxyCreator extends TestAutoProxyCreator {

protected Object[] getAdvicesAndAdvisors() {
DefaultIntroductionAdvisor advisor = new DefaultIntroductionAdvisor(this.testInterceptor);
advisor.addInterface(Serializable.class);
return new Object[] {this.testInterceptor, advisor};
}
}


/**
* Interceptor that counts the number of non-finalize method calls.
*/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -47,8 +47,9 @@
public class QualifierAnnotationTests {

private static final String CLASSNAME = QualifierAnnotationTests.class.getName();

private static final String CONFIG_LOCATION =
format("classpath:%s-context.xml", convertClassNameToResourcePath(CLASSNAME));
format("classpath:%s-context.xml", convertClassNameToResourcePath(CLASSNAME));


@Test
Loading