Commit Graph

6710 Commits

Author SHA1 Message Date
Juergen Hoeller fe46a01a57 JndiObjectFactoryBean converts a "defaultObject" value to the expected type if necessary
Issue: SPR-11039
(cherry picked from commit 0aedd81)
2013-11-06 00:36:48 +01:00
Rossen Stoyanchev 2f13e05b4f Return 415 on bad request body content-type
Issue: SPR-10982
2013-11-05 15:38:04 -05:00
Rossen Stoyanchev 4b38dc8972 Fix exception mock request builder
Issue: SPR-11043
2013-11-05 11:00:02 -05:00
Rossen Stoyanchev 7387cb990e Disable ext entities in SourceHttpMessageConverter
This change disables the processing of external entities in
SourceHttpMessageConverter by default and provides an option to enable
it if required.
2013-11-05 09:49:13 -05:00
Juergen Hoeller 863570abb7 Perform setParent's Environment merging for ClassPathXmlApplicationContext etc constructors with parent argument as well
Issue: SPR-11068
(cherry picked from commit c5fcf19)
2013-11-05 14:18:14 +01:00
Juergen Hoeller 70907fd326 Only retrieve the FlashMapManager if a non-empty output FlashMap has been found
Issue: SPR-10937
(cherry picked from commit 4ac6801)
2013-11-05 14:18:08 +01:00
Juergen Hoeller 494cc22bcd Polishing (along with SPR-10992) 2013-11-05 00:52:49 +01:00
Juergen Hoeller 044d68b336 @Bean method metadata is always being picked from the most concrete subclass
As a side effect, @Bean overrides and overloads work with 'allowBeanDefinitionOverriding'=false as well now.

Issue: SPR-10992
2013-11-05 00:52:28 +01:00
Juergen Hoeller a95eb1d044 Polishing (selectively backported from recent 4.0 commits) 2013-11-04 16:22:46 +01:00
Juergen Hoeller b00c31a620 Use non-lenient constructor resolution mode for @Bean methods
Since @Bean methods are never used with externally specified constructor argument values but rather just with autowiring, the non-lenient constructor resolution mode is appropriate in case of an overloaded @Bean method, not performing any type difference weight checks. This change includes a refinement of Spring's existing non-lenient constructor resolution (which needs to be explicitly turned on and is therefore not well tested), narrowing the conditions for the ambiguity check (only in case of the same number of arguments and not for overridden methods).

Issue: SPR-10988
(cherry picked from commit b093b84)
2013-11-04 16:11:04 +01:00
Juergen Hoeller 23cc44f16e Javadoc polishing 2013-11-01 23:04:07 +01:00
Juergen Hoeller e1a065906e Avoid unnecessary char[] allocation in NamedParameterUtils
Issue: SPR-11042
(cherry picked from commit 1dc7ff8)
2013-11-01 23:02:56 +01:00
Juergen Hoeller 3bfddc501d Backported further GenericTypeResolver tests
Issue: SPR-11052
2013-10-31 17:39:39 +01:00
Rossen Stoyanchev f9081bedb4 Add timeout async request handling to OSIV components
This change adds async web request timeout handling to OSIV filters
and interceptors to ensure the session or entity manager is released.

Issue: SPR-10874
2013-10-30 23:12:09 -04:00
Juergen Hoeller 1ac8e48ebf Polishing (backported from several master changes) 2013-10-30 22:47:16 +01:00
Rossen Stoyanchev d4f4225e53 Avoid filling up AntPathMatcher cache
This change avoid use of AntPathMatcher to extract URI template
variables when the lookup path is used as the best matching pattern.

Issue: SPR-10803
(cherry picked from commit a7af950)
2013-10-30 22:18:11 +01:00
Juergen Hoeller c53184cb6d Refined logging for advisors which are currently in creation
Issue: SPR-10430
(cherry picked from commit 62157fe)
2013-10-30 22:12:24 +01:00
Phillip Webb f9f106936c Relax JavaBean rules for SpEL property access
Relax the method search algorithm used by `ReflectivePropertyAccessor`
to include methods of the form `getXY()` for properties of the form
`xy`.

Although the JavaBean specification indicates that a property `xy`
should use the accessors `getxY()` and `setxY()`, in practice many
developers choose to have an uppercase first character. The
`ReflectivePropertyAccessor` will now consider these style methods if
the traditional conventions fail to find a match.

Issue: SPR-10716
(cherry picked from commit b25e91a5)
2013-10-30 13:02:07 -07:00
Phillip Webb bcf7aecf0f Skip convert to Object from TypeConverterDelegate
Update TypeConverterDelegate to bypass conversion when the target type
is Object.class. Prior to this commit converting a single element array
to an Object would result in the element being returned, rather than
the array itself.

Issue: SPR-10996
(cherry picked from commit c9aace4d)
2013-10-30 13:02:07 -07:00
Phillip Webb 5854d519a1 Add targetIsClass to SpEL property cache key
Update the `CacheKey` class used by `ReflectivePropertyAccessor` to
include if the target object is class. The prevents an incorrect cache
hit from being returned when a property with the same name is read on
both an object and its class. For example:

	#{class.name}
	#{name}

Issue: SPR-10486
(cherry picked from commit 6d882b14)
2013-10-30 13:02:07 -07:00
Phillip Webb 1ea7f741fe Multicaster support for events with null source
Update `AbstractApplicationEventMulticaster` to support `EventObjects`
with a null source (which can happen if they have been serialized).

Issue: SPR-10945
(cherry picked from commit b0ff834e)
2013-10-30 13:02:07 -07:00
Phillip Webb 8c6fe2cb42 Consistent ordering for @PropertySource locations
Ensure that property source locations are processed in the same order
regardless if the 'name' attribute is set or not.

Prior to this commit multiple locations from a `@PropertySource` with
a name were added to a `CompositePropertySource` in such a way that
the first location would take precedence. This has now been reversed
for consistence with unnamed `@PropertySource`s

Issue: SPR-10820
(cherry picked from commit e3d3d8cd)
2013-10-30 13:02:06 -07:00
Rossen Stoyanchev 7a5a6893e3 Avoid filling up AntPathMatcher cache
This change avoid use of AntPathMatcher to extract URI template
variables when the lookup path is used as the best matching pattern.

Issue: SPR-10803
2013-10-30 14:34:13 -04:00
Juergen Hoeller c8e8d6cd49 Defensive handling of exceptions during factory method type checking
Also using ClassUtils.forName in AutowireUtils now in order to accept all common class name formats.

Issue: SPR-11034
(cherry picked from commit 8c1767e)
2013-10-28 13:47:11 +01:00
Juergen Hoeller 094ff8883d Polishing 2013-10-27 22:52:36 +01:00
Juergen Hoeller 44f79f95a7 Fixed resolveReturnTypeForFactoryMethod to unwrap TypedStringValue
XML-defined arguments values are initially turned into TypedStringValue wrappers. If we encounter an unresolved argument, we need to unwrap such a TypedStringValue and then try to treat its content as a class name.

Issue: SPR-11034
2013-10-27 22:48:57 +01:00
Juergen Hoeller 3eaec64ee8 Fixed source location of setEncoding method 2013-10-27 00:57:37 +02:00
Juergen Hoeller ff9c695599 Minor optimizations in factory method handling
Optimized getTypeForFactoryMethod's implementation for non-generic factory methods, and reduced calls to getResolvedFactoryMethod in order to avoid repeated synchronization. Derived from work around SPR-11034.
2013-10-27 00:55:02 +02:00
Juergen Hoeller 6021822ce4 Polishing 2013-10-26 17:31:43 +02:00
Juergen Hoeller 045f78e6c5 Fixed detection of setter in case of getter with covariant return type narrowing
Issue: SPR-10995
2013-10-26 17:31:24 +02:00
Juergen Hoeller 42568afb37 Factory method type resolution works with indexed and named arguments as well
Issue: SPR-11019
(cherry picked from commit 109faac)
2013-10-26 15:57:54 +02:00
Juergen Hoeller ce001c23f7 Cache InjectionMetadata per bean name instead of per Class, if possible
Issue: SPR-11027
(cherry picked from commit 4675bc4)
2013-10-26 15:56:57 +02:00
Juergen Hoeller 93405fb289 Made processCommonDefinitionAnnotations(AnnotatedBeanDefinition) public
Issue: SPR-11032
(cherry picked from commit 8bd4804)
2013-10-26 15:55:48 +02:00
Juergen Hoeller db056ae0e0 ExpressionState.getConfiguration() should never return null
Issue: SPR-11031
(cherry picked from commit 4aab315)
2013-10-26 15:55:13 +02:00
Juergen Hoeller 35d53af2ca Removed accidentally added temporary files 2013-10-26 15:54:46 +02:00
Sam Brannen 63de2fab4c Assert context uniqueness against merged config
Prior to this commit, the uniqueness check for @ContextConfiguration
attributes within a @ContextHierarchy was performed at a single test
class level instead of against the merged configuration for all test
class levels in the test class hierarchy.

This commit addresses this issue by moving the uniqueness check
algorithm from resolveContextHierarchyAttributes() to
buildContextHierarchyMap() within ContextLoaderUtils.

Issue: SPR-11011
Backport-Commit: 7658d856ca
2013-10-21 20:51:36 +02:00
Phillip Webb 5d8aa635c6 Propagate EvaluationContext from LiteralExpression
Update getValue(EvaluationContext context, Object rootObject,
Class<T> desiredResultType) to propagate the EvaluationContext to
ExpressionUtils.

Issue: SPR-10953
(cherry picked from 686cd79)
2013-10-18 17:57:46 -07:00
Juergen Hoeller ad9049e68a Polishing 2013-10-17 22:19:17 +02:00
Juergen Hoeller b9135788b9 Fixed type prediction for generic factory methods
We're consistently resolving class names now, and the entire algorithm moved from GenericTypeResolver to the internal AutowireUtils helper in the bean factory package.

Issue: SPR-10411
(cherry picked from commit 8b1927f)
2013-10-17 21:46:59 +02:00
Juergen Hoeller b62652aca1 Reduced "getParameterType call not supported" log message to single line
Issue: SPR-10185
(cherry picked from commit 41f041e)
2013-10-17 21:09:11 +02:00
Juergen Hoeller fce02d94b8 Changed JSR-330 detection logging from info to debug
Issue: SPR-10974
(cherry picked from commit 7a9d583)
2013-10-17 21:07:44 +02:00
Phillip Webb 2dca5b6815 Filter source @Configuration with @ComponentScan
Exclude self @Component when parsing @ComponentScan annotations.

Issue: SPR-10531
(cherry picked from d91ffb)
2013-10-10 17:03:36 -07:00
Juergen Hoeller a302c4ac45 Polishing
(cherry picked from commit 52cca48)
2013-10-04 23:31:18 +02:00
Rossen Stoyanchev 507cf8ad14 Make method in RequestMappingHandlerMapping protected
Issue: SPR-10950
2013-10-02 17:50:16 -04:00
Phillip Webb 7500caea52 Fix ArrayStoreException reading subclassed enums
Fix ASM AnnotationAttributesReadingVisitor to correctly deal with
subclasses enums.

Issue: SPR-10914
(cherry picked from 8abe949)
2013-09-27 11:39:11 -07:00
Juergen Hoeller 7994b63c13 Polishing 2013-09-26 21:38:54 +02:00
Juergen Hoeller 26e697b60c Silently swallow IllegalStateException on commit if the JMS transaction is based on a JDBC transaction
This fine-tuned change restores the original Spring 3.0 behavior for Oracle AQ, and also allows for other ConnectionFactory types to comply with the "getDataSource()" pattern.

Issue: SPR-10829
(cherry picked from commit 11d20e3)
2013-09-26 21:25:48 +02:00
Juergen Hoeller ef66708aa6 Fixed BadSqlGrammarException usage in transaction test suite
Issue: SPR-10902
2013-09-25 13:47:15 +02:00
Juergen Hoeller 30b3e24a32 Removed S0 from BadSqlGrammarException codes
S0 doesn't seem to be universally used for SQL grammar problems: see MS SQL Server's RAISERROR. This was reported years back; not sure why the fix didn't actually appear in the codebase back then.

Issue: SPR-10902
(cherry picked from commit d9b6203)
2013-09-25 13:05:06 +02:00
Juergen Hoeller 0a31892475 Fixed handling of @Resource's shareable value
Issue: SPR-10931
(cherry picked from commit 7bc3e3b)
2013-09-25 13:04:50 +02:00