Commit Graph

8704 Commits

Author SHA1 Message Date
Juergen Hoeller 2c0c081bbb AnnotationUtils defensively catches and logs unexpected exceptions from retrieval attempts (proceeding like the annotation wasn't there)
Issue: SPR-11874
2014-06-24 13:36:04 +02:00
Juergen Hoeller fd809cd18e AnnotationUtils defensively catches unexpected exceptions from retrieval attempts (proceeding like the annotation wasn't there)
This is analogous to what the JVM does for cases where the annotation type itself isn't present on the classpath. We're effectively extending that policy to values referenced within an annotation declaration.

Issue: SPR-11874
2014-06-24 11:01:37 +02:00
Sam Brannen f1517f03ff Delete remaining SimpleJdbcTemplate usage
This commit deletes all remaining usage of the deprecated
SimpleJdbcTemplate class within the framework itself.

Issue: SPR-11895
2014-06-22 15:40:41 +02:00
Sam Brannen 0c1249fe42 Introduce repeatable @Sql tests
This commit introduces explicit integration tests that verify Java 8's
@Repeatable support for the @Sql annotation.

Issue: SPR-7655
2014-06-20 14:37:45 +02:00
Sam Brannen abdb010fc8 Rename SQL script annotations in the TCF
Prior to this commit, SQL script annotations and related classes in the
TestContext framework (TCF) were named DatabaseInitializer*. However,
these annotations are not used only for initialization and are
therefore misleading when used for cleaning up the database.

This commit refines the names of annotations and related classes for
configuring SQL scripts to be executed for integration tests in the TCF
as follows:

- @DatabaseInitializer -> @Sql
- @DatabaseInitializers -> @SqlGroup
- DatabaseInitializerTestExecutionListener -> SqlScriptsTestExecutionListener

A special thanks goes out to the following attendees of the Zurich
Hackergarten meeting last night for their collective brainstorming:
@aalmiray, @atsticks, @ollin, @simkuenzi, @tangresh, @vyazelenko.

Issue: SPR-7655
2014-06-20 14:33:23 +02:00
Juergen Hoeller d801f9da89 ResourceUtils isFileURL detects "vfsfile" as a file system protocol (again)
Issue: SPR-11887
2014-06-20 01:03:01 +02:00
Juergen Hoeller dfc370c368 PathMatchingResourcePatternResolver's findPathMatchingResources needs to check for VFS before checking isJarResource
Issue: SPR-11887
2014-06-19 23:09:12 +02:00
Juergen Hoeller 03f3412434 WebSphereUowTransactionManager exposes SmartTransactionObject
Issue: SPR-11876
2014-06-19 22:30:10 +02:00
Juergen Hoeller 6f68b034ca MBeanExportConfiguration's SpecificPlatform properly calls afterPropertiesSet
Also makes the nested SpecificPlatform enum public for Spring Boot to reuse it.

Issue: SPR-11877
2014-06-19 22:24:04 +02:00
Juergen Hoeller ab5aea5a13 Defensively check javaUtilOptionalEmpty
Issue: SPR-11888
2014-06-19 21:25:46 +02:00
Juergen Hoeller bc1f19ce18 Defensively check javaUtilOptionalEmpty
Issue: SPR-11888
2014-06-19 21:14:43 +02:00
Brian Clozel cff36d68b1 update documentation with latest forum infos
Forums will be shortly deactivated and questions should take place
in StackOverflow.
2014-06-19 15:33:06 +02:00
Juergen Hoeller ef25b9e7af ObjectToOptionalConverter needs to be marked as @UsesJava8 2014-06-18 23:39:19 +02:00
Juergen Hoeller 88eabe874c Latest dependency updates (Jackson 2.4, Jetty 9.2.1, H2 1.4.178, Apache HttpClient 4.3.4) 2014-06-17 21:58:11 +02:00
Rossen Stoyanchev bb4a9cca1b Add suppress warning in SettableListenableFuture 2014-06-16 17:06:52 -04:00
Rossen Stoyanchev cf9d519e97 Merge pull request #504 from matsev/SPR-11614 2014-06-16 15:42:31 -04:00
Rossen Stoyanchev 0640a32863 Revise SettableListenableFuture implementation
This change modifies the SettableListenableFuture implementation to use
internally a ListenableFutureTask created with a "settable" Callable.

Issue: SPR-11614
2014-06-16 15:37:30 -04:00
Mattias Severson 38b525aa9e Created SettableListenableFuture with tests
A SettableListenableFuture implementation of Spring's ListenableFuture
The class is inspired by Google Guava’s
com.google.common.util.concurrent.SettableFuture, but this
implementation uses ReentrantReadWriteLock and CountDownLatch
internally to handle thread synchronization.

Issue: SPR-11614
2014-06-16 15:14:12 -04:00
Rossen Stoyanchev 0dc6082b01 Support java.util.Optional for @MVC named value args
After this change, java.util.Optional is supported with @RequestParam,
@RequestHeader, and @MatrixVariable arguments in Java 8. When Optional
is used the required flag is effectively ignored.

Issue: SPR-11829
2014-06-16 14:16:56 -04:00
Stephane Nicoll c2356e57c8 Merge pull request #562 from hengyunabc/master
* pull562:
  Improve StringUtils#trimAllWhitespace
2014-06-13 18:19:10 +02:00
hengyunabc 4d328d6188 Improve StringUtils#trimAllWhitespace
Prior to this commit, StringUtils#trimAllWhitespace(String str) was
unecessary slower. Using sb.deleteCharAt(index) leads to a complete
copy of the char[]
2014-06-13 18:18:19 +02:00
Sam Brannen 98a224fed9 Update Eclipse import script regarding AJDT 2014-06-12 14:04:54 +02:00
Brian Clozel 72baa9bf27 Ignore external resources in CssLinkResourceTransormer
Prior to this commit, the CssLinkResourceTransformer would transform
"external resources", i.e. resources not served by the web application.

This commit only allows transformation for resources which path don't
contain scheme such as "file://" or "http://". Only relative and
absolute paths for resources served by the webapp are valid.

Issue: SPR-11860
2014-06-12 10:54:41 +02:00
Brian Clozel e18e44980d Upgrade to Groovy 2.3.3
See release notes:
https://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10242&version=20415
2014-06-12 10:22:53 +02:00
Rossen Stoyanchev 9f4d4d1829 Check X-Forwarded-Host in ServletUriComponentsBuilder
Issue: SPR-11855
2014-06-11 22:40:48 -04:00
Rossen Stoyanchev c809143cc4 Upgrade to Undertow 1.0.15 and fix failing test
Issue: SPR-11777
2014-06-11 17:45:19 -04:00
Brian Clozel d746e3fbfa Rollback AntPathMatcher behavior for ".*" comparisons
Prior to this commit, AntPathMatcher had been refactored for SPR-6741.
During that process, a key feature has been removed:
When comparing two patterns, pattern elements (*, {}, etc) are counted
to score those patterns. When a pattern ends with ".*", the ending
wildcard should not be counted against pattern elements for this
pattern.

This commit reintroduces that behavior.

Issue: SPR-6741
2014-06-11 20:51:09 +02:00
Rossen Stoyanchev ce0473f926 Further encapsulate AntPatternComparator$PatternInfo
Issue: SPR-6741
2014-06-11 20:51:09 +02:00
Brian Clozel f829cd1b35 Fix "**" precedence in AntPathMatcher comparator
Prior to this commit, "**" and "*" pattern elements had
the same priority when comparing two patterns.
So when comparing several patterns, the computed order was:
1- /hotels/{hotel}/bookings/{booking}
2- /hotels/**
3- /hotels/{hotel}/bookings/{booking}/customer/{customer}

This commit updates the comparator so that patterns ending
with "**" (a.k.a "catch-all" patterns) are less specific than
the others; in the previous example, the 2nd pattern would
then end up last.

This commit also optimizes the comparator implementation.

Issue: SPR-6741
2014-06-11 20:51:09 +02:00
Brian Clozel 80a16c6d10 PathMatching options:configure all HandlerMappings
Since SPR-11486 and SPR-10163, Path Matching options can be configured
to customize path matching options for RequestMappingHandlerMapping.
Prior to this commit, the defined pathMatcher and pathHelper instances
were only used in RequestMappingHandlerMapping.

This commit now registers pathMatcher and pathHelper beans under
well-known names and share them with several HandlerMappings beans,
such as ViewControllerMappings and ResourcesMappings.

Issue: SPR-11753
2014-06-11 17:07:04 +02:00
Stephane Nicoll 014ea963fe Merge pull request #544 from kryger/patch-1
* patch-2:
  Fix method comment for getRequiredProperty(String)
2014-06-11 11:58:44 +02:00
Lukasz Kryger 0dc52a8343 Fix method comment for getRequiredProperty(String) 2014-06-11 11:56:58 +02:00
Stephane Nicoll 9ba9f562f2 Add @ComponentScan documentation
This commit provides a proper documentation for the @ComponentScan
annotation as a java config alternative to <context:component-scan/>

Issue: SPR-11846
2014-06-11 11:51:10 +02:00
Rossen Stoyanchev b214db3fc8 Rename HttpStatus 308 to Permanent Redirect
Issue: SPR-11854
2014-06-10 18:51:22 -04:00
Rossen Stoyanchev 6b129c52e3 Add "mvcUrl" function to Spring tag library
This commit adds a new function to the Spring tag library for preparing
links to @Controller methods. For more details see the Javadoc of
MvcUriComponentsBuilder.fromMappingName.

Issue: SPR-5779
2014-06-10 18:11:11 -04:00
Rossen Stoyanchev 2140648246 Fix failing test 2014-06-10 15:03:17 -04:00
Rossen Stoyanchev 5b02222a9f Add resolveTemplate method to Groovy markup configurer 2014-06-10 11:59:11 -04:00
Brian Clozel 0ecfa8e404 Add Spring View support for Groovy Markup Templates
This commit adds support for Groovy Markup templates.
Spring's support requires Groovy 2.3.1+.

To use it, simply create a GroovyMarkupConfigurer and a
GroovyMarkupViewResolver beans in the web application context.

Issue: SPR-11789
2014-06-10 11:37:53 -04:00
Stephane Nicoll 6b6b008c1f Fix typo
Issue: SPR-11862
2014-06-10 16:51:13 +02:00
Stephane Nicoll 5cc779ab35 Fix callout formatting issue 2014-06-10 10:58:05 +02:00
Stephane Nicoll d1c780f5b5 Merge pull request #551 from mdeinum/SPR-8045
* SPR-8045:
  polishing
  Using SmartLifecycle to register MBeans
2014-06-10 10:22:27 +02:00
Stephane Nicoll c7b106577f polishing
Reorganized class structure to match our code style (setter for
properties at the top of the class, public method before private
implementation).

Removed DisposableBean as it the lifecycle is already taking care
of removing MBeans on stop.

Cleaned test suite

Issue: SPR-8045
2014-06-10 10:13:58 +02:00
Marten Deinum 2ede219e66 Using SmartLifecycle to register MBeans
Prior to this commit, MBeans were registered in a post construct
call of MBeanExporter. This commit moves that logic after the
initialization phase using the SmartLifecycle callback.

Issue: SPR-8045
2014-06-10 10:13:58 +02:00
Rossen Stoyanchev fc91add35e Allow custom UrlPathHelper for WebSocket requests
Issue: SPR-117711
2014-06-09 17:42:43 -04:00
Rossen Stoyanchev 0cb6f8c88c Polish MappingJackson2JsonView 2014-06-09 09:39:17 -04:00
Sebastien Deleuze 5dc27ee134 Add JSONP support to MappingJackson2JsonView
Enable JSONP support by wrapping the JSON output into
a callback when a JSONP query parameter specifying the
function name to use as callback is detected.

Default query parameter names recognized as JSONP ones
are "jsonp" and "callback". This list can be customized if
needed.

This commit also fixes JSONView support by removing
the view name specified in the model from the output.

Issue: SPR-8346
2014-06-09 09:39:17 -04:00
Rossen Stoyanchev 56a82c1cbe Add dependency ordering for @ModelAttribute methods
Before this change @ModelAttribute methods were not invoked in any
particular order other than ensuring global @ControllerAdvice methods
are called first and local @Controller methods second.

This change introduces a simple algorithm that selects the next
@ModelAttribute method to invoke by making a pass over all methods and
looking for one that has no dependencies (i.e. @ModelAttribute
input arguments) or has all dependencies resolved (i.e. available in
the model). The process is repeated until no more @ModelAttribute
methods remain.

If the next @ModelAttribute method cannot be determined because all
remaining methods have unresolved dependencies, the first available
method is picked anyway just as before, i.e. with required
dependencies created through the default constructor.

Examples in ModelFactoryOrderingTests.

Issue: SPR-6299
2014-06-07 16:21:36 -04:00
Rossen Stoyanchev e374769ecc Polish ModelFactory 2014-06-07 16:21:35 -04:00
Sam Brannen f442ce180e Polish assertions and Javadoc for ResourceDatabasePopulator 2014-06-07 14:13:45 +02:00
Juergen Hoeller af4621d996 Reference documentation consistently refers to Apache HttpComponents instead of outdated Commons HttpClient
Includes overhaul of remaining references to J2SE and J2EE, consistently replacing them with "the JDK" and "Java EE".

Issue: SPR-11853
2014-06-07 00:29:09 +02:00