Commit Graph

9114 Commits

Author SHA1 Message Date
Sebastien Deleuze
7ea69fb96c Improve ResolvableType.hashCode() for better performance
Prior to this commit, when there was a lot of entries in the
ResolvableType.cache HashMap, getting a simple value could
take a lot of time due to a lot of calls to ResolvableType.equals().
ResolvableType.equals() used this.type, getSource(),
this.variableResolver.getSource() and this.componentType, but
ResolvableType.hashCode() used only this.type.

With this commit, ResolvableType.hashCode() now uses the same
fields than ResolvableType.equals().

Performance on the spring-resolvabletype-benchmark project:
 - 8000 us before this commit
 - 120 us with this commit

Issue: SPR-12122
2014-08-27 10:35:22 +02:00
Sam Brannen
d5c6bcb901 How to register MIME types in MockServletContext
Prior to this commit, it was unclear that it was possible to register
custom MIME types when using MockServletContext.

This commit updates the Javadoc for MockServletContext.getMimeType()
with an example of how to achieve this using the MimetypesFileTypeMap
from the Java Activation Framework.

Issue: SPR-12126
2014-08-27 00:23:01 +02:00
Sam Brannen
2f2fe9bd05 Verify custom MIME type support in MockServletContext 2014-08-26 23:54:02 +02:00
Sam Brannen
07629a3c7c Include ALL source artifacts in published sources jars
This commit updates the Gradle build to ensure that *all* source
artifacts are including in published 'sources' jars.

To achieve this, we are now assembling 'sources' jars from
'sourceSets.main.allSource' and not explicitly including or excluding
anything by default.

Issue: SPR-12085
2014-08-26 16:38:57 +02:00
Rossen Stoyanchev
8f715a8547 Allow configuration of custom redirect patterns
This change enables the ability to configure
ViewNameMethodReturnValueHandler & ModelAndViewMethodReturnValueHandler
with patterns to use to test for a custom redirect view name.

Issue: SPR-12054
2014-08-25 16:18:09 -04:00
Rossen Stoyanchev
2a0765e76d Allow setting SockJsMessageCodec in WebSocket config
Issue: SPR-12091
2014-08-25 15:19:50 -04:00
Stephane Nicoll
15f496bc2a Document environment abstraction
This commit replace the two empty "chapters" dedicated to profiles
and property source to an 'Environment abstraction' chapter that
covers both.

Issue: SPR-12107
2014-08-25 15:26:26 +02:00
Sam Brannen
2963fd9e5a Fix broken Javadoc link in @TestPropertySource 2014-08-24 18:12:38 +02:00
Juergen Hoeller
820a160578 Polishing 2014-08-23 01:57:52 +02:00
Juergen Hoeller
078f23d6e6 Polishing 2014-08-23 01:07:01 +02:00
Juergen Hoeller
b93dd95475 Polishing 2014-08-22 22:55:57 +02:00
Juergen Hoeller
28a966f544 MessageBuilder avoids intermediate HashMap for MessageHeaders building
Issue: SPR-11468
2014-08-22 22:55:48 +02:00
Juergen Hoeller
786fd927fa DispatcherServlet's checkMultipart detects wrapped MultipartRequest as well
Issue: SPR-12114
2014-08-22 16:46:36 +02:00
Juergen Hoeller
439ce4a1a5 Polishing
Issue: SPR-12112
2014-08-22 14:00:28 +02:00
Juergen Hoeller
9dfbc5326b Revised ResourcePropertySource in order to avoid ConfigurationClassProcessor's AnnotationPropertySource subclass
Issue: SPR-12115
2014-08-22 13:54:39 +02:00
Arjen Poutsma
dbe337f932 ResponseEntity provides static "badRequest()" convenience method as well
Issue: SPR-12112
2014-08-22 13:36:45 +02:00
Phillip Webb
5ba3db6a7d Fix failing CompositePropertySourceTests
Fix CompositePropertySourceTests which fails when run we debug logging.
2014-08-21 21:57:22 -07:00
Phillip Webb
84564a0c7b Rework @PropertySource early parsing logic
Rework the @PropertySource parsing logic recently changed in commit
7c608886 to deal with the same source appearing on a @Configuration
class and an @Import class.

Processing now occurs in a single sweep, with any previously added
sources being converted to a CompositePropertySource.

Issue: SPR-12115
2014-08-21 21:21:15 -07:00
Juergen Hoeller
b73c531527 PropertySource implementations perform conversion to String arrays via StringUtils (getting rid of EMPTY_NAMES_ARRAY) 2014-08-21 22:46:33 +02:00
Juergen Hoeller
7c6088861f @PropertySource gets parsed as early as possible
Other PropertySources and in particular @ComponentScan can benefit from previously declared property sources on the same configuration class.

Issue: SPR-12110
Issue: SPR-12111
2014-08-21 22:43:08 +02:00
Juergen Hoeller
86c5880888 Polishing 2014-08-21 18:41:23 +02:00
Juergen Hoeller
11805b6a5d ServerEndpointExporter can initialize itself based on a late-provided ServletContext as well (for Boot)
Also allows for direct setting of a ServerContainer and for custom triggering of endpoint registration.

Issue: SPR-12109
2014-08-21 18:40:35 +02:00
Juergen Hoeller
60e58a2012 Polishing 2014-08-21 14:29:14 +02:00
Juergen Hoeller
8eac87064d AbstractAutowireCapableBeanFactory avoids synchronization in filterPropertyDescriptorsForDependencyCheck
Issue: SPR-12106
2014-08-21 14:26:17 +02:00
Juergen Hoeller
a000dd782a ReloadableResourceBundleMessageSource uses ConcurrentHashMaps and ReentrantLocks instead of synchronization
Issue: SPR-10500
2014-08-21 14:24:28 +02:00
Stephane Nicoll
f5cf3cd56e polishing 2014-08-21 10:14:41 +02:00
Sam Brannen
79c75df088 Updated copyright date range 2014-08-20 23:53:25 +02:00
Sam Brannen
b5216c5165 Merge pull request #624 from leizhiyuan/master
Stop using deprecated JdbcTemplate.queryFor*() methods
2014-08-20 23:48:17 +02:00
Stephane Nicoll
5b1341f4b5 Fix String equality
Issue: SPR-12105
2014-08-20 17:40:36 +02:00
Juergen Hoeller
b5763fe326 Consistent attribute documentation/formatting in spring-context and spring-mvc schemas 2014-08-20 16:36:12 +02:00
Juergen Hoeller
662d8aa9f1 util:properties supports multiple resource locations and ignore-resource-not-found
Issue: SPR-10614
2014-08-20 16:31:54 +02:00
Juergen Hoeller
e48c315ad1 DefaultSingletonBeanRegistry performs non-synchronized checks for existing entries in dependentBeanMap and containedBeanMap
Also adding alias resolution to isDependent's algorithm (for circular dependency detection).

Issue: SPR-8834
Issue: SPR-7966
2014-08-20 12:02:16 +02:00
Juergen Hoeller
592e344191 PersistenceAnnotationBeanPostProcessor defensively handles BeanDefinition access for extended EntityManagers
Issue: SPR-8834
2014-08-20 11:14:51 +02:00
Juergen Hoeller
9d3d6d5919 DefaultListableBeanFactory defensively handles BeanDefinition access in getBean(Class)
Issue: SPR-10542
2014-08-20 10:48:35 +02:00
Juergen Hoeller
891335a604 FlashMap's equals implementation needs to call super.equals(...) as well 2014-08-19 23:29:12 +02:00
Juergen Hoeller
af6ef5f74c Use ConcurrentMap declarations when calling putIfAbsent (for compatibility with JDK 6 and 7)
Issue: SPR-12102
2014-08-19 23:28:42 +02:00
Juergen Hoeller
781a6d289e CachedIntrospectionResults uses putIfAbsent where possible (for minimal write locking)
Issue: SPR-12102
2014-08-19 22:50:54 +02:00
Rossen Stoyanchev
1ca0460534 Add equals/hashcode to FlashMap
Brings consistency with the existing compareTo implementation.
2014-08-19 16:00:55 -04:00
Rossen Stoyanchev
bb8be509cd Remove return statements in finally blocks 2014-08-19 15:27:59 -04:00
Rossen Stoyanchev
0e49040707 Fix hashcode/equals issue in HeadersRequestCondition 2014-08-19 15:16:41 -04:00
Juergen Hoeller
5cd1e6aff4 Upgrade to Apache HttpComponents HttpClient 4.3.5 and HttpAsyncClient 4.0.2
Issue: SPR-12100
2014-08-19 20:54:22 +02:00
Juergen Hoeller
759f430ba5 StatementCreatorUtils avoids direct calls with SQL type argument in case of Types.OTHER
Issue: SPR-8571
2014-08-19 20:52:54 +02:00
Juergen Hoeller
8c76381d95 PathMatchingResourcePatternResolver supports "classpath*" searches in jar file roots as well
Issue: SPR-12095
2014-08-19 20:34:45 +02:00
Juergen Hoeller
0c32d66cbd ShallowEtagHeaderFilter supports Servlet 3.1's setContentLengthLong as well
Issue: SPR-12097
2014-08-19 20:17:42 +02:00
Sam Brannen
110be33337 Honor Host header for server name/port in MckHtSrvRq
Prior to this commit, the getServerName() and getServerPort() methods
in MockHttpServletRequest simply returned the 'mocked' serverName and
serverPort but ignored the 'Host' header entirely. Per the Servlet
specification, however, these methods must parse the server name or
port from the 'Host' header if it is present and otherwise fall back to
the resolved server name or port.

This commit fixes this by ensuring that getServerName() and
getServerPort() properly parse the server's name or port from the
'Host' header if it is present in the request. If the 'Host' header is
not present, MockHttpServletRequest falls back to returning the
'mocked' serverName and serverPort.

Issue: SPR-12088
2014-08-19 00:08:09 +02:00
Juergen Hoeller
51e4b07856 JamonPerformanceMonitorInterceptor tracks exceptions as well (consistent with JAMon's other interceptors)
Issue: SPR-12068
2014-08-18 21:50:24 +02:00
Juergen Hoeller
c65a82a32d Polishing 2014-08-18 21:25:38 +02:00
Juergen Hoeller
a2e6b56dd0 SchedulerAccessorBean falls back to finding a default Scheduler bean by type
Issue: SPR-12094
2014-08-18 21:23:29 +02:00
Juergen Hoeller
2ef3d66c89 Polishing 2014-08-18 19:27:08 +02:00
Juergen Hoeller
0d0d7139ee Convenient EhCache CacheManager bootstrapping within @Bean methods
Also introducing default CacheManager setup for EhCacheCacheManager, analogous to JCacheCacheManager.

Issue: SPR-12093
2014-08-18 19:25:40 +02:00