Commit Graph

10383 Commits

Author SHA1 Message Date
Sam Brannen
8ecae8697a Cache attribute methods in AnnotationUtils
Issue: SPR-11512
2015-05-24 15:58:20 +02:00
Sam Brannen
d5974a18ab Polish AnnotationUtils 2015-05-24 15:58:19 +02:00
Sam Brannen
a1fc2097a1 Document SynthesizedAnnotationInvocationHandler constructor
Issue: SPR-11512
2015-05-24 15:58:07 +02:00
Sam Brannen
c13f689537 Document isSynthesizable() in AnnotationUtils
Issue: SPR-11512
2015-05-24 00:13:53 +02:00
Sam Brannen
7f22f09890 PolishingPolish SynthesizedAnnotationInvocationHandler 2015-05-23 23:58:35 +02:00
Sam Brannen
def7663ec4 Implement hashCode() for synthesized annotations
Issue: SPR-13066
2015-05-23 23:46:48 +02:00
Sam Brannen
ae5c8285a6 Polish SynthesizedAnnotationInvocationHandler 2015-05-23 22:40:05 +02:00
Sam Brannen
7e2e9a80d0 Document getAttributeMethods() in AnnotationUtils
Issue: SPR-11512
2015-05-23 22:29:12 +02:00
Sam Brannen
7bf609f111 Implement equals() for synthesized annotations
Issue: SPR-13065
2015-05-23 22:29:12 +02:00
Juergen Hoeller
c622f4c487 Polishing 2015-05-23 22:24:10 +02:00
Sam Brannen
62d1b4b6e8 Document getAttributeAliasMap() in AnnotationUtils
This commit also introduces a cache for attribute alias metadata.

Issue: SPR-11512
2015-05-23 20:30:03 +02:00
Juergen Hoeller
92bf32b9be Polishing 2015-05-23 20:04:48 +02:00
Juergen Hoeller
e0a11f2ae7 SockJsTransportFailureException provides constructor variant without session id 2015-05-23 20:02:42 +02:00
Sam Brannen
f5e096e2a0 Document @AliasFor
Issue: SPR-11512
2015-05-23 19:52:03 +02:00
Sam Brannen
b9e13ea308 Align AnnotationAttributes.toString() with contract in Map 2015-05-23 18:25:50 +02:00
Sam Brannen
f380689230 Don't use Java 8's Method.getParameterCount() 2015-05-23 18:18:03 +02:00
Sam Brannen
1e50d8d5c2 Implement toString() for synthesized annotations
Issue: SPR-13064
2015-05-23 18:09:39 +02:00
Sam Brannen
ab92f4ed3a Document SynthesizedAnnotation support
Issue: SPR-11512
2015-05-23 01:01:39 +02:00
Juergen Hoeller
05d475a275 Polishing 2015-05-22 23:50:47 +02:00
Juergen Hoeller
5f60d700a1 Reordered Jackson initialization steps and restored HandlerInstantiator else block 2015-05-22 23:50:39 +02:00
Juergen Hoeller
41e4273a71 Upgrade to Jackson 2.6, JasperReports 6.1, OpenJPA 2.4 2015-05-22 23:50:31 +02:00
Juergen Hoeller
d7a361315f Added further core features to 4.2 section 2015-05-22 23:50:22 +02:00
Sam Brannen
57e765f9ca Document annotation improvements & @AliasFor in new-in-4.2 2015-05-22 23:46:28 +02:00
Sam Brannen
9983add0f5 Polish new-in-4.2 section 2015-05-22 23:01:28 +02:00
Sam Brannen
347264e4d9 Add "Testing Improvements" to new-in-4.2 section 2015-05-22 22:53:31 +02:00
Brian Clozel
9e6494eef6 Reinstate WebContentGenerator.checkAndPrepare variant
Reinstate a variant of the `WebContentGenerator.checkAndPrepare` method
for projects that are using it.

This variant is now marked as deprecated.

Issue: SPR-11792
2015-05-22 22:31:56 +02:00
Sam Brannen
bd787769be Introduce "synthesizable" cache in AnnotationUtils
Issue: SPR-11512
2015-05-22 21:40:36 +02:00
Sam Brannen
2e4dabb349 Polishing 2015-05-22 21:37:50 +02:00
Rossen Stoyanchev
bbd3f902d0 Fix failing tests 2015-05-22 14:14:20 -04:00
Rossen Stoyanchev
c48e8708a7 Fix NPE in DefaultSimpUserRegistry 2015-05-22 13:44:09 -04:00
Rossen Stoyanchev
92bd7bba50 Restore userSessionRegistry field in StompSubProtocolHandler
This change ensures that the deprecated UserSessionRegistry is still
used if configured.
2015-05-22 13:44:09 -04:00
Sam Brannen
3a2da3f701 Polish and reorganize new-in-4.2 section 2015-05-22 17:54:10 +02:00
Sam Brannen
73170224c9 Polish annotation utility tests 2015-05-22 17:46:34 +02:00
Andy Clement
91ed5b6b8c SpEL: ensure correct object used for nested #this references
Before this commit the object that #this would refer to in
nested expressions within projection/selection clauses was always
the root context object. This was incorrect as it should be the
element being projected/selected over. This commit introduces
a scope root context object which is set upon entering a new
scope (like when entering a projection or selection). Any
object. With this change this kind of expression now behaves:

where #this is the element of list1. Unqualified references
are also resolved against this scope root context object.

Issues: SPR-10417, SPR-12035, SPR-13055
2015-05-22 08:07:09 -07:00
Stephane Nicoll
5a3eea8adb Update what's new section 2015-05-22 16:54:14 +02:00
Sam Brannen
e7ea92561d Verify that SynthesizedAnnotation must be public
This commit introduces a test that will fail if SynthesizedAnnotation is
not public as is required by the contract for getProxyClass() in
java.lang.reflect.Proxy.

Issue: SPR-13057
2015-05-22 16:42:26 +02:00
Sam Brannen
ca09b1ff20 Introduce putIfAbsent() in AnnotationAttributes
Issue: SPR-13060
2015-05-22 15:52:49 +02:00
Rossen Stoyanchev
18946c829f Upgrade to Reactor 2.0.2 2015-05-22 09:24:02 -04:00
Rossen Stoyanchev
0db216daab Polish 2015-05-22 09:06:18 -04:00
Juergen Hoeller
fee63fdfb8 Message listener containers only call Session.recover() in client acknowledge mode
Issue: SPR-13056
2015-05-22 12:16:59 +02:00
Sebastien Deleuze
5255e7ae21 Support CompletableFuture in @MessageMapping handler methods
Issue: SPR-12207
2015-05-22 11:30:56 +02:00
Sebastien Deleuze
d3db99c201 Support ListenableFuture in @MessageMapping handler methods
This commit introduces support for asynchronous return values thanks
to the new AsyncHandlerMethodReturnValueHandler interface. Out of
the box support for ListenableFuture is also provided.

Issue: SPR-12168
2015-05-22 11:29:13 +02:00
Juergen Hoeller
792b7b9d11 ByteBufferConverter explicitly declares applicability to byte[]
Includes an optimization for simple ByteBuffer duplication.

Issue: SPR-13056
2015-05-22 11:19:17 +02:00
Stephane Nicoll
2dc674f356 Restore AbstractPropertyAccessor
Commit 3d86f15 added a lot of new feature in AbstractPropertyAccessor
shared by both DirectFieldAccessor and BeanWrapperImpl. This makes this
abstract class harder to implement for others having simpler use cases.

It turns that Spring Data has such use case; this commit split these new
features in a dedicated new base class, leaving AbstractPropertyAccessor
untouched.

Issue: SPR-12805
2015-05-22 10:33:28 +02:00
Stephane Nicoll
27c435c4ea Polish 2015-05-22 10:28:40 +02:00
Stephane Nicoll
39b2fbbccf Make SynthetizedAnnotation public
Enable public visibility on SynthetizedAnnotation to allow annotation
outside its package to be proxied properly. This commit is pending a
unit test that actually reproduces the problem.

Issue: SPR-13057
2015-05-22 10:21:23 +02:00
Sam Brannen
4549d76fbe Merge from sbrannen/SPR-11512
* SPR-11512:
  Support annotation attribute aliases and overrides via @AliasFor
2015-05-22 00:07:51 +02:00
Sam Brannen
ca66e076d1 Support annotation attribute aliases and overrides via @AliasFor
This commit introduces first-class support for aliases for annotation
attributes. Specifically, this commit introduces a new @AliasFor
annotation that can be used to declare a pair of aliased attributes
within a single annotation or an alias from an attribute in a custom
composed annotation to an attribute in a meta-annotation.

To support @AliasFor within annotation instances, AnnotationUtils has
been overhauled to "synthesize" any annotations returned by "get" and
"find" searches. A SynthesizedAnnotation is an annotation that is
wrapped in a JDK dynamic proxy which provides run-time support for
@AliasFor semantics. SynthesizedAnnotationInvocationHandler is the
actual handler behind the proxy.

In addition, the contract for @AliasFor is fully validated, and an
AnnotationConfigurationException is thrown in case invalid
configuration is detected.

For example, @ContextConfiguration from the spring-test module is now
declared as follows:

    public @interface ContextConfiguration {

        @AliasFor(attribute = "locations")
        String[] value() default {};

        @AliasFor(attribute = "value")
        String[] locations() default {};

        // ...
    }

The following annotations and their related support classes have been
modified to use @AliasFor.

- @ManagedResource
- @ContextConfiguration
- @ActiveProfiles
- @TestExecutionListeners
- @TestPropertySource
- @Sql
- @ControllerAdvice
- @RequestMapping

Similarly, support for AnnotationAttributes has been reworked to
support @AliasFor as well. This allows for fine-grained control over
exactly which attributes are overridden within an annotation hierarchy.
In fact, it is now possible to declare an alias for the 'value'
attribute of a meta-annotation.

For example, given the revised declaration of @ContextConfiguration
above, one can now develop a composed annotation with a custom
attribute override as follows.

    @ContextConfiguration
    public @interface MyTestConfig {

        @AliasFor(
           annotation = ContextConfiguration.class,
           attribute = "locations"
        )
        String[] xmlFiles();

        // ...
    }

Consequently, the following are functionally equivalent.

- @MyTestConfig(xmlFiles = "test.xml")
- @ContextConfiguration("test.xml")
- @ContextConfiguration(locations = "test.xml").

Issue: SPR-11512, SPR-11513
2015-05-22 00:01:07 +02:00
Stephane Nicoll
a87d5f8a63 Make PropertyMatches public
Issue: SPR-13054
2015-05-21 20:16:20 +02:00
Stephane Nicoll
6fb3190353 Fix regression with binding and validation
Previously, the binding may have to call the getter first to retrieve the
old value of a property before actually setting it. This was guarded by
a catch block that was accidentally removed in 3d86f15

Restore that catch block and add a test to cover it.

Issue: SPR-12805
2015-05-21 17:48:11 +02:00