Commit Graph

12048 Commits

Author SHA1 Message Date
Rossen Stoyanchev 1e003a1c90 Remove unnecessary assertion
Issue: SPR-14279
2016-05-18 10:57:54 -04:00
Rossen Stoyanchev 4a81aaba6c Fix STOMP connect failure related memory leak
Normally heartbeats keep connections from hanging. However in some
cases a connection may hang before a CONNECTED frame is received
and heartbeats are put in place. This commit adds a change to enforce
a 60 limit on receiving the CONNECTED frame.

Issue: SPR-14266
2016-05-12 11:24:50 -04:00
Stephane Nicoll 8c79f23175 Merge pull request #1052 from ferstl:fix-javadoc-example
* pr/1052:
  Fix CacheManager example in Javadoc
2016-05-12 15:24:03 +02:00
Stefan Ferstl d651ebfd2d Fix CacheManager example in Javadoc
Closes gh-1052
2016-05-12 15:23:40 +02:00
Juergen Hoeller c15f27cfa8 Avoid package import cycle through explicit javadoc reference 2016-05-06 13:41:02 +02:00
Stephane Nicoll 66bab2a9fc Revert "Manage asynchronous EventListener with replies"
This reverts commit bee1b77af5.
2016-05-06 13:38:03 +02:00
Juergen Hoeller 5682950289 Polishing 2016-05-06 12:03:10 +02:00
Juergen Hoeller 42d32ba396 ResourceRegion fits better in core.io.support (next to EncodedResource)
Issue: SPR-14221
2016-05-06 12:02:51 +02:00
Juergen Hoeller e5dbe12e85 ResourceHttpRequestHandler sets "Accept-Ranges" header only once
Issue: SPR-14221
2016-05-06 11:50:47 +02:00
Juergen Hoeller 1b1aac9172 Unit tests for AsyncResult callback behavior
Issue: SPR-14249
2016-05-05 20:40:30 +02:00
Juergen Hoeller 5400bb9110 ListenableFutureAdapter keeps propagating onSuccess/onFailure exceptions
Issue: SPR-13785
2016-05-05 20:39:53 +02:00
Juergen Hoeller 7dc181261e Polishing 2016-05-05 20:35:34 +02:00
Sam Brannen a1a87679da Support test annotations on interfaces
Prior to Java 8 it never really made much sense to author integration
tests using interfaces. Consequently, the Spring TestContext Framework
has never supported finding test-related annotations on interfaces in
its search algorithms.

However, Java 8's support for interface default methods introduces new
testing use cases for which it makes sense to declare test
configuration (e.g., @ContextConfiguration, etc.) on an interface
containing default methods instead of on an abstract base class.

This commit ensures that all non-repeatable, class-level test
annotations in the Spring TestContext Framework can now be declared on
test interfaces. The only test annotations that cannot be declared on
interfaces are therefore @Sql and @SqlGroup.

Issue: SPR-14184
2016-05-05 19:54:44 +02:00
Andy Clement a31f0bb3c0 Fix compilation of expressions using instanceof and primitives
Prior to this commit the SpEL compiler would generate bad bytecode
if the left hand operand of an instanceof was a primitive or
if the right hand operand was a primitive type reference.
With the fixes primitives on the left hand side are now
correctly boxed and special handling is in place for when the
right hand side is a primitive type reference. Using a primitive
type reference on the right always causes the instanceof
check to return false.

Additionally a guard has been added such that compilation is
not allowed when the right hand side of an expression
is not a type reference. If it is, for example, a variable
reference that evaluates to a type reference then that
cannot be expressed in bytecode so compilation is not performed.

Issue: SPR-14250
2016-05-05 09:57:15 -07:00
Brian Clozel 3c92ddc94b Fix path matching for paths containing spaces
Prior to this commit, the latest optimizations introduced in SPR-13913
would prevent matching when patterns contained spaces. Indeed, the
optimized path would not fully tokenize the paths nor trim the tokens,
as the "longer" code path does.

This commit disables this optimized path when the `trimTokens` option is
set to `true`.

Also, the `trimTokens` setting is now set to `false` by default.

Issue: SPR-14247
2016-05-04 22:28:06 +02:00
Juergen Hoeller 3f85efe107 Latest dependency updates (EhCache 2.10.2, HtmlUnit 2.21, JOpt Simple 5.0.1, JRuby 1.7.25, Quartz 2.2.3, Undertow 1.3.22) 2016-05-04 18:17:16 +02:00
Juergen Hoeller 08ddd1b3bc AbstractRequestLoggingFilter ignores non-available query string
Issue: SPR-14244
2016-05-04 18:17:06 +02:00
Juergen Hoeller 8c139ef444 Polishing 2016-05-04 17:37:30 +02:00
Juergen Hoeller ab478d14fa ScheduledAnnotationBeanPostProcessor tracks individual bean instances of any scope
Issue: SPR-12216
Issue: SPR-12872
2016-05-04 17:06:08 +02:00
Juergen Hoeller 162aedccbe Polishing 2016-05-04 17:02:16 +02:00
Sam Brannen f09c7868d8 Polishing 2016-05-04 16:04:37 +02:00
Juergen Hoeller e6e3ca3e96 LazySingletonAspectInstanceFactoryDecorator uses shared singleton mutex
Issue: SPR-14241
2016-05-04 09:03:28 +02:00
Sam Brannen e26478e3de Polish Javadoc regarding @Commit support 2016-05-03 20:26:11 +02:00
Sam Brannen 7b13311f03 Delete unused imports 2016-05-03 20:12:37 +02:00
Sam Brannen 6b3eba0500 Suppress warnings in Gradle build 2016-05-03 19:56:33 +02:00
Sam Brannen 64c388d524 Properly document avoiding false positives when testing with JPA
Prior to this commit, information regarding avoiding false positives
when testing with JPA had already been added to the Testing chapter of
the reference manual. However, the example did not work properly and
the accompanying text mixed concepts from Hibernate and JPA.

This commit fixes the @Autowired/@PersistenceContext bug, updates the
text, and marks each test as @Transactional in order to avoid any
misinterpretation.

Issue: SPR-9032
2016-05-03 19:33:32 +02:00
Sam Brannen 0f6711fe3b Support @[Before|After]Transaction on default methods
Prior to this commit, @BeforeTransaction and @AfterTransaction could
only be declared on methods within test classes. However, JUnit 5 as
well as some existing third-party Runner implementations for JUnit 4
already support Java 8 based interface default methods in various
scenarios -- for example, @Test, @BeforeEach, etc.

This commit brings the Spring TestContext Framework up to date by
supporting the declaration of @BeforeTransaction and @AfterTransaction
on interface default methods.

Issue: SPR-14183
2016-05-03 18:57:31 +02:00
Sam Brannen 7ce5ba4a3f Refer explicitly to JUnit 4 in the testing chapter
This commit updates the Testing chapter in the reference manual to
refer explicitly to JUnit 4 instead of just "JUnit" (where appropriate)
in order to avoid confusion with forthcoming support for JUnit 5.
2016-05-03 18:57:31 +02:00
Sam Brannen 3433fe35df Fix assertion failure messages in TransactionalTestExecutionListenerTests 2016-05-03 18:57:31 +02:00
Juergen Hoeller 52e5b4a6ff Polishing 2016-05-03 18:55:39 +02:00
Juergen Hoeller 76964e16ef Explicit note on Java deserialization 2016-05-03 18:44:37 +02:00
Rossen Stoyanchev 46e41a9d94 Consolidate SendTo vs SendToUser detection
SendTo and SendToUser are treated as mutually exclusive. The addition of
type-level support in 4.3. RC1 however did not consider the possibility
to mix and match of the two betwee type and method level.

This commit consolidates the detection of SendTo and SendToUser
annotations and considers them all together.

Issue: SPR-14238
2016-05-03 12:34:19 -04:00
Brian Clozel 05b29a4a17 Add convenient getters for force*Encoding attributes
Issue: SPR-14240
2016-05-03 16:14:09 +02:00
Brian Clozel 76ee46847a Selectively force encoding in CharacterEncodingFilter
Prior to this commit, setting the `forceEncoding` option would force
encoding on both requests and responses.

This commit adds two new setters and a new constructor to differentiate
both options: forcing the encoding on the request and/or on the
response.

You can now define this filter programmatically using those options or
update your servlet XML configuration like:

```
<filter>
  <filter-name>characterEncodingFilter</filter-name>
  <filter-class>o.sf.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
     <param-name>encoding</param-name>
     <param-value>UTF-8</param-value>
  </init-param>
  <init-param>
    <param-name>forceRequestEncoding</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>forceResponseEncoding</param-name>
    <param-value>false</param-value>
  </init-param>
</filter>

```

Issue: SPR-14240
2016-05-03 14:47:22 +02:00
Juergen Hoeller 1be544f8fa JtaTransactionManager explicitly resets transaction timeout after completion
Issue: SPR-14239
2016-05-03 13:30:51 +02:00
Brian Clozel 5ac31fb39d Refactor HTTP Range support with ResourceRegion
Prior to this commit, the `ResourceHttpMessageConverter` would support
all HTTP Range requests and `MethodProcessors` would "wrap" controller
handler return values with a `HttpRangeResource` to support that use
case in Controllers.

This commit refactors that support in several ways:
* a new ResourceRegion class has been introduced
* a new, separate, ResourceRegionHttpMessageConverter handles the HTTP
range use cases when serving static resources with the
ResourceHttpRequestHandler
* the support of HTTP range requests on Controller handlers has been
removed until a better solution is found

Issue: SPR-14221, SPR-13834
2016-05-02 19:00:52 +02:00
Juergen Hoeller 7737c3c7e5 Warn about non-static BeanDefinitionRegistryPostProcessor declarations on @Configuration classes
Issue: SPR-14234
2016-05-02 15:19:05 +02:00
Juergen Hoeller cbc46760b7 Upgrade to Jackson 2.7.4 2016-05-02 13:54:57 +02:00
Juergen Hoeller 07ea3745c4 Polishing 2016-05-02 13:54:47 +02:00
Stephane Nicoll 09b45d2c0f Validate callback is always invoked in DMLC#stop
The underlying issue has been fixed in e45d33f and this commit is merely
adding a test of the expected behaviour.

Issue: SPR-14233
2016-05-02 13:33:05 +02:00
Juergen Hoeller f83cbff543 Consistent SmartLifecycle implementations
Issue: SPR-14233
2016-05-02 13:01:44 +02:00
Juergen Hoeller e45d33f9de DefaultMessageListenerContainer immediately invokes stop callback when not running
Issue: SPR-14233
2016-05-02 12:57:30 +02:00
Brian Clozel 29da44c8dc Support ETags with special chars in ServletWebRequest
This commit makes sure that HTTP request headers containing ETag values
are properly parsed and not simply tokenized using a "," separator.
Indeed, ETags can legally contain separator characters such as " " and
",".

Issue: SPR-14216
2016-04-29 11:20:29 +02:00
Juergen Hoeller fdb31cd715 Check actual cache value for unwrapped Optional
Issue: SPR-14230
2016-04-29 10:56:26 +02:00
Rossen Stoyanchev bd40a93604 Ensure Environment.shutdown() in Reactor2TcpClient
Issue: SPR-14229
2016-04-28 17:47:59 -04:00
Juergen Hoeller 240f254bfc Allow @Cacheable method to return java.util.Optional variant of cached value
Includes renaming of internal delegate to CacheOperationExpressionEvaluator.

Issue: SPR-14230
2016-04-28 23:16:43 +02:00
Rossen Stoyanchev 220711d45b Reactor2TcpClient cleans up TcpClient instances
Issue: SPR-14231
2016-04-28 15:27:53 -04:00
Brian Clozel 977840884b Allow custom instances of WebJarAssetLocator
This commit allows to configure a custom WebJarAssetLocator in
WebJarResourceResolvers.

Issue: SPR-14092
2016-04-28 19:02:04 +02:00
Brian Clozel 55dae618a6 Improve multi-valued HTTP headers support
Prior to this change, getting header values with `HttpHeaders` when
headers are multi-valued would cause issues.
For example, for a given HTTP message with headers:
    Cache-Control: public, s-maxage=50
    Cache-Control: max-age=42

Getting a `List` of all values would return <"public", "s-maxage=50">
and getting the header value would return "public, s-maxage=50".

This commit takes now into account multi-valued HTTP headers and adds
new getters/setters for "If-Match" and "If-Unmodified-Since" headers.

Note that for ETag-related headers such as "If-Match" and
"If-None-Match", a special parser has been implemented since ETag values
can contain separator characters.

Issue: SPR-14223, SPR-14228
2016-04-28 18:48:47 +02:00
Sebastien Deleuze 15138ed96f Revisit ScriptTemplateView resource loading
Resources are now retrieved using the application context in order to
support natively non-classpath locations like /WEB-INF/...

As a consequence of this refactoring, ScriptTemplateView#createClassLoader()
protected method as been removed, since it did not make sense anymore with
this new resource loading implementation.

Issue: SPR-14210
2016-04-28 15:40:14 +02:00