Commit Graph

6915 Commits

Author SHA1 Message Date
Juergen Hoeller
b80dc9d642 Polishing
Issue: SPR-11262
(cherry picked from commit d628025)
2014-04-02 22:55:33 +02:00
Sam Brannen
b31750fafb Reinject Servlet mocks between TestNG test methods
Prior to this commit, if multiple test methods were executed in a
subclass of AbstractTestNGSpringContextTests annotated with
@WebAppConfiguration, then injected Servlet API mocks would only
reference the mocks created for the first test method. Subsequent test
methods could therefore never reference the current mocks, and there
was a discrepancy between the state of the injected mocks and the mock
set in the RequestContextHolder.

This commit addresses this issue by ensuring that dependencies
(including updated mocks) are injected into the test instance before
the next test method if the ServletTestExecutionListener resets the
request attributes in RequestContextHolder.

Issue: SPR-11626
(cherry picked from commit c38600762d)
2014-03-29 21:43:42 +01:00
Juergen Hoeller
a4a2e80f23 Consider a null ClassLoader (typically the bootstrap CL) as cache-safe
Issue: SPR-11606
2014-03-26 23:48:29 +01:00
Juergen Hoeller
e8c06c6d99 Consistent PropertyAccessor method order as declared in the interface
Issue: SPR-11609
(cherry picked from commit b70148c)
2014-03-26 21:57:40 +01:00
Juergen Hoeller
d8180e1e20 Correctly resolve accessors for static properties on Class
Issue: SPR-11609
(cherry picked from commit 3af8a32)
2014-03-26 21:57:35 +01:00
Juergen Hoeller
88485dc1a7 Maintenance version updates (aligned with 4.0.3 release) 2014-03-26 21:12:25 +01:00
Juergen Hoeller
a25d67770e Added expression test case for constant on Map
Issue: SPR-11609
2014-03-26 21:11:49 +01:00
Juergen Hoeller
5c9fc09852 Added Spring Data oriented conversion test case
Issue: SPR-11608
2014-03-26 20:50:00 +01:00
Juergen Hoeller
e1602f7f83 AbstractApplicationEventMulticaster only caches if event type and source type are cache-safe
Issue: SPR-11606
(cherry picked from commit 3388573)
2014-03-26 20:34:55 +01:00
Juergen Hoeller
20228e78c5 CacheAspectSupport checks Cache.get(key) once per invocation only
Issue: SPR-11592
2014-03-26 00:21:39 +01:00
Juergen Hoeller
623b1fc0d5 Polishing 2014-03-25 00:37:01 +01:00
Juergen Hoeller
a2bdc284f9 DispatcherServlet logs request URI in encoded form only
Issue: SPR-11591
(cherry picked from commit 465ca24)
2014-03-25 00:36:36 +01:00
Juergen Hoeller
dbd5f67498 Consistently applied appropriate ByteArrayOutputStream initial capacities across the codebase
Issue: SPR-11594
(cherry picked from commit dd7f54c)
2014-03-25 00:35:33 +01:00
Juergen Hoeller
ab85aa2096 BufferedImageHttpMessageConverter ignores empty MIME types
Issue: SPR-11581
(cherry picked from commit 90e3dbb)
2014-03-25 00:34:53 +01:00
Juergen Hoeller
5c3f6a1571 Revised naming for prototype inner beans to avoid excessive unique name calculation
Restored original singleton-only adaptInnerBeanName behavior, avoiding endless unique name calculation for every single prototype instance. Non-named inner BeanDefinition objects now suffixed with an identity hex code analogous to non-named XML bean definitions, largely avoiding naming collisions to begin with. After SPR-11246, post-processors can deal with unstable classes per bean name, so occasional collisions aren't a hard problem anymore.

Issue: SPR-11545
(cherry picked from commit 5308b3e)
2014-03-25 00:34:41 +01:00
Juergen Hoeller
b73a43972e Upgraded to TestNG 6.8.8 and Hibernate 4.2.10 2014-03-11 21:36:44 +01:00
Juergen Hoeller
9585752693 Polishing 2014-03-11 21:36:10 +01:00
Juergen Hoeller
5c0fdb05bd AbstractFlashMapManager needs to decode parameter names
Also includes general alignment with the 4.0.3 versions of AbstractFlashMapManager and FlashMapManagerTests.

Issue: SPR-11504
2014-03-11 21:35:36 +01:00
Juergen Hoeller
eeb82c409a SpEL property-not-found message hints at non-public method/field
Issue: SPR-11535
2014-03-11 10:47:53 +01:00
Juergen Hoeller
d317b637e0 CollectionToCollectionConverter avoids collection copy for untyped collection when simply returning source anyway
Also uses addAll instead of iteration over untyped collection now, supporting optimized addAll in target collection type, and avoids repeated getElementTypeDescriptor calls.

Issue: SPR-11479
(cherry picked from commit bea94d5)
2014-03-10 18:48:01 +01:00
Stephane Nicoll
b1bcc5d6eb Fix double SPeL evaluation of parameter
When a node of an SPeL expression was a call to a bean referenced
 in a method argument, the expression was resolved twice.

 The resolved arguments are now specified to MethodValueRef instead
 of resolving the arguments again in the constructor

 Issue: SPR-11445
(cherry picked from commit 519799e)
2014-03-07 14:59:41 +01:00
Juergen Hoeller
f1ba789494 DefaultListableBeanFactory only puts 'cache-safe' Class keys into its by-type cache
Issue: SPR-11520
(cherry picked from commit 93c8b7a)
2014-03-07 14:58:51 +01:00
Juergen Hoeller
d642cd21bb SpringBeanELResolver's setValue should not throw PropertyNotWritableException if provided value is identical to current bean instance
Issue: SPR-11502
(cherry picked from commit 7972b31)
2014-03-07 14:58:16 +01:00
Juergen Hoeller
70155e9ff9 KeyGenerators should not return a plain array parameter as raw key but rather always handle that case in a deepHashCode fashion
Issue: SPR-11505
(cherry picked from commit e50cff4)
2014-03-07 14:57:25 +01:00
Juergen Hoeller
7e2a214f32 instantiateUsingFactoryMethod avoids NPE and reports argument types in case of explicitArgs and resolved generic arguments as well
Issue: SPR-11517
(cherry picked from commit ad31777)
2014-03-07 14:56:45 +01:00
Juergen Hoeller
4c9c7634d0 Log4jWebConfigurer does not try to parse empty "log4jRefreshInterval" context-param
Issue: SPR-11507
(cherry picked from commit 9b77157)
2014-03-07 14:55:44 +01:00
Juergen Hoeller
69c54a053c Fixed content length check in XmlValidationModeDetector
Issue: SPR-11477
(cherry picked from commit 1763bfb)
2014-03-07 14:55:11 +01:00
Rossen Stoyanchev
4b9aad8f65 Refactor async result handling in Spring MVC Test
This change removes the use of a CountDownLatch to wait for the
asynchronously computed controller method return value. Instead we
check in a loop every 200 milliseconds if the result has been set.
If the result is not set within the specified amount of time to wait
an IllegalStateException is raised.

Additional changes:
 - Use AtomicReference to hold the async result
 - Remove @Ignore annotations on AsyncTests methods
 - Remove checks for the presence of Servlet 3

Issue: SPR-11516
2014-03-05 14:54:34 -05:00
Spring Buildmaster
5fe436c9a9 Next development version 2014-02-18 21:51:58 -08:00
Phillip Webb
082a564b9b Update changelog for 3.2.8 2014-02-18 20:58:34 -08:00
Rossen Stoyanchev
fb0683c066 Add processExternalEntities support to OXM
Update OXM AbstractMarshaller to support processing of external
XML entities. By default external entities will not be processed.

Issue: SPR-11376
2014-02-18 16:01:20 -08:00
Phillip Webb
09c57203bb Fix memory leak in ConcurrentReferenceHashMap
Update ConcurrentReferenceHashMap to protect against references that
have been garbage collected but for some reason do not appear as a
`pollForPurge` result.

Also added purgeUnreferencedEntries() method to allow for programmatic
cleanup.

Issue: SPR-11440
(cherry picked from commit 2b4c81e6)
2014-02-18 15:18:26 -08:00
Juergen Hoeller
4886bf0708 Polishing 2014-02-14 23:46:22 +01:00
Juergen Hoeller
75e08695a0 Mixed polishing along with recent changes
(cherry picked from commit 14e5a02)
2014-02-14 23:27:09 +01:00
Juergen Hoeller
5da79ebca6 Related polishing
Issue. SPR-11428
(cherry picked from commit 9c6df76)
2014-02-14 23:21:29 +01:00
Juergen Hoeller
bb7a1372c0 Avoid unnecessary getMappingForMethod repeat (in particular for RequestMappingInfo)
Issue. SPR-11428
(cherry picked from commit f913940)
2014-02-14 22:54:16 +01:00
Juergen Hoeller
7e3c722146 Objects with multi-threaded access should not lazily populate a hash field
Issue. SPR-11428
(cherry picked from commit 72fe7eb)
2014-02-14 22:53:13 +01:00
Juergen Hoeller
d7591c6bd7 Clarified CompositeCacheManager's applicability, added convenience constructor with given delegates, and fixed getCacheNames implementation to never return duplicates
Issue: SPR-11427
(cherry picked from commit d550ffb)
2014-02-14 22:51:12 +01:00
Juergen Hoeller
42dec02203 EhCache/JCacheCacheManager needs to re-obtain runtime-added Cache reference for potential decoration
Issue: SPR-11407
(cherry picked from commit ef1748f)
2014-02-14 22:48:23 +01:00
Sam Brannen
27ad1990e3 Fix imports in SourceHttpMessageConverterTests
Replaced static import of org.junit.Assert.* with implicit imports in
order to avoid ambiguity between JUnit's static Assert methods and those
in org.custommonkey.xmlunit.XMLAssert.
2014-02-13 00:45:40 +01:00
Juergen Hoeller
337b5ff5d6 Actually upgraded to Gradle 1.11 2014-02-13 00:42:41 +01:00
Juergen Hoeller
b40403cdc9 Polishing
Issue: SPR-11422
(cherry picked from commit 520ef9e)
2014-02-13 00:42:22 +01:00
Juergen Hoeller
0972582880 resolveFactoryMethodIfPossible considers nonPublicAccessAllowed and SecurityManager
Issue: SPR-11422
(cherry picked from commit 603cdea)
2014-02-13 00:42:16 +01:00
Sam Brannen
bc879100c4 Test against CGLIB memory leak for method injection
This commit introduces a test in XmlBeanFactoryTests that verifies that
CGLIB generated subclasses for method injected beans are reused across
bean factories for identical bean definitions. In other words, by
verifying that the same CGLIB generated class is reused for identical
bean definitions, we can be certain that Spring is no longer generating
identical, duplicate classes that consume memory in the VM.

Issue: SPR-10785, SPR-11420
(cherry picked from commit f2a4537)
2014-02-13 00:31:13 +01:00
Sam Brannen
9f77ef4102 Exclude overloaded from equals & hashCode in MethodOverride
Prior to this commit, the inclusion of the 'overloaded' flag in the
implementations of equals() and hashCode() in MethodOverride could lead
to adverse effects in the outcome of equals() in AbstractBeanDefinition.

For example, given two bean definitions A and B that represent the
exact same bean definition metadata for a bean that relies on method
injection, if A has been validated and B has not, then A.equals(B) will
potentially return false, which is not acceptable behavior.

This commit addresses this issue by removing the 'overloaded' flag from
the implementations of equals() and hashCode() for MethodOverride.

Issue: SPR-11420
(cherry picked from commit 9534245)
2014-02-12 17:20:43 +01:00
Juergen Hoeller
7f95a27e6d Upgraded to Commons Logging 1.1.3 and Gradle 1.11 2014-02-12 15:15:41 +01:00
Juergen Hoeller
4ac4630b0b Polishing 2014-02-12 15:15:05 +01:00
Juergen Hoeller
29b40b9d0e Revised InvocableHandlerMethod exception handling
Issue: SPR-11281
(cherry picked from commit 1a1c72c)
2014-02-12 15:13:28 +01:00
Juergen Hoeller
85e336e6da Consistently avoid close() call on Servlet OutputStream
Issue: SPR-11413
(cherry picked from commit 5f1592a)
2014-02-12 15:12:43 +01:00
Juergen Hoeller
b223e6efec MarshallingView should not close response OutputStream after copying to it
MarshallingView also explicitly skips BindingResult when searching for a model object now, implementing common custom subclass behavior out-of-the-box.

Issue: SPR-11411
Issue: SPR-11417
2014-02-12 15:12:35 +01:00