Commit Graph

532 Commits

Author SHA1 Message Date
Lukasz Kryger 0dc52a8343 Fix method comment for getRequiredProperty(String) 2014-06-11 11:56:58 +02:00
Juergen Hoeller 5cb3f8eada Support for java.util.Optional within ObjectFactory/Provider
Includes support for arbitrary deep nesting levels in DependencyDescriptor's getDependencyType() and MethodParameter's getNestedParameterType().

Issue: SPR-11833
2014-06-06 15:29:50 +02:00
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
Juergen Hoeller dd7f54c3c0 Revised ResizableByteArrayOutputStream as an actual subclass of ByteArrayOutputStream, and consistently applied appropriate ByteArrayOutputStream initial capacities across the codebase
Issue: SPR-11594
2014-03-24 22:57:38 +01:00
Brian Clozel ae012ae6e2 ShallowEtagHeaderFilter use specified contentlength
Prior to this commit, the ShallowEtagHeaderFilter did not use the
content length given by the content generator to set the
ByteArrayOutputStream's buffer size.
This can lead to performance issues for large content since the buffer
grows as the content is being written.

This commit adds a new ByteArrayOutputStream variant called
ResizableByteArrayOutputStream. This implementation has public methods
for modifying the internal buffer size and does not synchronize on
buffer access.
This commit also make use of this new variant in
ShallowEtagHeaderFilter.

Issue: SPR-8271
2014-03-24 12:11:59 +01:00
Sam Brannen 796af90ba7 Polish ASM-based annotation processing
- AnnotationAttributesReadingVisitor no longer processes annotations
  from the java.lang.annotation package.

- Simplified logic in AnnotationReadingVisitorUtils
  getMergedAnnotationAttributes().

Issue: SPR-11574
2014-03-21 15:26:13 +01:00
Stephane Nicoll 4cd818b9e4 Harmonize log configuration
Prior to this commit, the codebase was using a mix of log4j.xml
and log4j.properties for test-related logging configuration. This
can be an issue as log4j takes the xml variant first when looking
for a default bootstrap configuration.

In practice, some modules declaring the properties variant were
taking the xml variant configuration from another module.

The general structure of the configuration has also been
harmonized to provide a standard console output as well as an
easy way to enable trace logs for the current module.
2014-03-20 09:43:29 -07:00
Juergen Hoeller ad09f1b5ec Upgraded embedded ASM version to 5.0
Issue: SPR-11239
2014-03-20 01:06:22 +01:00
Sam Brannen 99cd2f6098 Support meta-annotation overrides in ASM processing
Prior to this commit, Spring supported meta-annotation attribute
overrides in custom composed annotations with reflection-based
annotation processing but not with ASM-based annotation processing.

This commit ensures that meta-annotation attribute overrides are
supported in AnnotationMetadataReadingVisitor.getAnnotationAttributes().

Issue: SPR-11574
2014-03-19 23:44:13 +01:00
Sam Brannen 9ce0df89ff Support Class meta-annotation attributes with ASM
Prior to this commit, AnnotationAttributesReadingVisitor treated Class
annotation attributes as Strings instead of Classes. As a result,
look-ups for Class attributes in meta-annotations failed with an
IllegalArgumentException.

This commit fixes this issue by consistently treating Class attributes
as Classes in AnnotationAttributesReadingVisitor.

Issue: SPR-11557
2014-03-18 18:20:15 +01:00
Juergen Hoeller 5ff1c696c8 Check raw Type objects, not ResolvableType instances, during isAssignableFrom recursion
Issue: SPR-11522
2014-03-14 00:45:40 +01:00
Juergen Hoeller 4744180d3d NumberUtils reports overflow when converting from BigInteger/BigDecimal to Long
Issue: SPR-11434
2014-03-13 17:03:55 +01:00
Sam Brannen 2bfd6ddcf4 Refactor SQL script support
This commit continues the work in the previous commit as follows:

 - Introduced an exception hierarchy for exceptions related to SQL
   scripts, with ScriptException as the base.

 - CannotReadScriptException and ScriptStatementFailedException now
   extend ScriptException.

 - Introduced ScriptParseException, used by ScriptUtils.splitSqlScript().

 - DatabasePopulatorUtils.execute() now explicitly throws a
   DataAccessException.

 - Polished Javadoc in ResourceDatabasePopulator.

 - Overhauled Javadoc in ScriptUtils and documented all constants.

 - Added missing @author tags for original authors in ScriptUtils and
   ScriptUtilsTests.

 - ScriptUtils.splitSqlScript() now asserts preconditions.

 - Deleted superfluous methods in ScriptUtils and changed method
   visibility to private or package private as appropriate.

 - Deleted the ScriptStatementExecutor introduced in the previous
   commit; ScriptUtils.executeSqlScript() now accepts a JDBC Connection;
   JdbcTestUtils, AbstractTransactionalJUnit4SpringContextTests, and
   AbstractTransactionalTestNGSpringContextTests now use
   DatabasePopulatorUtils to execute a ResourceDatabasePopulator instead
   of executing a script directly via ScriptUtils.

 - Introduced JdbcTestUtilsIntegrationTests.

Issue: SPR-9531
2014-03-13 12:00:01 +01:00
Juergen Hoeller bea94d5302 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
2014-03-10 15:59:19 +01:00
Sam Brannen b364599278 Update links to Spring JIRA server 2014-03-10 12:26:29 +01:00
Sam Brannen 1ade9b5433 Polish various test classes 2014-03-07 18:06:30 +01:00
Juergen Hoeller 3dfa7e9ac0 Avoid stack overflow in case of circular type reference
Issue: SPR-11522
2014-03-07 00:08:15 +01:00
Juergen Hoeller 793cab4f80 Allow generics-based injection in case of nested unresolved type variable
Issue: SPR-11471
2014-03-06 14:13:33 +01:00
Juergen Hoeller 2a2816dfc3 Restored proper handling of varargs in case of unresolvable type variable
Fixed through falling back to the raw parameter type in the TypeDescriptor(MethodParameter) constructor, properly detecting the vararg array even in case of an unresolvable type variable, and through restoring getElementTypeDescriptor's original behavior for arrays, i.e. always returning a non-null descriptor.

Issue: SPR-11494
2014-03-05 22:36:12 +01:00
Juergen Hoeller f3884084f2 Optimized DefaultResourceLoader's getResource implementation for "/..." paths, not relying on URL parsing exceptions for such a common case anymore
Issue: SPR-8283
2014-03-04 13:31:51 +01:00
Juergen Hoeller ac61b13a7c AnnotatedElementUtils wraps unexpected exceptions with descriptive IllegalStateException
Issue: SPR-10441
2014-02-28 14:17:37 +01:00
Juergen Hoeller 1763bfbad0 Fixed content length check in XmlValidationModeDetector
Issue: SPR-11477
2014-02-28 14:00:32 +01:00
Sam Brannen 0637864b39 Ensure AnnotationUtils is compatible with Java 6
The previous commit introduced a dependency on
Class.getDeclaredAnnotation() which is a Java 8 API.

This commit refactors AnnotationUtils.findAnnotation(Class, Class, Set)
to use Class.getAnnotation() in conjunction with
isAnnotationDeclaredLocally() in order to achieve the same desired
behavior.

Issue: SPR-11475
2014-02-26 17:51:26 +01:00
Sam Brannen 1d30bf83a0 Favor 'local' annotations over inherited ones
Prior to this commit, the implementations of findAnnotation() in
AnnotationUtils and getAnnotationAttributes() in AnnotatedElementUtils
favored inherited annotations and inherited composed annotations over
composed annotations that are declared closer to the starting class
passed to these methods.

This commit addresses this issue as follows:

- Refactored AnnotationUtils to use getDeclaredAnnotation() and
  getDeclaredAnnotations() instead of getAnnotation() and
  getAnnotations() where appropriate.

- AnnotatedElementUtils.doProcess() supports a traverseClassHierarchy
  flag to control whether the class hierarchy should be traversed,
  using getDeclaredAnnotations() instead of getAnnotations() if the
  flag is true.

- Overhauled Javadoc in AnnotatedElementUtils.

Issue: SPR-11475
2014-02-26 16:06:42 +01:00
Sam Brannen 979c483384 Do not inspect meta-annotations on Java annotations
This commit introduces a new isInJavaLangAnnotationPackage(Annotation)
method in AnnotationUtils. This method is now used in AnnotationUtils,
AnnotatedElementUtils, and MetaAnnotationUtils to ensure that search
algorithms do no search for meta-annotations on annotations in the
"java.lang.annotation" package.

The following are some empirical results from this change:

- The number of times that the findAnnotation(Class,Class,Set) method in
  AnnotationUtils is recursively invoked while executing
  AnnotationUtilsTests drops from 51 to 29.

- The number of times that the process(AnnotatedElement) method in
  AnnotationUtils.AnnotationCollector is recursively invoked while
  executing AnnotationUtilsTests.getRepeatableFromMethod() drops
  from 16 to 2.

- The number of times that the doProcess() method in
  AnnotatedElementUtils is recursively invoked while executing the
  "getAnnotationAttributes() On MetaCycleAnnotatedClass with missing
  target meta-annotation" test in AnnotatedElementUtilsTests drops
  from 23 to 5.

- The number of times that the findAnnotationDescriptor(Class,Set,Class)
  method in MetaAnnotationUtils is recursively invoked while executing
  the "findAnnotationDescriptor() on MetaCycleAnnotatedClass with
  missing target meta-annotation" test in MetaAnnotationUtilsTests drops
  from 16 to 8.

Issue: SPR-11483
2014-02-25 21:57:35 +01:00
Sam Brannen 90b938aa8f Verify status quo when searching for non-inherited composed annotations
Issue: SPR-11475
2014-02-24 00:13:47 +01:00
Sam Brannen 7e38f479e0 Polishing 2014-02-21 22:56:23 +01:00
Sam Brannen 42a36349e9 Support nested meta-annotations in AnnotationUtils
Prior to this commit, AnnotationUtils.findAnnotation(Class, Class)
claimed to recursively search through annotations; however, only one
level of annotations was supported by the algorithm.

This commit alters the search algorithm so that nested meta-annotations
(i.e., meta-annotations on meta-annotations) are also supported.

Issue: SPR-11448
2014-02-19 18:27:44 +01:00
Sam Brannen 8f0849f328 Fix minor error in AnnotationUtilsTests
TransactionalAndOrderedClass now extends TransactionalClass.

The tests passed anyway, but they did not actually verify what was meant
to be verified.
2014-02-19 12:47:55 +01:00
Phillip Webb 461816735f Fix unused import warning 2014-02-18 19:37:06 -08:00
Phillip Webb 7efd54e243 Additional caching for ResolvableTypes
Add additional caching to ResolvableTypes and SerializableTypeWrapper
in order to improve SpEL performance.

Issue: SPR-11388
2014-02-18 15:27:28 -08:00
Phillip Webb 319724f0b4 Regularly purge ResolvableType cache
Update ResolvableType to call `purgeUnreferencedEntries` on the cache
on each get.

Issue: SPR-11394
2014-02-18 15:16:03 -08:00
Phillip Webb 2b4c81e642 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
2014-02-18 15:10:30 -08:00
Juergen Hoeller 72fe7ebc34 Objects with multi-threaded access should not lazily populate a hash field
Issue. SPR-11428
2014-02-14 20:46:34 +01:00
Sam Brannen c335e99e3f Remove trailing whitespace from source code 2014-02-08 17:30:39 +01:00
Juergen Hoeller 426f52b393 Polishing 2014-02-06 20:35:59 +01:00
Juergen Hoeller 8c4e372558 Introduced SpringNamingPolicy for CGLIB
Issue: SPR-11398
2014-02-06 20:25:11 +01:00
Juergen Hoeller 1cd5071e6a Use AtomicInteger instead of local synchronization around int field
Issue: SPR-11103
2014-02-04 17:45:03 +01:00
Juergen Hoeller 6634c19e6a Related polishing
Issue: SPR-11386
2014-02-04 16:45:14 +01:00
Juergen Hoeller 60c1905cdd Introduced "spring.jdbc.getParameterType.ignore" property
Issue: SPR-11386
2014-02-04 16:44:08 +01:00
Sam Brannen b8ed2f4967 Ensure all tests are executed in the Gradle build
Prior to this commit several test classes named "*Test" were not
recognized as tests by the Gradle build. This is due to the configured
inclusion of '**/*Tests.*' which follows Spring's naming convention for
test classes.

This commit addresses this issue by:

 - Renaming real test classes consistently to "*Tests".
 - Renaming internal test classes to "*TestCase".
 - Renaming @WebTest to @WebTestStereotype.
 - Disabling broken tests in AnnoDrivenStaticEntityMockingControlTest.
 - Modifying the Gradle build configuration so that classes ending in
   either "*Tests" or "*Test" are considered test classes.

Issue: SPR-11384
2014-02-03 23:16:47 +01:00
Juergen Hoeller 874a2a9ca2 Backwards-compatible handling of generic and raw collection converters
Issue: SPR-11369
2014-02-01 19:24:40 +01:00
Juergen Hoeller 46b24dbd33 Polishing
Issue: SPR-11369
2014-02-01 12:15:01 +01:00
Juergen Hoeller d52f584322 GenericConversionService matches converters by full generic target type, allowing for the registration of multiple converters from the same source type to different collection types
Issue: SPR-11369
2014-02-01 10:53:01 +01:00
Juergen Hoeller a537eb3a6a Polishing 2014-01-30 12:26:41 +01:00
Juergen Hoeller 8570f607a7 Fixed regression with fallback for non-resolvable property type 2014-01-28 17:16:50 +01:00
Juergen Hoeller bb28d198f5 Polishing 2014-01-26 01:04:21 +01:00
Juergen Hoeller 67e76e9a8d Compatibility with JOpt 4.6
JOpt 4.6 redeclared its nonOptionArguments() method from List<String> to List<?>, requiring us to select String arguments only as we do for regular option values already.

Issue: SPR-11359
2014-01-26 00:05:51 +01:00
Juergen Hoeller 5331da6aff Polishing 2014-01-25 00:27:27 +01:00
Juergen Hoeller 167329ce0c Added test for SpringProperties setFlag method
Issue: SPR-9014
Issue: SPR-11297
(cherry picked from commit 23249cd)
2014-01-24 18:18:41 +01:00
Juergen Hoeller b6073d9ac4 Polishing 2014-01-24 16:22:29 +01:00
Juergen Hoeller 8543b91c50 Introduced SpringProperties class and optional "spring.properties" file
This in particular allows for specifying "spring.getenv.ignore" and "spring.beaninfo.ignore" in a local way within the application, in case that JVM-level system properties are locked.

Issue: SPR-9014
Issue: SPR-11297
2014-01-24 16:22:02 +01:00
Juergen Hoeller eeae5fba95 Fixed regression with constructing TypeDescriptor from null Class
Issue: SPR-11354
2014-01-24 13:16:35 +01:00
Juergen Hoeller 42db41e007 Polishing 2014-01-23 20:59:53 +01:00
Juergen Hoeller 9c3a972dac Polishing
Issue: SPR-11297
(cherry picked from commit fc36184)
2014-01-23 00:16:29 +01:00
Juergen Hoeller 6793765b0a Factored out "suppressGetenvAccess()" method
Issue: SPR-11297
(cherry picked from commit 52d050d)
2014-01-23 00:12:09 +01:00
Phillip Webb 59604b1cd5 Unwrap TypeVariables before calling .equals()
Update ResolvableType to unwrap Serialization wrapped TypeVariables
before calling the equals method.

This protects against the recent change in OpenJDK 8 (build 124)
which changed the TypeVariableImpl equals method such that it only
matches against other TypeVariableImpl instances.

Issue: SPR-11342
2014-01-21 16:10:02 -08:00
Phillip Webb d96b91a57b Fix SerializableTypeWrapper equals() performance
Change SerializableTypeWrapper proxies to directly call equals() methods
on the underlying Type, rather than possibly generating more wrappers.

This should help to improve performance, especially as the equals()
method is called many times when the ResolvableType cache is checked.

Issue: SPR-11335
2014-01-21 10:59:25 -08:00
Juergen Hoeller 709ac28f29 Consider wildcard type without bounds as eligible for fallback match too
Issue: SPR-11250
2014-01-21 01:26:30 +01:00
Juergen Hoeller 1aff833282 Polishing 2014-01-21 00:35:38 +01:00
Phillip Webb 9076c70d47 Provide 'with implementationType' overloads
Provided overloaded versions of `forField` and `forMethodParameter` that
accept a `ResolvableType` implementation type (as opposed to a Class).

Primarily added to allow resolution against implementation types that
have been created programmatically using `forTypeWithGenerics`.

Issue: SPR-11218
2014-01-17 11:49:44 -08:00
Phillip Webb 7e6dbc24f6 Make TypeDescriptor more amenable to subclassing
Change the previously package scope TypeDescriptor constructor to
protected and add a getResolvableType() protected method.

Issue: SPR-11303
2014-01-17 11:05:40 -08:00
Juergen Hoeller 4f45ad549e Introduced customizeConnection callbacks for URLConnection used by exists() / contentLength() / lastModified()
Issue: SPR-11320
2014-01-16 17:09:23 +01:00
Juergen Hoeller 11bc9d0aeb Mentioned "-parameters" compiler flag in javadoc 2014-01-16 12:49:31 +01:00
Juergen Hoeller a5f9b29292 Polishing 2014-01-15 22:53:46 +01:00
Juergen Hoeller e670f4e5c6 Polishing 2014-01-15 17:45:04 +01:00
Juergen Hoeller 961f42bd43 Introduced "spring.getenv.ignore" system property for preventing System.getenv calls
Issue: SPR-11297
2014-01-15 17:44:17 +01:00
Juergen Hoeller ab15ed2a05 ObjectUtils.isCompatibleWithThrowsClause supports varargs now 2014-01-15 16:09:31 +01:00
Juergen Hoeller 76bb966b1a Removed Commons Lang references 2014-01-15 15:35:08 +01:00
Juergen Hoeller abff789b0f Removed javadoc references to non-accessible subclasses 2014-01-15 13:39:09 +01:00
Juergen Hoeller cdd65a70af Added compatibility note on WildFly 8 2014-01-13 22:14:51 +01:00
Juergen Hoeller ee2022e54c Polishing 2014-01-05 03:01:44 +01:00
Juergen Hoeller 640d8cb67f Consistent implementation of AsyncListenableTaskExecutor
Issue: SPR-11282
2014-01-03 21:57:07 +01:00
Juergen Hoeller ff26dfdd28 Added cache for path pattern tokenization
Issue: SPR-11258
2014-01-03 17:33:46 +01:00
Juergen Hoeller 6aabb5f17e Support varargs for DomUtils.getChildElementsByTagName
Issue: SPR-11272
(cherry picked from commit e334489)
2014-01-03 16:18:48 +01:00
Rossen Stoyanchev 1f49f994e6 Fix issue with use of SecureRandom for id generation
Switch to using nextBytes as generateSeed doesn't seem to be always
supported by all hardware providers.

Issue: SPR-11278
2014-01-02 12:06:37 -05:00
Juergen Hoeller f0d21510f5 Polishing
Issue: SPR-11259
2013-12-30 19:13:04 +01:00
Juergen Hoeller 48909886a2 Added support for the Java 8 style 'from'/'to' method conventions
Also introduced a default ZonedDateTime-Calendar converter which is not covered by the default convention due to the 'from' method only being defined on GregorianCalendar.

Issue: SPR-11259
2013-12-30 19:08:36 +01:00
Juergen Hoeller 7f5d6ea3f9 Fixed NavigableSet/NavigableMap detection in createCollection/createMap
Issue: SPR-11257
2013-12-28 20:48:35 +01:00
Juergen Hoeller 9a39f39b6f Polishing
Issue: SPR-11254
2013-12-23 12:49:57 +01:00
Juergen Hoeller ee5b7fdab8 Revised XMLEventStreamWriter to allow for empty elements with attributes
Issue: SPR-11254
2013-12-23 12:49:47 +01:00
Juergen Hoeller f9e8eb59e1 Fixed hasUnresolvableGenerics() to return false in case of an unresolvable bounded variable as well
Issue: SPR-11250
2013-12-20 16:44:25 +01:00
Juergen Hoeller 2faf008c2e Polishing
Issue: SPR-11225
2013-12-19 23:08:18 +01:00
Juergen Hoeller 11fb12b920 Fixed AbstractMessageConverterMethodArgumentResolver's type variable resolution
Issue: SPR-11225
2013-12-19 23:04:23 +01:00
Juergen Hoeller aa2fadd8da Revised ResolvableType's handling of (self-referential) type variables
Also resolving at construction time now, and shortcutting assignability evaluation.

Issue: SPR-11219
2013-12-19 14:55:16 +01:00
Juergen Hoeller 234272eb8f Polishing
Issue: SPR-11215
2013-12-17 21:39:40 +01:00
Juergen Hoeller 63d300ac86 Polishing
Issue: SPR-11242
2013-12-17 20:14:33 +01:00
Juergen Hoeller 1d47fc6e2d Consistent non-declaration of serialVersionUID
Issue: SPR-11242
2013-12-17 20:14:07 +01:00
Juergen Hoeller 994efe45fd Prevented potential infinite recursion in hashCode/equals
Issue: SPR-11219
2013-12-17 20:12:03 +01:00
Juergen Hoeller 078d2fe0e2 Added current version information to SpringAsmInfo's javadoc 2013-12-16 22:50:25 +01:00
Juergen Hoeller 105e176a80 Fixed @Bean meta-annotation detection when using ASM
This turned out to be a bug in the ASM-based AnnotationMetadata implementation where has/getAnnotatedMethods didn't consider meta-annotations., in contrast to its StandardAnnotationMetadata sibling.

Issue: SPR-10488
2013-12-16 22:47:43 +01:00
Juergen Hoeller ca194261a4 Removed support for JBoss AS 5's VFS variant (since we require JBoss AS 6+ now) 2013-12-12 02:57:34 +01:00
Juergen Hoeller 161819f141 Component scanning ignores attributes and meta-annotations on non-public annotations
Issue: SPR-11091
2013-12-11 15:29:55 +01:00
Juergen Hoeller 4fe52d1953 Polishing 2013-12-10 12:00:32 +01:00
Juergen Hoeller 5dcd28761c Fixed type resolution for uninitialized factory-method declaration
Issue: SPR-11112
2013-12-09 18:53:27 +01:00
Juergen Hoeller 6078c27e60 Fixed evaluation of "!" operator in case of multiple profile expressions
Issue: SPR-11093
2013-12-09 13:29:21 +01:00
Phillip Webb fd1b48139f Polish 2013-12-02 21:35:13 -08:00
Phillip Webb cb46ef86c6 Fix test following ResolvableType hashcode change 2013-12-02 16:55:24 -08:00
Phillip Webb ab2949f2b7 Fix ResolvableType hashCode generation
Fix ResolvableType.hashCode() to use the source of the variable
resolver, rather than the resolver itself.
2013-12-02 14:47:44 -08:00
Juergen Hoeller 676ad125a1 Reverted arrayToList signature to return plain List
This is necessary for source compatibility with existing callers, such as code found in Spring Integration: e.g. passing the arrayToList result into a typed HashSet constructor.
2013-12-02 13:10:41 +01:00
Phillip Webb 043a41e382 Consistent whitespace after imports
Update code to have a consistent number of new-line characters after
import statements.
2013-11-26 15:14:43 -08:00