Commit Graph

9757 Commits

Author SHA1 Message Date
Craig Andrews 213a3fd779 Performance improvements in ShallowEtagHeaderFilter
Prior to this change, the ShallowEtagHeaderFilter would use a
ResizableByteArrayOutputStream to internally write data and calculate
the ETag. While that implementation is faster than the regular
ByteArrayOutputStream (since it has a better strategy for growing the
internal buffer), a lot of buffer copying/writing still happens.

This change adds a new FastByteArrayOutputStream implementation that
internally uses a LinkedList<Byte[]> to store the content. So when
writing bytes to that OutputStream implementation, new byte[] are
added to the list when the previous ones are full. This saves most
of the instantiating/copying operations.

Note that new methods were added in DigestUtils to allow usage of
Streams instead of byte[], which is more efficient in our case.

Fixes #653

Issue: SPR-12081
2015-01-08 16:08:09 +01:00
Sam Brannen 40cd1be14c Update Javadoc for AnnotationUtils.findAnnotation()
This commit updates the Javadoc for findAnnotation() to reflect recent
changes to the algorithm it implements.
2015-01-07 21:08:00 +01:00
Stephane Nicoll 34afe215fd Merge pull request #717 from johnktims/patch-1
* patch-1:
  Fix typo
2015-01-07 09:51:44 +01:00
John 46b094bfc4 Fix typo 2015-01-07 00:28:51 -05:00
Rossen Stoyanchev f59fc83f30 Remove STOMP relay integration test
The test was verifying that when a DISCONNECT frame is sent to the
broker, there will be no further messages on the clientOutboundChannel.

This is generally true, however in some cases when the broker receives
a DISCONNECT it may close its connection fast enough (before we do) in
which case we send an ERROR message downstream to ensure the WebSocket
side is cleaned up. Either way the downstream should be idempotent
with regards to cleaning up sessions.
2015-01-06 09:52:06 -05:00
Rossen Stoyanchev 8a47c181f7 Assign Jetty SockJS tests to "performance" test group
This change designates Jetty SockJS integration tests to run as part of
the "performance", but not the main "publication", CI build due to
recurring low-level failures suspected to be Jetty issues, e.g.
"java.io.IOException: Cannot append to finished buffer" or
"java.io.IOException: Out of order Continuation frame encountered".

The tests will still run at once a day with the performance build but
should not fail the main build with false negatives. Also note that
an Undertow variant of the exact same tests, which hasn't been failing,
will continue to run as part of the main build.
2015-01-06 09:43:54 -05:00
Stephane Nicoll bce145c06e Merged HttpClient defaults with local customizations
Update HttpComponents wrapper to merge local customizations with the
default of the current HttpClient instead of overriding everything.

This is available as from HttpComponents 4.4. that exposes the default
request config from the  client via the Configurable interface. If the
client does not implement such interface, the previous behaviour is
applied

Issue: SPR-12583
2015-01-05 14:28:47 +01:00
Stephane Nicoll 3662ad4f94 Upgrade to gradle 2.2.1
Issue: SPR-11934
2015-01-05 10:09:45 +01:00
Sam Brannen 4a49a6535d Document type safety limitations of the CollectionFactory API
Issue: SPR-12596
2015-01-04 22:48:15 +01:00
Sam Brannen 60cee7f526 Polish ExtendedBeanInfoTests regarding JDK 8u40 compatibility
This commit simplifies the test for greater clarify and swaps the
'expected' and 'actual' arguments passed to assertEquals().

Issue: SPR-12582
2015-01-02 16:02:04 +01:00
Juergen Hoeller 7492129236 Revised ExtendedBeanInfo test for SPR-8937 (for JDK 8u40 compatibility)
Issue: SPR-12582
2015-01-02 15:18:49 +01:00
Juergen Hoeller ec84fa6da3 ObjectToOptionalConverter uses Optional.ofNullable after ConversionService invocation
Issue: SPR-12589
2015-01-02 14:57:42 +01:00
Stephane Nicoll 6790f55667 Fix typo 2015-01-01 11:42:00 +01:00
Stephane Nicoll a79fe25917 Restore default transaction manager by name lookup
Fix a regression introduced by 961574bd17 that prevents a proper lookup
of the default transaction manager by name as the absence of a qualifier
is represented by an empty string (passing the faulty null check).

Issue: SPR-12577
2014-12-31 15:21:43 +01:00
Xiaolong Zuo 47b8ee891e Fix default HandlerMappings class names in javadoc
Fixes #708
2014-12-31 14:19:42 +01:00
Brian Clozel e02719e5e3 Fix path mapping issue in default servlet mode
Prior to this commit, some requests would be wrongly mapped to "/" when:

* requests ends with "//" such as "/foo/bar//"
* the DispatcherServlet is mapped as the default ("/")
* the app container sanitizes the servletPath

In those cases, the path extraction algorithm was wrongly guessing the
path of the current request.

This commit detects if the app container sanitized the servletPath for
the current request. If so, it uses a sanitized version of the
requestUri to extract the path information.

Issue: SPR-12372
2014-12-31 14:08:49 +01:00
Sam Brannen 40449e2741 Suppress warnings in tests
This commit suppresses warnings in test classes that were polluting the
Gradle build output.
2014-12-31 02:10:30 +01:00
Juergen Hoeller 27b4909f46 Polishing
(cherry picked from commit 8c700b1)
2014-12-30 21:11:56 +01:00
Juergen Hoeller 9ac02b319d Remove pre-3.2 deprecated classes and methods
Issue: SPR-12578
2014-12-30 20:05:15 +01:00
Juergen Hoeller fad76336f6 Polishing 2014-12-30 15:26:43 +01:00
Juergen Hoeller 730bd02da7 Polishing 2014-12-30 15:01:51 +01:00
Juergen Hoeller 3bfe4dcca7 Switch responseEncodedHtmlEscape default to true
Issue: SPR-12369
2014-12-30 15:01:20 +01:00
Juergen Hoeller 0a36559a43 Deprecate Tiles 2 support
Issue: SPR-12214
2014-12-30 14:59:50 +01:00
Juergen Hoeller d6b16ffee3 Remove deprecated SimpleJdbcTemplate and supporting classes
Issue: SPR-11895
2014-12-30 14:59:38 +01:00
Spring Buildmaster f8a483f2d4 Next Development Version 2014-12-30 02:58:50 -08:00
Juergen Hoeller 26845f6f7f Polishing
Issue: SPR-12502
2014-12-30 10:04:16 +01:00
Juergen Hoeller 1cefeb2af0 Prevent NPE in AbstractApplicationEventMulticaster's non-caching code path
Issue: SPR-12545
2014-12-30 10:01:58 +01:00
Rossen Stoyanchev 51367dec05 Refine condition to send WebSocket binary messages
The following two refinements have been added:
1) SockJS doesn't support binary messages so don't even try
2) don't bother if payload.length == 0

Issue: SPR-12475
2014-12-29 15:13:09 -05:00
Juergen Hoeller bc075c713f Polishing 2014-12-29 20:34:18 +01:00
Juergen Hoeller 3791e7f653 TimeZone and ZoneId as supported arguments for MVC handler methods
Issue: SPR-12575
2014-12-29 16:41:31 +01:00
Juergen Hoeller 86b8112c90 Polishing 2014-12-29 15:13:40 +01:00
Juergen Hoeller 6f2de283c4 Doc: base-packages can be comma/semicolon/space/tab/linefeed-separated
Issue: SPR-12523
2014-12-29 13:39:48 +01:00
Juergen Hoeller 0919a15f91 Spring's JMX support can rely on native MXBean detection on Java 6+
Issue: SPR-12574
2014-12-29 13:26:32 +01:00
Juergen Hoeller d4a5059097 AnnotationJmxAttributeSource uses AnnotationUtils for consistent meta-annotation handling and diagnostics
Issue: SPR-12572
2014-12-29 13:17:49 +01:00
Juergen Hoeller ed0e2f4445 PayloadArgumentResolver does not insist on configured Validator anymore
Issue: SPR-12567
2014-12-29 12:55:37 +01:00
Stephane Nicoll 752bbbdd05 Fix scope inheritance documentation
Issue: SPR-12570
2014-12-29 10:54:19 +01:00
Stephane Nicoll 73c21fbac1 Define JCache aspect
Align default aop.xml configuration to define the JCache aspect alongside
the regular Spring cache aspect.

 Issue: SPR-12571
2014-12-29 10:02:14 +01:00
Stephane Nicoll 71783c5d86 Allow default settings of a custom HttpClient to apply
Previously the default settings of a custom HttpClient were always
ignored since a RequestConfig instance was always set no matter if
some customizations were applied or not.

This commit keeps an internal RequestConfig object instance that is
only initialized if the user applies a customization. If he does not, the
default settings of the HttpClient are used as it should.

Note that if the HttpComponents API exposed the default RequestConfig
of a given HttpClient, we would be able to merge our customizations with
the one specified by the client. Unfortunately, such API does not exist
and the "defaultSettingsOfHttpClientLostOnExecutorCustomization" test
illustrates that limitation.

Issue: SPR-12540
2014-12-29 09:36:54 +01:00
Stephane Nicoll 961574bd17 Fix regression in determineTransactionManager
One more (and hopefully last) attempt at making sure
determineTransactionManager does not break existing use cases.

This commit prevents any lookup if no transaction attributes are set
which is more compliant with the original version and prevents a lookup
if a non existing bean name is provided explicitly (as it can be the case
with Spring Boot).

Issue: SPR-12541
2014-12-28 18:17:01 +01:00
Stephane Nicoll 4a0ac97550 Fix regression in determineTransactionManager
The fix in cec26e9 for SPR-12541 actually introduced a regression
when the interceptor is enabled on a method that does not require any
transaction. In such a case we try to locate the default
PlatformTransactionManager instead of just returning what we have (that
is null).

This commit updates the determineTransactionManager condition again to
take that use case into account again.

Issue: SPR-12541
2014-12-28 17:38:06 +01:00
Sebastien Deleuze a770b151d9 Specify SockJS protocol and client supported versions
In order to avoid breaking changed due to the upcoming SockJS 1.0
release (see SPR-12422 for more details) and link to the right
SockJS documentation version, we now explicitly specify that we
support SockJS protocol 0.3.3 and SockJS client 0.3.x.
2014-12-26 22:38:49 +01:00
Rossen Stoyanchev ea05e0b1ad Improve @SessionAttributes support during redirect
Before this change attributes listed with @SessionAttributes would not
be saved in the session when there was a redirect and the controller
method declared a parameter of type RedirectAttributes.

This change ensures it's the "default" model that is always the one
checked for @SessionAttributes under all circumstances since
RedirectAttributes is really only meant to provide String values to
insert into or append to the the redirect URL.

Issue: SPR-12542
2014-12-23 14:24:44 -05:00
Rossen Stoyanchev ea2943feca Polish ModelAndViewContainer and update tests 2014-12-23 14:24:43 -05:00
Rossen Stoyanchev 670974d76a Allow sending binary messages with STOMP
After this change the StompSubProtocolHandler sends STOMP frames
with content-type=octet-stream as a binary WebSocket message.

Issue: SPR-12475
2014-12-23 14:24:43 -05:00
Juergen Hoeller 6b3023c2aa HandlerExecutionChain prevents re-adding the interceptors array to the list (and declares varargs now)
Issue: SPR-12566
2014-12-23 18:27:49 +01:00
Juergen Hoeller d55af2b445 Consistent throwing of last UnsatisfiedDependencyException if available and no constructor resolved
Issue: SPR-12543
2014-12-23 17:35:11 +01:00
Stephane Nicoll cae217de94 Handle scoped proxy properly in MBeanExporter
Previously, if a bean has a scoped proxy and is annotated to be exposed
to the JMX domain, both the scoped proxy and the target instance were
exposed in the JMX domain, resulting in a duplicate entries. Worse, if
such bean defines an explicit name, the application wouldn't start
because of a name conflict.

This commit deals explicitely with scoped proxy and make sure to only
expose the relevant bean.

Issue: SPR-12529
2014-12-23 16:03:52 +01:00
Juergen Hoeller 809ee0d350 Annotation post-processors clear old InjectionMetadata registrations on refresh
Issue: SPR-12526
2014-12-23 14:02:00 +01:00
Juergen Hoeller dfdfc03ff3 Polishing 2014-12-22 20:02:25 +01:00
Juergen Hoeller fa138d2c70 ReflectionHelper's isFirstEntryInArray properly handles empty arrays
Issue: SPR-12522
2014-12-22 19:54:16 +01:00