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.12.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.13.RELEASE
Choose a head ref
Loading
Showing with 4,812 additions and 2,994 deletions.
  1. +3 −3 build.gradle
  2. +1 −1 gradle.properties
  3. +23 −19 spring-beans/src/main/java/org/springframework/beans/factory/annotation/Autowired.java
  4. +17 −17 ...-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java
  5. +3 −3 spring-context-support/src/main/java/org/springframework/mail/SimpleMailMessage.java
  6. +20 −11 spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java
  7. +44 −12 spring-context/src/main/java/org/springframework/context/annotation/Bean.java
  8. +1 −1 spring-context/src/main/java/org/springframework/context/annotation/Configuration.java
  9. +4 −4 spring-context/src/main/java/org/springframework/context/annotation/Primary.java
  10. +4 −5 spring-context/src/main/java/org/springframework/context/event/EventListenerMethodProcessor.java
  11. +8 −6 spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
  12. +9 −4 spring-context/src/main/java/org/springframework/context/support/ApplicationListenerDetector.java
  13. +19 −11 spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java
  14. +7 −2 ...src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java
  15. +2 −2 spring-context/src/main/java/org/springframework/stereotype/Component.java
  16. +2 −2 spring-context/src/main/java/org/springframework/stereotype/Controller.java
  17. +3 −3 spring-context/src/main/java/org/springframework/stereotype/Repository.java
  18. +2 −2 spring-context/src/main/java/org/springframework/stereotype/Service.java
  19. +2 −2 ...g-context/src/main/java/org/springframework/validation/beanvalidation/SpringValidatorAdapter.java
  20. +42 −9 spring-context/src/test/java/org/springframework/context/annotation/DestroyMethodInferenceTests.java
  21. +98 −0 spring-context/src/test/java/org/springframework/context/annotation/Spr16179Tests.java
  22. +131 −0 spring-context/src/test/java/org/springframework/context/annotation/Spr16217Tests.java
  23. +2 −2 .../org/springframework/context/annotation/{ConfigurationClassSpr8954Tests.java → Spr8954Tests.java}
  24. +34 −1 ...g-context/src/test/java/org/springframework/context/support/ResourceBundleMessageSourceTests.java
  25. +22 −21 spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java
  26. +183 −0 ...text/src/test/java/org/springframework/validation/beanvalidation/SpringValidatorAdapterTests.java
  27. +11 −12 spring-context/src/test/resources/org/springframework/scripting/bsh/bsh-with-xsd.xml
  28. +44 −32 spring-core/src/main/java/org/springframework/core/BridgeMethodResolver.java
  29. +18 −12 spring-core/src/main/java/org/springframework/core/MethodParameter.java
  30. +21 −13 spring-core/src/main/java/org/springframework/core/annotation/Order.java
  31. +2 −2 ...core/src/main/java/org/springframework/core/convert/support/AbstractConditionalEnumConverter.java
  32. +20 −26 spring-core/src/main/java/org/springframework/core/convert/support/DefaultConversionService.java
  33. +3 −3 spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java
  34. +3 −3 spring-core/src/main/java/org/springframework/core/io/ByteArrayResource.java
  35. +3 −2 spring-core/src/main/java/org/springframework/core/io/ClassPathResource.java
  36. +5 −0 ...g-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
  37. +9 −10 spring-core/src/main/java/org/springframework/core/type/ClassMetadata.java
  38. +2 −2 spring-core/src/main/java/org/springframework/core/type/StandardAnnotationMetadata.java
  39. +4 −3 spring-core/src/main/java/org/springframework/core/type/StandardClassMetadata.java
  40. +4 −3 ...ng-core/src/main/java/org/springframework/core/type/classreading/ClassMetadataReadingVisitor.java
  41. +3 −2 ...g-core/src/main/java/org/springframework/core/type/classreading/MethodMetadataReadingVisitor.java
  42. +2 −2 spring-core/src/main/java/org/springframework/util/MethodInvoker.java
  43. +21 −42 spring-core/src/main/java/org/springframework/util/StringUtils.java
  44. +122 −63 spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java
  45. +43 −31 spring-core/src/test/java/org/springframework/core/io/ClassPathResourceTests.java
  46. +4 −13 spring-core/src/test/java/org/springframework/stereotype/Component.java
  47. +21 −11 spring-core/src/test/java/org/springframework/util/MethodInvokerTests.java
  48. +76 −40 spring-core/src/test/java/org/springframework/util/StringUtilsTests.java
  49. +8 −3 spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java
  50. +2 −3 spring-expression/src/main/java/org/springframework/expression/spel/ast/Projection.java
  51. +10 −1 ...xpression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodResolver.java
  52. +557 −503 spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java
  53. +2 −2 spring-jdbc/src/main/java/org/springframework/jdbc/core/BatchUpdateUtils.java
  54. +20 −10 spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java
  55. +6 −0 spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
  56. +2 −2 spring-jdbc/src/main/java/org/springframework/jdbc/core/RowMapper.java
  57. +15 −5 spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
  58. +6 −5 ...g-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterBatchUpdateUtils.java
  59. +7 −5 spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcOperations.java
  60. +4 −10 spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java
  61. +17 −15 spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/SqlParameterSourceUtils.java
  62. +7 −2 ...-jms/src/main/java/org/springframework/jms/annotation/JmsListenerAnnotationBeanPostProcessor.java
  63. +1 −1 ...saging/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java
  64. +12 −8 spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageHeaderAccessor.java
  65. +6 −3 spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompDecoder.java
  66. +37 −28 spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
  67. +6 −1 spring-messaging/src/main/java/org/springframework/messaging/support/MessageHeaderAccessor.java
  68. +33 −18 spring-orm/src/main/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBean.java
  69. +33 −9 spring-orm/src/main/java/org/springframework/orm/jpa/JpaVendorAdapter.java
  70. +11 −4 spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java
  71. +9 −6 spring-orm/src/main/java/org/springframework/orm/jpa/vendor/AbstractJpaVendorAdapter.java
  72. +20 −6 spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java
  73. +3 −1 spring-oxm/src/main/java/org/springframework/oxm/castor/CastorMappingException.java
  74. +5 −3 spring-oxm/src/main/java/org/springframework/oxm/castor/CastorMarshaller.java
  75. +4 −2 spring-oxm/src/main/java/org/springframework/oxm/config/CastorMarshallerBeanDefinitionParser.java
  76. +1 −1 spring-oxm/src/main/resources/org/springframework/oxm/config/spring-oxm-4.3.xsd
  77. +13 −8 spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java
  78. +17 −10 spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java
  79. +34 −23 spring-test/src/main/java/org/springframework/test/web/client/AbstractRequestExpectationManager.java
  80. +2 −1 spring-test/src/main/java/org/springframework/test/web/servlet/request/MockMvcRequestBuilders.java
  81. +24 −7 spring-test/src/test/java/org/springframework/mock/web/MockHttpServletRequestTests.java
  82. +7 −1 spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java
  83. +34 −9 spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java
  84. +30 −1 ...-test/src/test/java/org/springframework/test/web/client/SimpleRequestExpectationManagerTests.java
  85. +8 −10 ...st/src/test/java/org/springframework/test/web/client/UnorderedRequestExpectationManagerTests.java
  86. +13 −17 spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java
  87. +19 −10 spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java
  88. +23 −18 spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java
  89. +32 −7 spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java
  90. +3 −2 spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
  91. +11 −6 ...main/java/org/springframework/http/converter/support/AllEncompassingFormHttpMessageConverter.java
  92. +11 −5 spring-web/src/main/java/org/springframework/web/bind/annotation/ControllerAdvice.java
  93. +2 −2 spring-web/src/main/java/org/springframework/web/bind/annotation/RestController.java
  94. +11 −4 spring-web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java
  95. +14 −7 spring-web/src/main/java/org/springframework/web/client/RestTemplate.java
  96. +16 −1 ...b/src/main/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequest.java
  97. +20 −0 spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java
  98. +21 −23 ...ng-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java
  99. +49 −31 spring-web/src/main/java/org/springframework/web/method/support/ModelAndViewContainer.java
  100. +5 −3 spring-web/src/main/java/org/springframework/web/util/UriTemplate.java
  101. +8 −0 spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java
  102. +12 −12 spring-web/src/test/java/org/springframework/http/HttpRangeTests.java
  103. +13 −8 spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java
  104. +1 −1 spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java
  105. +15 −3 spring-web/src/test/java/org/springframework/web/client/DefaultResponseErrorHandlerTests.java
  106. +15 −27 spring-web/src/test/java/org/springframework/web/client/HttpMessageConverterExtractorTests.java
  107. +56 −71 ...-web/src/test/java/org/springframework/web/context/request/ServletWebRequestHttpMethodsTests.java
  108. +16 −2 .../test/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequestTests.java
  109. +6 −8 spring-web/src/test/java/org/springframework/web/method/annotation/ModelFactoryTests.java
  110. +14 −7 ...vc/src/main/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParser.java
  111. +36 −37 spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java
  112. +74 −75 ...ng-webmvc/src/main/java/org/springframework/web/servlet/config/ResourcesBeanDefinitionParser.java
  113. +25 −28 .../src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistration.java
  114. +30 −11 ...bmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java
  115. +19 −9 ...c/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java
  116. +42 −41 spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerMappingIntrospector.java
  117. +7 −8 ...a/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewMethodReturnValueHandler.java
  118. +0 −2 ...bmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java
  119. +1 −1 ...ain/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethod.java
  120. +8 −8 ...a/org/springframework/web/servlet/mvc/method/annotation/ServletModelAttributeMethodProcessor.java
  121. +97 −5 spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java
  122. +114 −10 spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java
  123. +7 −7 spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceUrlProvider.java
  124. +3 −2 spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectedValueComparator.java
  125. +6 −1 ...ng-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfStamperView.java
  126. +10 −6 spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java
  127. +3 −0 spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.3.xsd
  128. +27 −15 spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java
  129. +40 −6 ...src/test/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistryTests.java
  130. +0 −1 ...src/test/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterTests.java
  131. +39 −1 ...ingframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java
  132. +60 −1 spring-webmvc/src/test/java/org/springframework/web/servlet/resource/PathResourceResolverTests.java
  133. +13 −15 ...ebmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerTests.java
  134. +7 −1 ...g-webmvc/src/test/resources/org/springframework/web/servlet/config/mvc-config-resources-chain.xml
  135. +2 −4 ...t/src/main/java/org/springframework/web/socket/config/annotation/WebMvcStompEndpointRegistry.java
  136. +1 −1 ...src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java
  137. +4 −4 .../org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java
  138. +38 −17 ...ket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java
  139. +6 −5 spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java
  140. +14 −16 spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolHandler.java
  141. +30 −14 ...websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java
  142. +1 −1 src/asciidoc/core-aop-api.adoc
  143. +171 −65 src/asciidoc/core-beans.adoc
  144. +1 −1 src/asciidoc/core-expressions.adoc
  145. +30 −7 src/asciidoc/core-resources.adoc
  146. +181 −200 src/asciidoc/data-access.adoc
  147. +260 −260 src/asciidoc/integration.adoc
  148. +318 −262 src/asciidoc/testing.adoc
  149. +97 −92 src/asciidoc/web-mvc.adoc
  150. +0 −1 src/asciidoc/web-portlet.adoc
  151. +113 −46 src/asciidoc/web-view.adoc
  152. +266 −234 src/asciidoc/web-websocket.adoc
  153. +65 −1 src/asciidoc/whats-new.adoc
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ configure(allprojects) { project ->
ext.ejbVersion = "3.0"
ext.fileuploadVersion = "1.3.3"
ext.freemarkerVersion = "2.3.23"
ext.groovyVersion = "2.4.12"
ext.groovyVersion = "2.4.13"
ext.gsonVersion = "2.8.2"
ext.guavaVersion = "20.0"
ext.hamcrestVersion = "1.3"
@@ -62,7 +62,7 @@ configure(allprojects) { project ->
ext.jtaVersion = "1.2"
ext.junitVersion = "4.12"
ext.log4jVersion = "1.2.17"
ext.nettyVersion = "4.1.16.Final"
ext.nettyVersion = "4.1.17.Final"
ext.okhttpVersion = "2.7.5"
ext.okhttp3Version = "3.8.1"
ext.openjpaVersion = "2.4.2"
@@ -77,7 +77,7 @@ configure(allprojects) { project ->
ext.tiles3Version = "3.0.7"
ext.tomcatVersion = "8.5.23"
ext.tyrusVersion = "1.3.5" // constrained by WebLogic 12.1.3 support
ext.undertowVersion = "1.3.31.Final"
ext.undertowVersion = "1.3.33.Final"
ext.xmlunitVersion = "1.6"
ext.xstreamVersion = "1.4.9"

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=4.3.12.BUILD-SNAPSHOT
version=4.3.13.RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -23,29 +23,33 @@
import java.lang.annotation.Target;

/**
* Marks a constructor, field, setter method or config method as to be
* autowired by Spring's dependency injection facilities.
* Marks a constructor, field, setter method or config method as to be autowired
* by Spring's dependency injection facilities.
*
* <p>Only one constructor (at max) of any given bean class may carry this
* annotation, indicating the constructor to autowire when used as a Spring
* bean. Such a constructor does not have to be public.
* <p>Only one constructor (at max) of any given bean class may carry this annotation,
* indicating the constructor to autowire when used as a Spring bean. Such a
* constructor does not have to be public.
*
* <p>Fields are injected right after construction of a bean, before any
* config methods are invoked. Such a config field does not have to be public.
* <p>Fields are injected right after construction of a bean, before any config
* methods are invoked. Such a config field does not have to be public.
*
* <p>Config methods may have an arbitrary name and any number of arguments;
* each of those arguments will be autowired with a matching bean in the
* Spring container. Bean property setter methods are effectively just
* a special case of such a general config method. Such config methods
* do not have to be public.
* <p>Config methods may have an arbitrary name and any number of arguments; each of
* those arguments will be autowired with a matching bean in the Spring container.
* Bean property setter methods are effectively just a special case of such a general
* config method. Such config methods do not have to be public.
*
* <p>In the case of multiple argument methods, the 'required' parameter is
* applicable for all arguments.
* <p>In the case of a multi-arg constructor or method, the 'required' parameter is
* applicable to all arguments. Individual parameters may be declared as Java-8-style
* {@link java.util.Optional}, overriding the base required semantics.
*
* <p>In case of a {@link java.util.Collection} or {@link java.util.Map}
* dependency type, the container will autowire all beans matching the
* declared value type. In case of a Map, the keys must be declared as
* type String and will be resolved to the corresponding bean names.
* <p>In case of a {@link java.util.Collection} or {@link java.util.Map} dependency type,
* the container autowires all beans matching the declared value type. For such purposes,
* the map keys must be declared as type String which will be resolved to the corresponding
* bean names. Such a container-provided collection will be ordered, taking into account
* {@link org.springframework.core.Ordered}/{@link org.springframework.core.annotation.Order}
* values of the target components, otherwise following their registration order in the
* container. Alternatively, a single matching target bean may also be a generally typed
* {@code Collection} or {@code Map} itself, getting injected as such.
*
* <p>Note that actual injection is performed through a
* {@link org.springframework.beans.factory.config.BeanPostProcessor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2017 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.
@@ -140,15 +140,15 @@ public void testGetObjectType() throws Exception {
mcfb.setTargetMethod("voidRetvalMethod");
mcfb.afterPropertiesSet();
Class<?> objType = mcfb.getObjectType();
assertTrue(objType.equals(void.class));
assertSame(objType, void.class);

// verify that we can call a method with args that are subtypes of the
// target method arg types
TestClass1._staticField1 = 0;
mcfb = new MethodInvokingFactoryBean();
mcfb.setTargetClass(TestClass1.class);
mcfb.setTargetMethod("supertypes");
mcfb.setArguments(new Object[] {new ArrayList<Object>(), new ArrayList<Object>(), "hello"});
mcfb.setArguments(new ArrayList<>(), new ArrayList<Object>(), "hello");
mcfb.afterPropertiesSet();
mcfb.getObjectType();

@@ -157,7 +157,7 @@ public void testGetObjectType() throws Exception {
mcfb.registerCustomEditor(String.class, new StringTrimmerEditor(false));
mcfb.setTargetClass(TestClass1.class);
mcfb.setTargetMethod("supertypes");
mcfb.setArguments(new Object[] {"1", new Object()});
mcfb.setArguments("1", new Object());
try {
mcfb.afterPropertiesSet();
fail("Should have thrown NoSuchMethodException");
@@ -225,7 +225,7 @@ public void testGetObject() throws Exception {
mcfb = new MethodInvokingFactoryBean();
mcfb.setTargetClass(TestClass1.class);
mcfb.setTargetMethod("supertypes");
mcfb.setArguments(new Object[] {new ArrayList<Object>(), new ArrayList<Object>(), "hello"});
mcfb.setArguments(new ArrayList<>(), new ArrayList<Object>(), "hello");
// should pass
mcfb.afterPropertiesSet();
}
@@ -235,7 +235,7 @@ public void testArgumentConversion() throws Exception {
MethodInvokingFactoryBean mcfb = new MethodInvokingFactoryBean();
mcfb.setTargetClass(TestClass1.class);
mcfb.setTargetMethod("supertypes");
mcfb.setArguments(new Object[] {new ArrayList<Object>(), new ArrayList<Object>(), "hello", "bogus"});
mcfb.setArguments(new ArrayList<>(), new ArrayList<Object>(), "hello", "bogus");
try {
mcfb.afterPropertiesSet();
fail("Matched method with wrong number of args");
@@ -247,7 +247,7 @@ public void testArgumentConversion() throws Exception {
mcfb = new MethodInvokingFactoryBean();
mcfb.setTargetClass(TestClass1.class);
mcfb.setTargetMethod("supertypes");
mcfb.setArguments(new Object[] {1, new Object()});
mcfb.setArguments(1, new Object());
try {
mcfb.afterPropertiesSet();
mcfb.getObject();
@@ -260,14 +260,14 @@ public void testArgumentConversion() throws Exception {
mcfb = new MethodInvokingFactoryBean();
mcfb.setTargetClass(TestClass1.class);
mcfb.setTargetMethod("supertypes2");
mcfb.setArguments(new Object[] {new ArrayList<Object>(), new ArrayList<Object>(), "hello", "bogus"});
mcfb.setArguments(new ArrayList<>(), new ArrayList<Object>(), "hello", "bogus");
mcfb.afterPropertiesSet();
assertEquals("hello", mcfb.getObject());

mcfb = new MethodInvokingFactoryBean();
mcfb.setTargetClass(TestClass1.class);
mcfb.setTargetMethod("supertypes2");
mcfb.setArguments(new Object[] {new ArrayList<Object>(), new ArrayList<Object>(), new Object()});
mcfb.setArguments(new ArrayList<>(), new ArrayList<Object>(), new Object());
try {
mcfb.afterPropertiesSet();
fail("Matched method when shouldn't have matched");
@@ -292,14 +292,14 @@ public void testInvokeWithIntArgument() throws Exception {
ArgumentConvertingMethodInvoker methodInvoker = new ArgumentConvertingMethodInvoker();
methodInvoker.setTargetClass(TestClass1.class);
methodInvoker.setTargetMethod("intArgument");
methodInvoker.setArguments(new Object[] {5});
methodInvoker.setArguments(5);
methodInvoker.prepare();
methodInvoker.invoke();

methodInvoker = new ArgumentConvertingMethodInvoker();
methodInvoker.setTargetClass(TestClass1.class);
methodInvoker.setTargetMethod("intArgument");
methodInvoker.setArguments(new Object[] {"5"});
methodInvoker.setArguments(5);
methodInvoker.prepare();
methodInvoker.invoke();
}
@@ -309,37 +309,37 @@ public void testInvokeWithIntArguments() throws Exception {
MethodInvokingBean methodInvoker = new MethodInvokingBean();
methodInvoker.setTargetClass(TestClass1.class);
methodInvoker.setTargetMethod("intArguments");
methodInvoker.setArguments(new Object[]{new Integer[] {5, 10}});
methodInvoker.setArguments(new Object[] {new Integer[] {5, 10}});
methodInvoker.afterPropertiesSet();

methodInvoker = new MethodInvokingBean();
methodInvoker.setTargetClass(TestClass1.class);
methodInvoker.setTargetMethod("intArguments");
methodInvoker.setArguments(new Object[]{new String[]{"5", "10"}});
methodInvoker.setArguments(new Object[] {new String[] {"5", "10"}});
methodInvoker.afterPropertiesSet();

methodInvoker = new MethodInvokingBean();
methodInvoker.setTargetClass(TestClass1.class);
methodInvoker.setTargetMethod("intArguments");
methodInvoker.setArguments(new Object[]{new Integer[] {5, 10}});
methodInvoker.setArguments(new Object[] {new Integer[] {5, 10}});
methodInvoker.afterPropertiesSet();

methodInvoker = new MethodInvokingBean();
methodInvoker.setTargetClass(TestClass1.class);
methodInvoker.setTargetMethod("intArguments");
methodInvoker.setArguments(new String[]{"5", "10"});
methodInvoker.setArguments("5", "10");
methodInvoker.afterPropertiesSet();

methodInvoker = new MethodInvokingBean();
methodInvoker.setTargetClass(TestClass1.class);
methodInvoker.setTargetMethod("intArguments");
methodInvoker.setArguments(new Object[]{new Integer[] {5, 10}});
methodInvoker.setArguments(new Object[] {new Integer[] {5, 10}});
methodInvoker.afterPropertiesSet();

methodInvoker = new MethodInvokingBean();
methodInvoker.setTargetClass(TestClass1.class);
methodInvoker.setTargetMethod("intArguments");
methodInvoker.setArguments(new Object[]{"5", "10"});
methodInvoker.setArguments("5", "10");
methodInvoker.afterPropertiesSet();
}

Original file line number Diff line number Diff line change
@@ -24,7 +24,8 @@
import org.springframework.util.StringUtils;

/**
* Models a simple mail message, including data such as the from, to, cc, subject, and text fields.
* Models a simple mail message, including data such as the from, to, cc, subject,
* and text fields.
*
* <p>Consider {@code JavaMailSender} and JavaMail {@code MimeMessages} for creating
* more sophisticated messages, for example messages with attachments, special
@@ -179,10 +180,9 @@ public String getText() {
/**
* Copy the contents of this message to the given target message.
* @param target the {@code MailMessage} to copy to
* @throws IllegalArgumentException if the supplied {@code target} is {@code null}
*/
public void copyTo(MailMessage target) {
Assert.notNull(target, "The 'target' message argument cannot be null");
Assert.notNull(target, "'target' message argument must not be null");
if (getFrom() != null) {
target.setFrom(getFrom());
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -148,15 +148,19 @@
* can be useful if you do not need to customize everything. See {@link CachingConfigurer}
* Javadoc for further details.
*
* <p>The {@link #mode()} attribute controls how advice is applied; if the mode is
* {@link AdviceMode#PROXY} (the default), then the other attributes such as
* {@link #proxyTargetClass()} control the behavior of the proxying.
* <p>The {@link #mode} attribute controls how advice is applied: If the mode is
* {@link AdviceMode#PROXY} (the default), then the other attributes control the behavior
* of the proxying. Please note that proxy mode allows for interception of calls through
* the proxy only; local calls within the same class cannot get intercepted that way.
*
* <p>If the {@linkplain #mode} is set to {@link AdviceMode#ASPECTJ}, then the
* {@link #proxyTargetClass()} attribute is obsolete. Note also that in this case the
* {@code spring-aspects} module JAR must be present on the classpath.
* <p>Note that if the {@linkplain #mode} is set to {@link AdviceMode#ASPECTJ}, then the
* value of the {@link #proxyTargetClass} attribute will be ignored. Note also that in
* this case the {@code spring-aspects} module JAR must be present on the classpath, with
* compile-time weaving or load-time weaving applying the aspect to the affected classes.
* There is no proxy involved in such a scenario; local calls will be intercepted as well.
*
* @author Chris Beams
* @author Juergen Hoeller
* @since 3.1
* @see CachingConfigurer
* @see CachingConfigurationSelector
@@ -183,16 +187,21 @@
boolean proxyTargetClass() default false;

/**
* Indicate how caching advice should be applied. The default is
* {@link AdviceMode#PROXY}.
* @see AdviceMode
* Indicate how caching advice should be applied.
* <p><b>The default is {@link AdviceMode#PROXY}.</b>
* Please note that proxy mode allows for interception of calls through the proxy
* only. Local calls within the same class cannot get intercepted that way;
* a caching annotation on such a method within a local call will be ignored
* since Spring's interceptor does not even kick in for such a runtime scenario.
* For a more advanced mode of interception, consider switching this to
* {@link AdviceMode#ASPECTJ}.
*/
AdviceMode mode() default AdviceMode.PROXY;

/**
* Indicate the ordering of the execution of the caching advisor
* when multiple advices are applied at a specific joinpoint.
* The default is {@link Ordered#LOWEST_PRECEDENCE}.
* <p>The default is {@link Ordered#LOWEST_PRECEDENCE}.
*/
int order() default Ordered.LOWEST_PRECEDENCE;

Loading