Commit Graph

430 Commits

Author SHA1 Message Date
Juergen Hoeller 2cf88ac6a3 Polishing 2014-06-04 21:49:23 +02:00
Juergen Hoeller f7b465390c Moved @Uses annotations to org.springframework.lang; fixed Base64Utils to declare Java 8, and fixed PathResource's declaration to refer to Java 7.
Issue: SPR-11604
2014-06-04 21:34:23 +02:00
Stephane Nicoll 001d0e734c Support for @Order at the bean declaration level
This commit introduces OrderProvider and OrderProviderComparator, two
interfaces designed to externalize how a collection of element is sorted
according to their order value.

FactoryAwareOrderProvider is an OrderProvider implementation that knows
about the objects to order and the corresponding BeanFactory instance.
This allows to retrieve additional metadata about the actual instances
to sort, such as its factory method.

A @Bean method can now holds an additional @Order to define the order
value that this bean should have when injected as part of a collection
or array.

Issue: SPR-11310
2014-06-04 21:04:13 +02:00
Juergen Hoeller 64bb308763 GsonBuilderUtils for programmatic Base64 serialization setup; common Base64Utils class adapts between Java 8 and Commons Codec
Issue: SPR-9488
2014-06-04 13:22:11 +02:00
Juergen Hoeller b4954780aa ClassMetadata exposes isAnnotation() now, and correctly returns false from hasSuperClass() for interfaces and annotations
Issue: SPR-11711
2014-05-30 18:14:36 +02:00
Juergen Hoeller 8f2ed66b4a ServletRequestAttributes considers standard Number subclasses (as defined in NumberUtils) as immutable
Issue: SPR-11738
2014-05-27 17:43:31 +02:00
Juergen Hoeller 03ce4a5024 Polishing 2014-05-20 00:31:24 +02:00
Juergen Hoeller cfc720db25 Latest patches from ASM trunk 2014-05-19 22:29:27 +02:00
Juergen Hoeller 295a6aeed6 StringUtils.parseLocaleString parses variant correctly when variant contains country code
This commit also includes a JUnit 4 style revision of StringUtilsTests and ObjectUtilsTests.

Issue: SPR-11806
2014-05-19 22:29:19 +02:00
Rossen Stoyanchev 8ee4651038 Improve StringUtils.cleanPath
Issue: SPR-11793
2014-05-15 17:26:52 -04:00
Juergen Hoeller 782d10c66f JasperReports-related polishing 2014-05-12 20:27:53 +02:00
Stephane Nicoll 89fc3c0257 Add BackOffExecution to isolate state
This commit separates the BackOff configuration from an actual
 execution. BackOffExecution now contains all the state of a
 particular execution and BackOff is only meant to start (i.e.
 create) a new execution.

 The method "reset" has been removed as its no longer necessary:
 when an execution does not need to be used for a given operation
 anymore it can be simply discarded.

 Issue: SPR-11746
2014-05-09 16:39:01 +02:00
Stephane Nicoll 6a0483128a Configurable back off for listener recovery
Prior to this commit, DefaultMessageListenerContainer was recovering
on failure using a fixed time interval, potentially in an infinite way.

This commit adds an extra "backoff" property to the container that
permits to fine tune the recovery interval using a BackOff instance.

FixedBackOff provides a fixed interval between two attempts and a
maximum number of retries. ExponentialBackOff increases an initial
interval until a maximum interval has been reached. A BackOff instance
can return a special "STOP" time value that indicates that no further
attemps should be made. DefaultMessageListenerContainer uses this
value to stop the container.

protected method "sleepInbetweenRecoveryAttempts" has been renamed
to "applyBackOff" and now returns a boolean that indicate if the
back off has been applied and a new attempt should now be made.

Issue: SPR-11746
2014-05-09 11:56:15 +02:00
Juergen Hoeller 381ccde48d IdToEntityConverter defensively handles access to getDeclaredMethods
Issue: SPR-11758
2014-05-06 18:49:16 +02:00
Juergen Hoeller bea34ea41c GenericTypeResolver returns null for entirely unresolvable type arguments only
Issue: SPR-11763
2014-05-06 18:06:26 +02:00
Juergen Hoeller 842a8a851d AnnotationMetadataReadingVisitor passes metaAnnotationMap into getMergedAnnotationAttributes algorithm, for finding out about applicable overrides
Issue: SPR-11649
2014-04-30 22:51:36 +02:00
Juergen Hoeller 39e1342302 Revised definition of @UsesX annotations 2014-04-30 22:51:22 +02:00
Stephane Nicoll bd85c916eb Integrate animal sniffer
Animal sniffer provides tools to assist verifying that classes
compiled with a newer JDK are compatible with an older JDK.

This integratesthe latest version of the tool (1.11) that
permits the use of custom annotations. Added @UsesJava7,
@UsesJava8 and @UsesSunHttpServer and annotated the few places
where we rely on a specific environment.

The verification process can be invoked by running the 'sniff'
task.

Issue: SPR-11604

polishing
2014-04-30 13:51:01 +02:00
Juergen Hoeller 02aca9c754 Polishing 2014-04-30 00:01:07 +02:00
Juergen Hoeller dc2e62fab9 Polishing 2014-04-29 19:07:45 +02:00
Juergen Hoeller e510f6393a Polishing 2014-04-29 15:45:56 +02:00
Juergen Hoeller be5f2a8b4e Polishing 2014-04-28 23:37:07 +02:00
Juergen Hoeller ab24dda4ff Revised @PropertySource parsing for consistent PropertySource naming, avoiding accidental overriding by name
Issue: SPR-11637
2014-04-28 23:24:57 +02:00
Juergen Hoeller 6f2e61b19f Polishing
(cherry picked from commit c97c246)
2014-04-28 00:47:50 +02:00
Juergen Hoeller 6cb45f714e General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
(cherry picked from commit 59cef3c)
2014-04-28 00:47:21 +02:00
Juergen Hoeller 310bdbcb15 @Bean processing explicitly ignores bridge methods (for method overrides with return type narrowing on JDK 8)
Issue: SPR-11718
(cherry picked from commit 656fc52)
2014-04-28 00:33:04 +02:00
Juergen Hoeller 9353332a61 Polishing 2014-04-23 23:55:43 +02:00
Juergen Hoeller c05ab3e2e8 General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
2014-04-23 23:54:55 +02:00
Juergen Hoeller 9cb5f48459 SpringProperties falls back to ClassLoader.getSystemResource when loaded in bootstrap ClassLoader
Issue: SPR-11721
2014-04-23 18:18:46 +02:00
Juergen Hoeller fb66567bba Final patches from ASM 5.0.2 release
Issue: SPR-11212
2014-04-23 14:25:50 +02:00
Juergen Hoeller 700c3b257f Polishing 2014-04-22 20:48:26 +02:00
Juergen Hoeller 5ab7076118 considerInterfaces should work without considerInherited as well
Issue: SPR-11719
2014-04-22 20:47:33 +02:00
Juergen Hoeller 945335d14b AnnotationTypeFilter prevents ASM-based loading of java.* interfaces as well
Issue: SPR-11719
2014-04-22 20:46:36 +02:00
HejiaHo 16410cad4d Fix ConcurrentReferenceHashMap max constraints
Update calculateShift to respect the maximum upper bound as well as the
minimum value.

Issue: SPR-11720
2014-04-22 14:56:05 +01:00
Stephane Nicoll 5559209233 Remove useless imports 2014-04-22 09:57:12 +02:00
Sam Brannen e1720d89fc Don't mutate annotation metadata when merging attrs
Prior to this commit, invoking the getMergedAnnotationAttributes()
method in AnnotationReadingVisitorUtils resulted in mutation of the
internal state of the ASM-based annotation metadata supplied to the
method.

This commit fixes this issue by making a copy of the original
AnnotationAttributes for the target annotation before merging attribute
values from the meta-annotation hierarchy.

This commit also introduces a slight performance improvement by
avoiding duplicate processing of the attributes of the target
annotation.

Issue: SPR-11710
2014-04-21 12:46:38 -04:00
Juergen Hoeller 48c977afdc Polishing 2014-04-17 21:19:47 +02:00
Juergen Hoeller 637ad20cd3 Latest ASM patches (fix for bug 317151 from ASM HEAD; ASM's 1.8 bytecode processing needs to be lenient with CGLIB 3.1)
Issue: SPR-11212
2014-04-16 12:35:26 +02:00
Juergen Hoeller a167a1b591 JBoss "vfszip" resources need to be treated as jar URLs
Issue: SPR-11676
(cherry picked from commit 196f629)
2014-04-09 20:57:28 +02:00
Juergen Hoeller 0041e245a1 Polishing
Issue: SPR-11637
2014-04-09 17:43:09 +02:00
Stephane Nicoll 47a4327193 Add JSR-107 cache annotations support
This commit adds support for the JSR-107 cache annotations alongside
the Spring's cache annotations, that is @CacheResult, @CachePut,
@CacheRemove and @CacheRemoveAll as well as related annotations
@CacheDefaults, @CacheKey and @CacheValue.

Spring's caching configuration infrastructure detects the presence of
the JSR-107 API and Spring's JCache implementation. Both
@EnableCaching and the cache namespace are able to configure the
required JCache infrastructure when necessary. Both proxy mode
and AspectJ mode are supported.

As JSR-107 permits the customization of the CacheResolver to use for
both regular and exception caches, JCacheConfigurer has been
introduced as an extension of CachingConfigurer and permits to define
those.

If an exception is cached and should be rethrown, it is cloned and
the call stack is rewritten so that it matches the calling thread each
time. If the exception cannot be cloned, the original exception is
returned.

Internally, the interceptors uses Spring's caching abstraction by default
with an adapter layer when a JSR-107 component needs to be called.
This is the case for CacheResolver and CacheKeyGenerator.

The implementation uses Spring's CacheManager abstraction behind the
scene. The standard annotations can therefore be used against any
CacheManager implementation.

Issue: SPR-9616
2014-04-07 12:07:20 +02:00
Sam Brannen d9ee44cd7c Clean up warnings that show up in Gradle build 2014-04-06 16:25:28 +02:00
Juergen Hoeller 8006696613 Revised ByteArrayOutputStream handling in MarshallingView and co
Issue: SPR-11646
2014-04-02 20:57:09 +02:00
Stephane Nicoll dcf5f4a6a3 javax.annotation.Priority alternative to @Order
This commit rationalizes the use of @Order so that the standard
@Priority annotation can be used instead. The handling of both
annotations are now defined in OrderUtils.

This also updates the link to the JavaEE API so that we refer to
JavaEE7 instead of JavaEE6.

Issue: SPR-11639
2014-04-01 14:30:47 +02:00
Sam Brannen 34eb4dba3a Update Javadoc for supported JBoss VFS version 2014-03-28 21:54:23 +01:00
Juergen Hoeller 9859b97037 Consider a null ClassLoader (typically the bootstrap CL) as cache-safe
Issue: SPR-11606
(cherry picked from commit a4a2e80)
2014-03-26 23:51:53 +01:00
Juergen Hoeller b9bac1d3b6 Relaxed getElementTypeDescriptor assertion to not insist on a ResolvableType-known array
Issue: SPR-11608
2014-03-26 16:09:15 +01:00
Arjen Poutsma f2f355e76c Improved StAX<->SAX bridge
Improved the SAX to StAX (and vice-versa) bridge exposed via StaxUtils.
The old integration had some issues with namespace declaration
attributes, brought to light in a XMLUnit upgrade.

Issue: SPR-11549
2014-03-25 20:58:58 +01:00
Sam Brannen a2f1169e82 Don't detect annotations on superclass in StAnMeta
Changes introduced in conjunction with issue SPR-11475 altered the
behavior of StandardAnnotationMetadata such that annotations could be
detected on superclasses, specifically in the case where the
AnnotatedElementUtils.getAllAnnotationAttributes() method is invoked to
obtain multiple annotations of the same type (on the lowest level in the
class hierarchy), as is the case for @Profile and @Conditional.

This commit partially reverts these changes as follows:

 - All methods in AnnotatedElementUtils now set the
   traverseClassHierarchy to false, thereby effectively reverting the
   changes made in commit 1d30bf83a0.
   Note, however, that the changes made to AnnotationUtils remain in
   place.

 - Introduced tests in AnnotationMetadataTests that verify behavior
   present in Spring Framework 4.0.2 and earlier.

 - Updated tests in AnnotatedElementUtilsTests so that they pass against
   the reverted changes (i.e., align with the behavior present in Spring
   Framework 4.0.2 and earlier).

 - Refined Javadoc in AnnotationMetadata with regard to annotations
   being "present" vs. "defined".

 - Refined Javadoc in AnnotatedTypeMetadata.

Issue: SPR-11475, SPR-11595
2014-03-25 17:48:06 +01:00
Juergen Hoeller 9280ca7749 Upgraded to ASM 5.0.1
Issue: SPR-11239
2014-03-25 11:51:31 +01:00