Commit Graph

3242 Commits

Author SHA1 Message Date
Juergen Hoeller 20c2ba35dc Polishing 2014-09-04 00:55:38 +02:00
Juergen Hoeller c6d29f1a31 Refactored support for @Order on @Bean methods as well as @Priority handling
Issue: SPR-11310
Issue: SPR-10548
2014-09-04 00:41:13 +02:00
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
Juergen Hoeller 9dfbc5326b Revised ResourcePropertySource in order to avoid ConfigurationClassProcessor's AnnotationPropertySource subclass
Issue: SPR-12115
2014-08-22 13:54:39 +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 60e58a2012 Polishing 2014-08-21 14:29:14 +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
Sam Brannen 0dba70fe15 Merge pull request #625 from eujungkim/spr-warning
Clean up warnings in CompoundComparator
2014-08-18 10:16:26 +02:00
eujung kim c315adf72d Remove unnecessary @SupressWarnings. 2014-08-18 17:03:03 +09:00
Sam Brannen 1a88007688 Improve documentation of SpringFactoriesLoader 2014-08-16 17:07:30 +02:00
Juergen Hoeller 69587f3fa4 Polishing 2014-08-14 23:49:29 +02:00
Sam Brannen e6d16148e5 Support automatic discovery of default TELs
Prior to this commit, there was no declarative mechanism for a custom
TestExecutionListener to be registered as a default
TestExecutionListener.

This commit introduces support for discovering default
TestExecutionListener implementations via the SpringFactoriesLoader
mechanism. Specifically, the spring-test module declares all core
default TestExecutionListeners under the
org.springframework.test.context.TestExecutionListener key in its
META-INF/spring.factories properties file, and third-party frameworks
and developers can contribute to the list of default
TestExecutionListeners in the same manner.

 - AbstractTestContextBootstrapper uses the SpringFactoriesLoader to
   look up the class names of all registered default
   TestExecutionListeners and sorts the instantiated listeners using
   AnnotationAwareOrderComparator.

 - DefaultTestContextBootstrapper and WebTestContextBootstrapper now
   rely on the SpringFactoriesLoader mechanism for finding default
   TestExecutionListeners instead of hard coding fully qualified class
   names.

 - To ensure that default TestExecutionListeners are registered in the
   correct order, each can implement Ordered or declare @Order.

 - AbstractTestExecutionListener and all default TestExecutionListeners
   provided by Spring now implement Ordered with appropriate values.

 - Introduced "copy constructors" in MergedContextConfiguration and
   WebMergedContextConfiguration

 - SpringFactoriesLoader now uses AnnotationAwareOrderComparator
   instead of OrderComparator.

Issue: SPR-11466
2014-08-14 22:29:21 +02:00
Juergen Hoeller 8dbfa80b13 Unit test for circular reference in default profile property, plus related polishing
Issue: SPR-12078
2014-08-12 19:23:36 +02:00
Juergen Hoeller ef51d4dbdb AnnotatedElementUtils adapts post-processed values to AnnotationAttributes as well
Issue: SPR-12065
2014-08-08 15:15:29 +02:00
Sebastien Deleuze 3922f6fc53 Update references to RFC 2616
Replace references to the old RFC 2616 (HTTP 1.1) with references
to the new RFCs 7230 to 7235.

This commit also deprecates:
 - HttpStatus.USE_PROXY
 - HttpStatus.REQUEST_ENTITY_TOO_LARGE in favor of HttpStatus.PAYLOAD_TOO_LARGE
 - HttpStatus.REQUEST_URI_TOO_LONG in favor of HttpStatus.URI_TOO_LONG

Issue: SPR-12067
2014-08-07 14:50:45 +02:00
David Haraburda d0e6f0f73f Change GenericConversionService to better handle enum
Prior to this commit, given an enum which implements some interface,
GenericConversionService would select the String -> Enum converter even
if a converter for String -> SomeInterface was registered.  This also
affected converters that were registered for String ->
SomeBaseInterface, when SomeInterface extended SomeBaseInterface.

This change modifies the behavior of the private method
getClassHierarchy() by placing Enum.class as late as possible, pretty
much the same way as Object.class is handled.

Issue: SPR-12050
2014-08-06 10:42:28 +02:00
Sam Brannen 6cfe76eeec Polish Javadoc for MutablePropertySources 2014-08-02 12:17:57 +03:00
Sam Brannen 154cf5dc7e Polish Javadoc for AnnotationCacheKey 2014-08-02 12:17:15 +03:00
Juergen Hoeller 8f484d382e Polishing 2014-07-29 11:42:37 +02:00
Juergen Hoeller 8cc0fa5ae1 Polishing 2014-07-28 22:05:40 +02:00
Juergen Hoeller a3163ceb88 AbstractTypeHierarchyTraversingFilter leniently ignores non-loadable super classes and interfaces
Issue: SPR-12042
2014-07-28 22:05:20 +02:00
Juergen Hoeller 0ce90f1d16 TypeDescriptor's getResolvableType() and getSource() are @since 4.0 2014-07-24 12:13:37 +02:00
Juergen Hoeller 9d6c38bd54 Consistent bracket alignment 2014-07-18 17:21:58 +02:00
Juergen Hoeller 48fea0bafa ClassUtils.isCacheSafe defensively catches SecurityException (for Google App Engine compatibility)
Issue: SPR-12002
2014-07-16 20:33:36 +02:00
Juergen Hoeller 4e25a14f6c Merge pull request #571 from sdeleuze/SPR-11820
Make ListenableFuture compliant with Java 8 lambda
2014-07-16 16:41:41 +02:00
Sebastien Deleuze 86e8bdab6b Make ListenableFuture compliant with Java 8 lambda
Make it possible to use a ListenableFuture with Java 8
lambda expressions, using a syntax like
listenableFuture.addCallback(() -> ..., () -> ...);

Issue: SPR-11820
2014-07-16 16:06:24 +02:00
Arjen Poutsma d6950d8add StaxStreamXMLReader ignores significant whitespace
The StaxStreamXMLReader no longer handles all whitespace as ignorable
whitespace.

Issue: SPR-12000
2014-07-16 13:16:20 +02:00
Juergen Hoeller c18b6bf0b7 NestedIOException can use IOException constructor with cause argument on JDK 6+ 2014-07-15 22:05:45 +02:00
Juergen Hoeller 2665d56209 Polishing 2014-07-15 15:13:35 +02:00
Rossen Stoyanchev ab2526a586 Update support for using "." as path separator
Issue: SPR-11660
2014-07-14 18:49:25 -04:00
Sebastien Deleuze 928a466b5d Allow to customize separator for messaging destinations
In order to be able to use separators like "." (used by default
by most broker relays) instead of "/" for destination patterns
handling, the PathMatcher used in spring-messaging can now
be customized easily thanks to XML websocket namespace
or JavaConfig.

AntPathMatcher has been updated in order to use the configured path
separator instead of an hardcoded "/" for path concatenation.
Extension handling is now disabled when the "." separator is configured.

Issue: SPR-11660
2014-07-14 18:49:24 -04:00
Juergen Hoeller 29f6f3d7e7 Test ASM5's bytecode parsing of INVOKESPECIAL/STATIC on interfaces
Issue: SPR-11979
2014-07-10 15:46:18 +02:00
Juergen Hoeller 0d4ff1adbf Polishing 2014-07-09 22:25:35 +02:00
Juergen Hoeller 1fadd1c954 BackOff abstraction lives in util.backoff subpackage now
Issue: SPR-11746
2014-07-09 21:53:32 +02:00
Juergen Hoeller bf9ccc8138 ExceptionTypeFilter and InstanceFilter live in util package itself now
Issue: SPR-9616
2014-07-09 21:43:19 +02:00
Juergen Hoeller 01264dc673 Polishing 2014-07-08 00:59:31 +02:00
Juergen Hoeller e90143e03b Polishing 2014-07-01 12:52:09 +02:00
Juergen Hoeller db616dc438 Polishing 2014-06-30 14:55:43 +02:00
Juergen Hoeller 682a910bb6 ReflectionUtils caches Class.getDeclaredMethods() results; AnnotationUtils caches findAnnotation results
Issue: SPR-11882
2014-06-27 17:07:06 +02:00
Juergen Hoeller 98d6f7b443 Polishing 2014-06-26 16:01:24 +02:00
Juergen Hoeller 938a2846c8 Avoid pattern matching in isCglibRenamedMethod as far as possible (for performance reasons)
Issue: SPR-11894
2014-06-24 21:07:08 +02:00
Juergen Hoeller d6635802c4 TypeDescriptor's nested type traversal leniently returns null in case of unresolvable nested type
Issue: SPR-11898
2014-06-24 20:57:09 +02:00
Juergen Hoeller 18131bf611 Consistent declaration of private static final logger variables
Issue: SPR-11905
2014-06-24 14:02:05 +02:00
Juergen Hoeller 2c0c081bbb AnnotationUtils defensively catches and logs unexpected exceptions from retrieval attempts (proceeding like the annotation wasn't there)
Issue: SPR-11874
2014-06-24 13:36:04 +02:00
Juergen Hoeller fd809cd18e AnnotationUtils defensively catches unexpected exceptions from retrieval attempts (proceeding like the annotation wasn't there)
This is analogous to what the JVM does for cases where the annotation type itself isn't present on the classpath. We're effectively extending that policy to values referenced within an annotation declaration.

Issue: SPR-11874
2014-06-24 11:01:37 +02:00
Juergen Hoeller d801f9da89 ResourceUtils isFileURL detects "vfsfile" as a file system protocol (again)
Issue: SPR-11887
2014-06-20 01:03:01 +02:00
Juergen Hoeller dfc370c368 PathMatchingResourcePatternResolver's findPathMatchingResources needs to check for VFS before checking isJarResource
Issue: SPR-11887
2014-06-19 23:09:12 +02:00
Juergen Hoeller ab5aea5a13 Defensively check javaUtilOptionalEmpty
Issue: SPR-11888
2014-06-19 21:25:46 +02:00
Juergen Hoeller ef25b9e7af ObjectToOptionalConverter needs to be marked as @UsesJava8 2014-06-18 23:39:19 +02:00
Rossen Stoyanchev bb4a9cca1b Add suppress warning in SettableListenableFuture 2014-06-16 17:06:52 -04:00
Rossen Stoyanchev 0640a32863 Revise SettableListenableFuture implementation
This change modifies the SettableListenableFuture implementation to use
internally a ListenableFutureTask created with a "settable" Callable.

Issue: SPR-11614
2014-06-16 15:37:30 -04:00
Mattias Severson 38b525aa9e Created SettableListenableFuture with tests
A SettableListenableFuture implementation of Spring's ListenableFuture
The class is inspired by Google Guava’s
com.google.common.util.concurrent.SettableFuture, but this
implementation uses ReentrantReadWriteLock and CountDownLatch
internally to handle thread synchronization.

Issue: SPR-11614
2014-06-16 15:14:12 -04:00
Rossen Stoyanchev 0dc6082b01 Support java.util.Optional for @MVC named value args
After this change, java.util.Optional is supported with @RequestParam,
@RequestHeader, and @MatrixVariable arguments in Java 8. When Optional
is used the required flag is effectively ignored.

Issue: SPR-11829
2014-06-16 14:16:56 -04:00
hengyunabc 4d328d6188 Improve StringUtils#trimAllWhitespace
Prior to this commit, StringUtils#trimAllWhitespace(String str) was
unecessary slower. Using sb.deleteCharAt(index) leads to a complete
copy of the char[]
2014-06-13 18:18:19 +02:00
Brian Clozel d746e3fbfa Rollback AntPathMatcher behavior for ".*" comparisons
Prior to this commit, AntPathMatcher had been refactored for SPR-6741.
During that process, a key feature has been removed:
When comparing two patterns, pattern elements (*, {}, etc) are counted
to score those patterns. When a pattern ends with ".*", the ending
wildcard should not be counted against pattern elements for this
pattern.

This commit reintroduces that behavior.

Issue: SPR-6741
2014-06-11 20:51:09 +02:00
Rossen Stoyanchev ce0473f926 Further encapsulate AntPatternComparator$PatternInfo
Issue: SPR-6741
2014-06-11 20:51:09 +02:00
Brian Clozel f829cd1b35 Fix "**" precedence in AntPathMatcher comparator
Prior to this commit, "**" and "*" pattern elements had
the same priority when comparing two patterns.
So when comparing several patterns, the computed order was:
1- /hotels/{hotel}/bookings/{booking}
2- /hotels/**
3- /hotels/{hotel}/bookings/{booking}/customer/{customer}

This commit updates the comparator so that patterns ending
with "**" (a.k.a "catch-all" patterns) are less specific than
the others; in the previous example, the 2nd pattern would
then end up last.

This commit also optimizes the comparator implementation.

Issue: SPR-6741
2014-06-11 20:51:09 +02:00
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
Phillip Webb 15698860e1 General polish of new 4.0 classes
Apply consistent styling to new classes introduced in Spring 4.0.

- Javadoc line wrapping, whitespace and formatting
- General code whitespace
- Consistent Assert.notNull messages
2013-11-26 15:11:18 -08:00
Phillip Webb a31ac882c5 Fix various javadoc warnings 2013-11-26 13:25:37 -08:00
Rossen Stoyanchev ce3e55743f Extract IdGenerator into a top-level class 2013-11-25 21:50:47 -05:00
Juergen Hoeller 1ee816b473 Re-introduced custom StaxSource and StaxResult for Spring Web Services 2013-11-26 01:40:34 +01:00
Eric Dahl e9f78f6043 Fix various typos
Fix a variety of typos throughout the project, primarily in
comments (javadoc or otherwise) but also in a handful of log messages
and a couple exception messages.

ISSUE: SPR-11123
2013-11-25 15:58:27 -08:00
Phillip Webb 59002f2456 Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.

Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.

Issue: SPR-11064
2013-11-25 12:52:42 -08:00
Juergen Hoeller f39bb02628 Polishing 2013-11-22 23:29:54 +01:00
Sam Brannen 44c5eaeaa3 Fix typo in Javadoc 2013-11-22 16:17:20 +01:00
Sam Brannen a613126be0 Polish AnnotationUtils
- Added explicit reference to “get” and “find” lookup types in the
  class-level Javadoc.
- Updated documentation for the underlying algorithms in
  findAnnotation(Method,Class) and findAnnotation(Class,Class) in line
  with the status quo.
- Reverted recent changes to findAnnotationDeclaringClass() by removing
  meta-annotation support in order to maintain backwards compatibility
  with previous releases.
2013-11-22 14:39:51 +01:00
Sam Brannen 3200f3e9a7 Polish Javadoc for TestGroup 2013-11-21 10:53:57 +01:00
Sam Brannen cfe7a525e2 Revert accidental changes to TestGroupTests 2013-11-21 10:52:53 +01:00
Phillip Webb 4385da7b84 Support for 'all excluding' test groups 2013-11-20 21:26:17 -08:00
Sam Brannen b830d7362d Support non-public anno. attr. values in AnnoUtils
Prior to this commit, the getValue(Annotation, String) method in
AnnotationUtils failed to retrieve the value of the desired annotation
attribute if the annotation itself was not public -- for example if the
annotation was declared as package private.

This commit addresses this issue by ensuring that getValue(Annotation,
String) uses reflection to make the desired annotation attribute method
accessible before attempting to invoke it to retrieve the value.

Issue: SPR-11104
2013-11-20 21:58:36 +01:00
Juergen Hoeller b093b84954 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
2013-11-04 00:19:55 +01:00
Juergen Hoeller 9f3b8a2430 GenericTypeResolver's resolveTypeArguments needs to return null for raw types (for backwards compatibility with 3.2)
Issue: SPR-11052
2013-10-31 15:28:20 +01:00
Phillip Webb d371886988 Allow null method for getTransactionAttribute
Update MatchAlwaysTransactionAttributeSource.getTransactionAttribute
to allow a null method argument. Passing a null method is not
recommended and is not indicated as valid in the Javadoc, however,
this was allowed in previous versions of Spring.

Issue: SPR-11048
2013-10-30 22:43:29 -07:00
Juergen Hoeller b69ebe70a6 Consistent javadoc references to java.util.concurrent and javax.enterprise.concurrent 2013-10-31 01:13:58 +01:00
Juergen Hoeller 3402628a74 Polishing 2013-10-30 22:06:51 +01:00
Juergen Hoeller 9cbac985fb Refined check for cache turnoff threshold
Issue: SPR-10803
2013-10-30 19:28:08 +01:00
Phillip Webb e5aef5ee9d Protect against NPE when resolving generic array
Update ResolvableType to check that the resolved component type from
a generic array is not null before attempting to use it to generate the
resolved array class.

Issue: SPR-11044
2013-10-30 10:50:55 -07:00
Juergen Hoeller 4bcfbc3ba3 Apply name-matching transaction attributes to user-level methods only
In particular, do not apply them to GroovyObject methods and other kinds of synthetic methods in language runtimes. The only exception are bridge methods since those do eventually point to a user-level generic method.

Issue: SPR-10803
2013-10-30 12:38:45 +01:00
Juergen Hoeller bfa30913fb Polishing 2013-10-30 00:53:55 +01:00
Juergen Hoeller 326154270f Refined caching of AntPathStringMatcher per pattern
Introduced a "setCachePatterns(boolean)" method for explicit configuration, a default turnoff threshold at 65536 entries (at which point we're deciding that caching isn't worthwhile because patterns are unlikely to be reoccurring often enough), and an "AntPathStringMatcher getStringMatcher(String pattern)" template method.

Issue: SPR-10803
2013-10-30 00:53:18 +01:00
Sam Brannen 5e7021f3f7 Provide meta-annotation support in the TCF
Spring 3.0 already allows component stereotypes to be used in a
meta-annotation fashion, for example by creating a custom
@TransactionalService stereotype annotation which combines
@Transactional and @Service in a single, reusable, application-specific
annotation. However, the Spring TestContext Framework (TCF) currently
does not provide any support for test-related annotations to be used as
meta-annotations.

This commit overhauls the TCF with regard to how annotations are
retrieved and adds explicit support for the following annotations to be
used as meta-annotations in conjunction with the TCF.

- @ContextConfiguration
- @ContextHierarchy
- @ActiveProfiles
- @DirtiesContext
- @IfProfileValue
- @ProfileValueSourceConfiguration
- @BeforeTransaction
- @AfterTransaction
- @TransactionConfiguration
- @Rollback
- @TestExecutionListeners
- @Repeat
- @Timed
- @WebAppConfiguration

Note that meta-annotation support for @Transactional was already
available prior to this commit.

The following is a summary of the major changes included in this commit.

- Now using AnnotationUtils.getAnnotation() instead of
  Class.getAnnotation() where appropriate in the TestContext Framework.
- Now using AnnotationUtils.findAnnotation() instead of
  Class.isAnnotationPresent() where appropriate in the TestContext
  Framework.
- Introduced findAnnotationPrefersInteracesOverLocalMetaAnnotations() in
  AnnotationUtilsTests in order to verify the status quo.
- AnnotationUtils.findAnnotationDeclaringClass() and
  AnnotationUtils.findAnnotationDeclaringClassForTypes() now support
  meta annotations.
- Introduced MetaAnnotationUtils and AnnotationDescriptor in the
  spring-test module.
- Introduced UntypedAnnotationDescriptor in MetaAnnotationUtils.
- Introduced findAnnotationDescriptorForTypes() in MetaAnnotationUtils.
- ContextLoaderUtils now uses MetaAnnotationUtils for looking up
  @ActiveProfiles as a potential meta-annotation.
- TestContextManager now uses MetaAnnotationUtils for looking up
  @TestExecutionListeners as a potential meta-annotation.
- DirtiesContextTestExecutionListener now uses AnnotationUtils for
  looking up @DirtiesContext as a potential meta-annotation.
- Introduced DirtiesContextTestExecutionListenerTests.
- ProfileValueUtils now uses AnnotationUtils for looking up
  @IfProfileValue and @ProfileValueSourceConfiguration as potential
  meta-annotations.
- @BeforeTransaction and @AfterTransaction now support ANNOTATION_TYPE
  as a target, allowing them to be used as meta-annotations.
- TransactionalTestExecutionListener now uses AnnotationUtils for
  looking up @BeforeTransaction, @AfterTransaction, @Rollback, and
  @TransactionConfiguration as potential meta-annotations.
- Introduced TransactionalTestExecutionListenerTests.
- @Repeat and @Timed now support ANNOTATION_TYPE as a target, allowing
  them to be used as meta-annotations.
- SpringJUnit4ClassRunner now uses AnnotationUtils for looking up
  @Repeat and @Timed as potential meta-annotations.
- Moved all remaining logic for building the MergedContextConfiguration
  from the DefaultTestContext constructor to
  ContextLoaderUtils.buildMergedContextConfiguration().
- Verified meta-annotation support for @WebAppConfiguration and
  @ContextConfiguration.

Issue: SPR-7827
2013-10-28 01:33:17 +01:00
Phillip Webb 2e1c035d42 Increased ResolvableType unit test coverage
Issue: SPR-11034
2013-10-26 09:33:40 -07:00
Juergen Hoeller 6cfbcf4f17 Avoid NPE in hasUnresolvableGenerics()
Issue: SPR-11034
2013-10-26 17:59:51 +02:00
Juergen Hoeller 231433f540 Polishing
(cherry picked from commit 6021822)
2013-10-26 17:37:11 +02:00
Juergen Hoeller 2d91309fdf Fixed detection of setter in case of getter with covariant return type narrowing
Issue: SPR-10995
(cherry picked from commit 045f78e)
2013-10-26 17:36:50 +02:00
Phillip Webb e7f89f87c1 Fix off-by-one error in parseLocaleString
Fix off-by-one error in StringUtils.parseLocaleString()

Issue: SPR-10364
2013-10-25 18:25:43 -07:00
Phillip Webb e80b7d1e22 Add getSource() to ResolvableType & TypeDescriptor
Add getSource() method to ResolvableType and TypeDescriptor allowing
access to the underlying source field or method parameter when possible.

Primarily added to provide access to additional type information or
meta-data that alternative JVM languages may provide.

Issue: SPR-10887
2013-10-25 18:14:41 -07:00
Phillip Webb 1a3ba79071 Restore prior resolveTypeArguments behavior
Restore prior behavior of GenericTypeResolver.resolveTypeArguments to
never include null elements in the returned array.

Issue: SPR-11030
2013-10-25 17:26:57 -07:00
Juergen Hoeller 0851766738 Accept non-generic type match as a fallback
DefaultListableBeanFactory performs a fallback check for autowire candidates now, which GenericTypeAwareAutowireCandidateResolver implements to accept raw type matches if the target class has unresolvable type variables. Full generic matches are still preferred; the BeanFactory will only start looking for fallback matches if the first pass led to an empty result.

Issue: SPR-10993
Issue: SPR-11004
2013-10-25 17:52:38 +02:00
Juergen Hoeller 833d76ba5e Upgraded to ASM 4.2 2013-10-25 13:29:20 +02:00
Phillip Webb e95bd9e250 Add @PropertySources and ignoreResourceNotFound
Support repeatable @PropertySource annotations in Java 8 and add
@PropertySources container annotation for Java 6/7. Also add an
ignoreResourceNotFound attribute to @PropertySource allowing missing
property resources to be silently ignored.

This commit also introduces some generally useful methods to
AnnotationUtils for working with @Repeatable annotations.

Issue: SPR-8371
2013-10-22 11:15:50 -07:00
Rossen Stoyanchev bafc73f147 Integrate suggested support for creating MVC URLs
The key contract is MvcUrls. An instance is automatically created with
the Spring MVC namespace and the MVC Java config but can also be easily
created in any configuration.

Some example tests can be found in DefaultMvcUrlsTests.

Issue: SPR-10665, SPR-8826
2013-10-21 16:26:08 -04:00
Oliver Gierke 4fd27b12fc Introduced MvcUriComponentsBuilder to create URIs pointing to controller methods.
MvcUriComponentsBuilder allows creating URIs that point to Spring MVC
controller methods annotated with @RequestMapping. It builds them by
exposing a mock method invocation API similar to Mockito, records the
method invocations and thus builds up the URI by inspecting the mapping
annotations and the parameters handed into the method invocations.

Introduced a new SPI UriComponentsContributor that should be implemented 
by HandlerMethodArgumentResolvers that actually contribute path segments 
or query parameters to a URI. While the newly introduced 
MvcUriComponentsBuilder looks up those UriComponentsContributor instances 
from the MVC configuration.

The MvcUriComponentsBuilderFactory (name to be discussed - MvcUris maybe?) 
prevents the multiple lookups by keeping the UriComponentsBuilder 
instances in an instance variable. So an instance of the factory could 
be exposed as Spring bean or through a HandlerMethodArgumentResolver to 
be injected into Controller methods.

Issue: SPR-10665, SPR-8826
2013-10-21 16:26:07 -04:00
Phillip Webb 79048e18be Allow TypeDescriptor create with null generics
Restore the ability to create a TypeDescriptor for a collection or
map where the generics may be null.

Issue: SPR-11006
2013-10-18 10:58:05 -07:00
Phillip Webb 57a36f3f56 Support for MultiValueMap in MapToMapConverter
Refactor TypeDescriptor to use ResolvableType in order to retain full
generic type information, in the process fixing MultiValueMap support
in MapToMapConverter.

Issue: SPR-9499
2013-10-17 13:48:02 -07:00
Phillip Webb f29092db23 Polish ResolvableType & SerializableTypeWrapper
Fix 'missing serialVersionUID' warnings, support for void.class types
and refine resolve() algorithm to support narrowed types.

Issue: SPR-10973
2013-10-17 13:48:02 -07:00
Phillip Webb 3337fd32cb Refine ResolvableType class
- Support for serialization
- Allow programmatic creation of an array from a given component type
- Allow programmatic creation with given generics
- Extract generics from Class types using Class.getTypeParameters()
- Move TypeVariableResolver to an inner class (and make method private)
- Refine 'resolve()' algorithm

Issue: SPR-10973
2013-10-16 23:45:51 -07:00
Sam Brannen 079bebcfb5 Delete unused import in StdReflParamNameDscoverer 2013-10-15 15:24:25 +02:00
Sam Brannen 8fdc7d4e8f Polish type prediction for generic factory methods
- Now avoiding NullPointerExceptions in GenericTypeResolver's
   resolveReturnTypeForGenericMethod() in case the supplied ClassLoader
   is null.
 - AutowireUtils.resolveReturnTypeForFactoryMethod() now properly
   asserts that the supplied ClassLoader is not null.
 - Fixed copy-n-paste errors in Javadoc for
   AutowireUtils.resolveReturnTypeForFactoryMethod().

Issue: SPR-10411
2013-10-15 15:21:47 +02:00
Sam Brannen e86e182d5d Reinstate deleted @author tag
SPR-10411
2013-10-15 15:09:05 +02:00
Juergen Hoeller 3bd6dfe047 Autowiring of generic types
Includes revisions of MethodParameter and DependencyDescriptor (in particular towards a reference to the containing class). Also refines several ResolvableType method signatures.

Issue: SPR-9965
2013-10-15 00:11:23 +02:00
Juergen Hoeller 8b1927f3ec 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
2013-10-14 23:50:04 +02:00
Sam Brannen 977c8c7137 Polish Javadoc for ResolvableType 2013-10-14 17:57:16 +02:00
Phillip Webb ee8f1aa61a Clarify ResolvableType.resolve() Java Doc
Issue: SPR-10973
2013-10-10 11:58:21 -07:00
Phillip Webb 5358cc0f5f Fix ResolvableType isAssignableFrom for <?>
Fix ResolvableType.isAssignableFrom to correctly deal with <?> style
generics.

Issue: SPR-10973
2013-10-10 09:22:22 -07:00
Phillip Webb 501a1cbb5d Refactor from deprecated GenericTypeResolver calls
Refactor AbstractMessageConverterMethodArgumentResolver and
BridgeMethodResolver to use ResolvableType in preference to deprecated
GenericTypeResolver calls.

Issue: SPR-10980
2013-10-10 00:19:51 -07:00
Phillip Webb fdf0ef40c0 Use ResolvableType in GenericCollectnTypeResolver
Refactor GenericCollectionTypeResolver to make use of ResolvableType
for generic resolution.

Issue: SPR-10977
2013-10-10 00:19:51 -07:00
Phillip Webb 595efe9aab Use ResolvableType in GenericTypeResolver
Refactor GenericTypeResolver to make use of ResolvableType
for generic resolution.

Issue: SPR-10978
2013-10-10 00:19:51 -07:00
Phillip Webb 6a18b0048d Introduce ResolvableType Class
Add a new ResolvableType Class which encapsulates java.lang.reflect.Type,
providing access to supertypes, interfaces and generic parameters along
with the ability to ultimately resolve to a java.lang.Class.

ResolvableTypes may be obtained from fields, method parameters, method
returns, classes or directly from a java.lang.reflect.Type. Most methods
will themselves return ResolvableTypes, allowing easy navigation.

For example:

	private HashMap<Integer, List<String>> myMap;

	public void example() {
 		ResolvableType t = ResolvableType.forField(
 					getClass().getDeclaredField("myMap"));
 		t.getSuperType(); // AbstractMap<Integer, List<String>>;
 		t.asMap(); // Map<Integer, List<String>>
 		t.getGeneric(0).resolve(); // Integer
 		t.getGeneric(1).resolve(); // List
 		t.getGeneric(1); // List<String>
 		t.resolveGeneric(1, 0); // String
 	}

Issue: SPR-10973
2013-10-10 00:19:50 -07:00
Juergen Hoeller 4574528a27 Comprehensive update to the framework's TimeZone handling, including a new TimeZoneAwareLocaleContext and a LocaleContextResolver for Spring MVC
A few noteworthy minor changes: LocaleContext.getLocale() may return null in special cases (not by default), which our own accessing classes are able to handle now. If there is a non-null TimeZone user setting, we're exposing it to all collaborating libraries, in particular to JSTL, Velocity and JasperReports. Our JSR-310 and Joda-Time support falls back to checking the general LocaleContext TimeZone now, adapting it to their time zone types, if no more specific setting has been provided. Our DefaultConversionService has TimeZone<->ZoneId converters registered. And finally, we're using a custom parseTimeZoneString method now that doesn't accept the TimeZone.getTimeZone(String) GMT fallback for an invalid time zone id anymore.

Issue: SPR-1528
2013-10-04 23:14:08 +02:00
Juergen Hoeller bd4c64af04 Turned ByteBufferConverter's visibility to package level 2013-10-04 22:52:14 +02:00
Phillip Webb 8abe949734 Fix ArrayStoreException reading subclassed enums
Fix ASM AnnotationAttributesReadingVisitor to correctly deal with
subclasses enums.

Issue: SPR-10914
2013-09-27 11:25:57 -07:00
Rob Winch 0ee910c61a Add test for StandardReflectionParameterNameDiscoverer
Added test to StandardReflectionParameterNameDiscoverer that
demonstrates discovering of parameter names on an interface.

Issue: SPR-9643
2013-09-13 21:23:44 -07:00
Sam Brannen 41fffdcf7b Polish Javadoc in ResourceUtils 2013-09-12 16:28:14 +02:00
Arjen Poutsma d0aa158aef Added ListenableFuture interface
Added extension to Future with capabilities for registering callbacks
when the future is complete.

- Added ListenableFuture, ListenableFutureCallback,
  ListenableFutureCallbackRegistry, and ListenableFutureTask.
- Using ListenableFuture in AsyncRestOperations/AsyncRestTemplate.
- Added AsyncListenableTaskExecutor, implemented in
  SimpleAsyncTaskExecutor.
- Added FutureAdapter and ListenableFutureAdapter.
2013-09-04 14:32:47 +02:00
Juergen Hoeller caa1218d36 Polishing 2013-08-29 19:17:59 +02:00
Juergen Hoeller c664010001 Added conversion support for Java 8's ZoneId class and the 'of' method convention
Issue: SPR-1528
2013-08-29 19:15:22 +02:00
Antonio Marrero 57f7b14b49 Assign lowest priority to `/**` pattern
Update AntPathMatcher Comparator to treat `/**` in the same way as
`null` paths.

Prior to this commit the pattern `/**` would be picked in preference
to patterns with 3 or more PathVariable (e.g. `/matches/{matchId}/
periods/{periodId}/teams/{teamId}/results`).

Issue: SPR-10550
2013-08-28 17:14:37 -07:00
Phillip Webb c1dafed886 Refine AntPathMatcher.combine when p1 contains '.'
Refine AntPathMatcher.combine rules to allow direct concatenation of
patterns when pattern1 does not contain '*.'. Prior to this commit
direct concatenation was allowed when pattern1 did not contain '.',
this prevented calls of the form:

	pathMatcher.combine("/1.0", "/foo/test")

from working as expected.

This commit also applies some general cleanup to the `combine` method.

Issue: SPR-10554
2013-08-28 14:30:08 -07:00
Juergen Hoeller 465e6292eb Javadoc fixes 2013-08-28 22:16:08 +02:00
Juergen Hoeller 4447248a83 Introduced support for @Lazy on injection points
This turned into a rather huge affair since it led to the introduction of a new AutowireCandidateResolver implementation in the spring-context module. That ACR impl is now being set through AnnotationConfigUtils; GenericApplicationContext and co do not set a default QualifierAnnotationAutowireCandidateResolver anymore (which has always been a smell anyway).  At the same time, dependency ordering has moved from AutowiredAnnotationBeanPostProcessor to DefaultListableBeanFactory itself through a "dependencyComparator" strategy, applying to constructor dependencies and lazy resolution proxies as well.

Issue: SPR-10353
2013-08-28 00:14:39 +02:00
Juergen Hoeller 8f90eacd92 Polishing 2013-08-26 20:04:40 +02:00
Rossen Stoyanchev 1fd7bc3ee5 Make MediaType serializable
Issue: SPR-8738
2013-08-22 16:05:44 -04:00
Juergen Hoeller 4a9af233ae @Autowired/@Inject with array/List value gets sorted against Ordered/@Order
Issue: SPR-5574
2013-08-22 16:43:10 +02:00
Juergen Hoeller f2fb0ec9e7 Minor polishing of related files
Issue: SPR-10181
2013-08-21 17:37:06 +02:00
Juergen Hoeller 6d3649858e Allow meta-annotations to override attributes from their parent
Issue: SPR-10181
2013-08-21 17:35:56 +02:00
Juergen Hoeller ea6525f15f GenericTypeResolver properly handles bound parameterized type
Issue: SPR-10819
2013-08-20 19:36:57 +02:00
Juergen Hoeller 1420b970a7 Introduced DefaultParameterNameDiscoverer which checks JDK 8's standard reflection first and then falls back to ASM-based debug symbol analysis
Also, StandardReflectionParameterNameDiscoverer calls "Parameter.isNamePresent()" now to return null (and pass on to the next discoverer) if no JDK 8 parameters are available. Note that this requires OpenJDK 8 b100 or higher to compile now.

Issue: SPR-10532
2013-08-08 15:52:43 +02:00
Rossen Stoyanchev eb4579b4d4 Extract MimeType as a base class of MediaType
MimeType is available in core-spring and does not include support
for quality parameters and media used in HTTP content negotiation.
The MediaType sub-class in org.springframework.http adds q-parameters.
2013-08-07 13:21:37 -04:00
Rossen Stoyanchev 15a2f03459 Polish SockJS exception handling and javadoc
See javadoc in SockJsService for details.

Also remove ReadOnlyMultiValueMap, CollectionUtils has a method for
that already.
2013-08-03 11:03:27 -04:00
Rossen Stoyanchev a03517fa35 Polish ServletServerHttpRequest query param handling
The method returning query parameters now returns only query string
parameters as opposed to any Servlet request parameter.

This commit also adds a ReadOnlyMultiValueMap.
2013-08-02 17:40:08 -04:00
Juergen Hoeller 85c9ed005d Fixed misunderstanding with respect to excludeUnlistedClasses default in JPA 2.0
Issue: SPR-10767
(cherry picked from commit d0948f1)
2013-08-01 00:20:21 +02:00
Juergen Hoeller 127b91fd4f PropertySourcesPlaceholderConfigurer's "ignoreUnresolvablePlaceholders" setting reliably applies to nested placeholders as well
Issue: SPR-10549
2013-07-31 17:50:44 +02:00
Rob Winch f7c0795c1a Add TestGroup.CUSTOM_COMPILATION
Previously building with JDK > 1.8 b88 caused test failures due to errors
with custom compilers like Jibx and Jasper reports.

This commit adds a new TestGroup named CUSTOM_COMPILATION that allows the
CI server to continue to run these tests but allow committers to ignore
these tests.
2013-07-24 09:29:17 -05:00
Juergen Hoeller 2d1b44202b OpenJDK 8 build 99: annotation discovery on bridge methods 2013-07-24 13:36:59 +02:00
Nick Williams e59c821603 Fix PathResourceTests on Windows
Fix PathResourceTests so that paths are accessed in a platform
independent manor.

Issue: SPR-10770
2013-07-23 14:48:25 -07:00
Phillip Webb 9eb596a7e5 Make TypeDescriptor serializable
Issue: SPR-10631
2013-07-23 14:17:19 -07:00
Phillip Webb 587877c6da Add MemorySafeUndeclaredThrowableStrategy
Port the latest unreleased UndeclaredThrowableStrategy implementation
from cglib to fix a memory-leak present in v3.

Issue: SPR-10709
2013-07-19 14:36:19 -07:00
Phillip Webb 9dba73dfc9 Add ConversionService support for ByteBuffers
Add ByteBufferConverter that is registered by default with the
DefaultConversionService. Allows conversion from/to a ByteBuffer and
byte[] or to any type that can be converted via a byte[].

Issue: SPR-10712
2013-07-01 13:12:52 -07:00
Sam Brannen f311bf3daf Introduce TCP & UDP server port scanning utility
Prior to this commit the Spring Framework did not provide a public means
for scanning for available server ports. However, the Spring Framework
internally used a FreePortScanner in integration tests within its own
test suite. Furthermore, Spring Integration 2.2 provides similar support
in a SocketUtils class in the spring-integration-test module.

This commit introduces SocketUtils in spring-core to replace the
FreePortScanner which was previously only used internally within
Spring's test suite. This new implementation is inspired by both Spring
Framework's FreePortScanner and Spring Integration's SocketUtils and
consequently attempts to merge the best of both previous
implementations.

Issue: SPR-8032
2013-06-15 13:46:32 +02:00
Sam Brannen 97d152547d Reformatted GenericTypeResolverTests 2013-06-09 00:24:37 +02:00
Phillip Webb 5377fae7f5 Remove duplicate Javadoc line from PathResource
Remove duplicate Javadoc comment from PathResource that was
accidentally introduced during the merge.

Issue: SPR-10608
2013-06-03 22:10:57 -07:00
Philippe Marschall 2313c9a007 Introduce java.nio.file.Path based Resource
Develop new org.springframework.core.io.Resource implementation
backed by java.nio.file.Path. Primarily developed to allow custom
file system implementations to be used with Spring.

Since the minimum requirement for Spring is still Java 6 the
existing FileSystemResource can't be retrofitted (and no #getPath
method can be added to the Resource interface).

Unlike FileSystemResource, PathResource delegates to the underlying
file system instead of StringUtils. It has therefore slightly
different semantics. First, when building relative resources via
createRelative the relative path will apply to this path (like URL or
Unix). Second, equality is delegated to the underlying file system
provider so it's case-insensitive on Windows.

Issue: SPR-10608
2013-06-03 16:25:45 -07:00
Chris Beams 46d47fef9a Polish pull request #291 per committer guidelines
- Update Apache license headers
 - Remove trailing whitespace
 - Edit original commit comment to use 'Issue:' syntax
 - Revert use of diamond operator (<>) in main sources

See committer guidelines at
https://github.com/SpringSource/spring-framework/blob/master/CONTRIBUTING.md

Issue: SPR-10579
2013-05-28 13:51:35 +02:00
Dave Syer 7860af8624 Make CommandLinePropertySource enumerable
JOpt 4.4 has enumerable options, so this change can be made
if we upgrade. The only awkward thing is that JOpt allows
aliases for options, so we have to pick one to avoid double
counting. This implementation picks the last one in the list
which is the alphebtically last of the long options, if there
are any (e.g. "o1", "option1" returns "option1"). Most of the
time there will only be one or two aliases for each option so
it won't matter.

Issue: SPR-10579
2013-05-28 12:57:01 +02:00
Phillip Webb 6fe50b502f Enforce JDK version on CI server
Add a test to ensure that the CI server does not accidentally build
with the wrong JDK version.

Issue: SPR-10569
2013-05-16 17:06:30 -07:00
Juergen Hoeller 814d24e64f Consistent detection of Order annotation in superclasses and interfaces
Issue: SPR-10514
2013-05-16 18:05:56 +02:00
Juergen Hoeller 16548d23e9 Consistent use of Class<?> in Assert 2013-05-16 16:10:36 +02:00
Juergen Hoeller 7e01578515 Avoid unnecessary creation of default StandardEnvironment instances
Issue: SPR-10568
2013-05-15 23:41:32 +02:00
Juergen Hoeller 25e29b851d GenericTypeResolver defensively calls Class.getGenericSuperclass() and consistently uses Class<?>
Issue: SPR-10559
2013-05-14 16:02:52 +02:00
Rob Winch 9468548116 Add @Override to remaining source files
Issue: SPR-10130
2013-05-13 17:04:56 -05:00
Juergen Hoeller 1f0f46fb06 ServletContextResourcePatternResolver uses encoded jar file location for UrlResource
Adding overloaded constructors for URI specification to UrlResource, as a convenience.

Issue: SPR-10471
2013-05-10 22:11:40 +02:00
Phillip Webb 8e445f3a21 Extend AnnotationMetadata and MethodMetadata
Update AnnotationMetadata and MethodMetadata to extend from a new
AnnotatedTypeMetadata base interface containing the methods that are
common to both. Also introduce new getAllAnnotationAttributes methods
providing MultiValueMap access to both annotation and meta-annotation
attributes.

Existing classreading and standard implementations have been
refactored to support the new interface.
2013-05-08 19:41:20 -07:00
Phillip Webb 0652febe34 Make Make ClassPathContextResource protected
Allow ClassPathContextResource to be accessed by subclasses of
DefaultResourceLoader.

Issue: SPR-10544
2013-05-08 15:16:43 -07:00
Juergen Hoeller 2a44228b98 Consistent use of <pre class="code">
Issue: SPR-8108
2013-05-07 21:31:26 +02:00
Phillip Webb e1c25ff1a3 Workaround jasper report test fail on OSX
Add temporary Assume.canLoadNativeDirFonts() method allowing failing
jasper report tests to be bypassed on OSX.

This should be revisited when JDK 8 is released.

Issue: SPR-10537
2013-05-07 08:23:46 -07:00
Phillip Webb 2c887248f0 Make SpringFactoriesLoader.loadFactoryNames public
Update the SpringFactoriesLoader static loadFactoryNames method from
private to public.

Issue: SPR-10528
2013-05-06 15:32:52 -07:00
Sam Brannen 95c1255452 Updated JdkVersion regarding Java 9 support
- JdkVersion#JAVA_19 is now properly set to 6 instead of 5.
 - Javadoc for getMajorJavaVersion() now references currently supported
   Java versions.
2013-05-05 16:19:11 +02:00
Juergen Hoeller b9ca0fb947 Compatibility of JDK 8 compiled reflection API usage with JDK <8 runtimes
Specifically, we need to avoid "... ? this.method : this.constructor" expressions since those potentially select java.lang.reflect.Executable (which is only available on JDK 8) as common type and hardcode this into the generated bytecode (which therefore becomes JDK 8 dependent).
2013-05-03 17:28:58 +02:00
Juergen Hoeller 0a8f5b2919 Removed deprecated helper classes and methods (that have been deprecated since 3.0 or before) 2013-05-02 17:25:10 +02:00
Juergen Hoeller 9f9b972f00 Prepared for JDK 1.9
Aiming for the JdkVersion class to support one generation ahead now, in order for the test suite to properly detect 1.7/1.8+ JVMs even when running against a JDK 1.9 preview at some point.
2013-05-02 11:40:16 +02:00
Juergen Hoeller 0ea17c8382 Allow for reuse of key visitor classes in tooling
Based on https://github.com/SpringSource/spring-framework/pull/263
2013-04-30 21:31:22 +02:00
Juergen Hoeller 06fdfb0b0d Fixed annotation attribute processing for enum arrays
Based on https://github.com/SpringSource/spring-framework/pull/263
2013-04-30 21:30:27 +02:00
Juergen Hoeller 506f6a7c57 Adapter for JDK 8's standard parameter name reflection facilities
Issue: SPR-9643
2013-04-23 14:00:24 +02:00
Juergen Hoeller cd996ba18f Upgrading to JDK 1.8 bytecode along with ASM 4.1 patch
ASM has been patched to accept 1.8 bytecode simply through removing an assertion. As a consequence, we have an embedded copy of the ASM sources now instead of jarjar'ing the original ASM jar. The sources originate from ASM 4.1; for CGLIB 3.0 compatibility, a further assertion has been removed.

Issue: SPR-9639
2013-04-23 13:57:26 +02:00
Juergen Hoeller d3a4068768 Minimized ASM usage
In particular, avoid accidental usage of ASM for core JDK types - which will fail in case of a new bytecode version in the JDK, even if the application itself has been compiled with an earlier bytecode target.

Issue: SPR-10292
2013-04-23 13:49:25 +02:00
Juergen Hoeller e11cf5f061 Upgraded JdkVersion and CollectionFactory to JDK 1.6+, also removing deprecated methods from CollectionFactory 2013-03-28 23:27:17 +01:00
Juergen Hoeller 5472e975f6 Removed deprecated core.enums package 2013-03-19 23:31:50 +01:00
Juergen Hoeller ebb3d32ea8 Removed deprecated core.enums package 2013-03-19 23:14:55 +01:00
Juergen Hoeller 9c52ae9558 Removed OC4J support (including documentation references) 2013-03-19 14:53:26 +01:00
Juergen Hoeller 7f0a780925 StaxUtils relies on JAXP 1.4 (as included in JDK 1.6+) 2013-03-19 13:15:05 +01:00
Juergen Hoeller 87e5f19c3f JDK 1.6+ API baseline across the codebase 2013-03-19 13:10:25 +01:00
Phillip Webb 4e1cab28df Merge branch '3.2.x'
* 3.2.x: (28 commits)
  Hide 'doc' changes from jdiff reports
  Document @Bean 'lite' mode vs @Configuration
  Final preparations for 3.2.2
  Remove Tiles 3 configuration method
  Polishing
  Extracted buildRequestAttributes template method from FrameworkServlet
  Added "beforeExistingAdvisors" flag to AbstractAdvisingBeanPostProcessor
  Minor refinements along the way of researching static CGLIB callbacks
  Compare Kind references before checking log levels
  Polish Javadoc in RequestAttributes
  Fix copy-n-paste errors in NativeWebRequest
  Fix issue with restoring included attributes
  Add additional test for daylight savings glitch
  Document context hierarchy support in the TCF
  Fix test for daylight savings glitch
  Make the methodParameter field of HandlerMethod final
  Disable AsyncTests in spring-test-mvc
  Reformat the testing chapter
  Document context hierarchy support in the TCF
  Document context hierarchy support in the TCF
  ...
2013-03-13 14:01:46 -07:00
Sam Brannen 98074e7762 Provide support for context hierarchies in the TCF
Prior to this commit the Spring TestContext Framework supported creating
only flat, non-hierarchical contexts. There was no easy way to create
contexts with parent-child relationships.

This commit addresses this issue by introducing a new @ContextHierarchy
annotation that can be used in conjunction with @ContextConfiguration
for declaring hierarchies of application contexts, either within a
single test class or within a test class hierarchy. In addition,
@DirtiesContext now supports a new 'hierarchyMode' attribute for
controlling context cache clearing for context hierarchies.

- Introduced a new @ContextHierarchy annotation.
- Introduced 'name' attribute in @ContextConfiguration.
- Introduced 'name' property in ContextConfigurationAttributes.
- TestContext is now aware of @ContextHierarchy in addition to
  @ContextConfiguration.
- Introduced findAnnotationDeclaringClassForTypes() in AnnotationUtils.
- Introduced resolveContextHierarchyAttributes() in ContextLoaderUtils.
- Introduced buildContextHierarchyMap() in ContextLoaderUtils.
- @ContextConfiguration and @ContextHierarchy may not be used as
  top-level, class-level annotations simultaneously.
- Introduced reference to the parent configuration in
  MergedContextConfiguration and WebMergedContextConfiguration.
- Introduced overloaded buildMergedContextConfiguration() methods in
  ContextLoaderUtils in order to handle context hierarchies separately
  from conventional, non-hierarchical contexts.
- Introduced hashCode() and equals() in ContextConfigurationAttributes.
- ContextLoaderUtils ensures uniqueness of @ContextConfiguration
  elements within a single @ContextHierarchy declaration.
- Introduced CacheAwareContextLoaderDelegate that can be used for
  loading contexts with transparent support for interacting with the
  context cache -- for example, for retrieving the parent application
  context in a context hierarchy.
- TestContext now delegates to CacheAwareContextLoaderDelegate for
  loading contexts.
- Introduced getParentApplicationContext() in MergedContextConfiguration
- The loadContext(MergedContextConfiguration) methods in
  AbstractGenericContextLoader and AbstractGenericWebContextLoader now
  set the parent context as appropriate.
- Introduced 'hierarchyMode' attribute in @DirtiesContext with a
  corresponding HierarchyMode enum that defines EXHAUSTIVE and
  CURRENT_LEVEL cache removal modes.
- ContextCache now internally tracks the relationships between contexts
  that make up a context hierarchy. Furthermore, when a context is
  removed, if it is part of a context hierarchy all corresponding
  contexts will be removed from the cache according to the supplied
  HierarchyMode.
- AbstractGenericWebContextLoader will set a loaded context as the
  ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE in the MockServletContext when
  context hierarchies are used if the context has no parent or if the
  context has a parent that is not a WAC.
- Where appropriate, updated Javadoc to refer to the
  ServletTestExecutionListener, which was introduced in 3.2.0.
- Updated Javadoc to avoid and/or suppress warnings in spring-test.
- Suppressed remaining warnings in code in spring-test.

Issue: SPR-5613, SPR-9863
2013-03-07 02:11:11 +01:00
Phillip Webb 05765d7520 Replace EasyMock with Mockito
Issue: SPR-10126
2013-03-06 11:06:15 -08:00
Chris Beams ce4be3b46b Merge branch '3.2.x' into master
Conflicts:
	gradle.properties
	spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
	spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
	spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java
	spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java
	spring-jdbc/src/main/java/org/springframework/jdbc/datasource/LazyConnectionDataSourceProxy.java
	spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/AbstractLobHandler.java
	spring-web/src/main/java/org/springframework/http/client/BufferingClientHttpRequestWrapper.java
	spring-web/src/main/java/org/springframework/http/client/SimpleBufferingClientHttpRequest.java
	spring-web/src/main/java/org/springframework/http/converter/BufferedImageHttpMessageConverter.java
	spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
2013-03-04 15:41:15 +01:00
Rossen Stoyanchev 33e723b4a8 Fix AntPathMatcher rule for combining with extensions
Before this fix AntPathMatcher had a special rule for combining
patterns with wildcards and extensions as follows:

"/*.*"  + "/*.html" => "/*.html"

This change ensures this rule never applies if the first pattern
contains URI variables.

Issue: SPR-10062
2013-03-01 16:30:02 -05:00
Sam Brannen 9b72bf4691 Update @since tag for StreamUtils 2013-02-28 01:39:15 +01:00
Chris Beams 9a48c10dcb Segregate tests that depend on the jmxmp: protocol
This commit introduces TestGroup#JMXMP and adds assumptions to related
tests accordingly. These tests require the jmxoptional_remote jar on the
classpath, and are run nightly in the SPR-PERF build.

Issue: SPR-8089
2013-02-26 16:52:29 +01:00
Chris Beams 55caf7bdb0 Improve diagnostics for invalid testGroup values 2013-02-26 16:46:13 +01:00
Phillip Webb 009d2a5efd Remove unnecessary null check in SysEnvPropSource
Remove unnecessary null check and dead code from
SystemEnvironmentPropertySource.

Issue: SPR-10318
2013-02-25 15:35:13 -08:00
Phillip Webb 9a6c6b9ee6 StringToEnumConverterFactory class from enum value
Update StringToEnumConverterFactory to search superclasses until
Class.isEnum() returns true. This allows conversion when the
enum class is obtained from the enum value:

    public static enum SubFoo {
        BAR { String s() { return "x"; } };
        abstract String s();
    }

    conversionService.convert("BAR", SubFoo.BAR.getClass())

This fix is particularly important when converting collections of
enums.

Issue: SPR-10329
2013-02-25 13:25:44 -08:00
Juergen Hoeller 5e64723e02 Catch ASM ClassReader's IllegalArgumentException and turn it into a more expressive exception, hinting at the class file version
Issue: SPR-10292
2013-02-15 18:31:22 +01:00
Phillip Webb 953b2b60ad Javadoc polish 2013-02-13 11:58:21 -08:00
Phillip Webb 6661788748 Ensure HTTP classes don't close streams
Prior to this commit several HTTP classes made use of FileCopyUtils
when reading from or writing to streams. This has the unfortunate
side effect of closing streams that should really be left open.

The problem is particularly noticeable when dealing with a
FormHttpMessageConverter that is writing a multi-part response.

Relevant HTTP classes have now been refactored to make use of a new
StreamUtils class that works in a similar way FileCopyUtils but does
not close streams.

The NonClosingOutputStream class from SimpleStreamingClientHttpRequest
has also been refactored to a StreamUtils method.

Issue: SPR-10095
2013-02-11 19:04:53 -08:00
Juergen Hoeller 93e6238f92 Polishing 2013-02-11 21:52:04 +01:00
Juergen Hoeller e9db785799 Polishing 2013-02-10 21:10:58 +01:00
Phillip Webb 7bbb4ec7af Fix Assert.instanceOf exception message
Update the exception message used when Assert.instanceOf fails such
that it expects the provided message to end with '.'. This reverts
commit 5874383ef0 which caused the
implementation to be at odds with the JavaDoc and the previous
release.

The updated code also has the benefit of protecting against a null
message.

Issue: SPR-10269
2013-02-07 13:35:31 -08:00
Phillip Webb f464a45ba4 Polish formatting
Minor formatting polish across that codebase. Primarily fixing
whitespace issues.
2013-02-04 10:35:25 -08:00
Phillip Webb aac6b913d6 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Fix unnecessary @SupressWarnings annotations
  Fix Javadoc warnings
  Fix unused local variable warnings
  Fix unused type compiler warnings
  Fix 'is already an instance of type' warnings
2013-01-31 12:52:51 -08:00
Juergen Hoeller a694db2933 Removed logging from GenericTypeResolver's resolveReturnTypeForGenericMethod
GenericTypeResolver is very low-level and quite a hotspot, so let's not do any logging there and rather use the debugger instead.
2013-01-31 18:01:01 +01:00
Phillip Webb d89e30b864 Fix unnecessary @SupressWarnings annotations 2013-01-29 15:37:25 -08:00
Phillip Webb 2b0d860923 Fix Javadoc warnings 2013-01-25 17:31:33 -08:00
Phillip Webb 065b1c0e46 Fix unused local variable warnings 2013-01-25 14:35:19 -08:00
Phillip Webb 6a1e841952 Fix unused type compiler warnings 2013-01-25 14:35:07 -08:00
Chris Beams 39c00c489e Avoid UnsupportedOperationEx. with active SecurityManager
Issue: SPR-9970
2013-01-24 15:08:07 +01:00
Juergen Hoeller 078a1c5db8 Made EncodedResource based variant public; consistently detect XML properties across all variants
Issue: SPR-9078
2013-01-24 14:56:45 +01:00
Juergen Hoeller 575926932d Polishing 2013-01-23 22:17:48 +01:00
Juergen Hoeller e5d9378482 Removed pre-JDK-1.5 checks 2013-01-23 22:17:38 +01:00
Juergen Hoeller 049169d19f ResourcePropertyResource accepts EncodedResource for properties files with a specific encoding
Also added constructor with Charset argument to EncodedResource.

Issue: SPR-10096
2013-01-23 22:16:35 +01:00
Sam Brannen a1aba23aa9 Polish Javadoc in TypeDescriptor
- fix @since version in array()
- format method-level Javadoc
- unescape HTML-escaped angle brackets with {@code} blocks
2013-01-23 16:47:23 +01:00
Phillip Webb 9c032d52d4 Allow TypeDescriptor array construction
Add a static factory method that can be used to create an array
TypeDescriptor with a specific element type. Allows array types
with generic elements to be constructed.

Issue: SPR-9792
2013-01-22 15:35:43 -08:00
Phillip Webb 4d01d43c19 Test String to char[] conversion
Issue: SPR-9793
2013-01-22 14:36:38 -08:00
Chris Beams 3a626f9319 Support XML properties in ResourcePropertySource
JDK 5 introduced an XML-based properties file syntax. This commit
ensures that when such files are supplied as the underlying resource
for a ResourcePropertySource instance, they are routed appropriately
to Properties#loadFromXML as opposed to Properties#load.

Issue: SPR-9896
2013-01-22 14:14:15 +01:00
Chris Beams d9a4fb410d Introduce "dummy" Environment implementation
For testing purposes in which an Environment implementation is required
but a ConfigurableEnvironment is not desirable.

All methods are no-ops and return null, therefore NPEs are likely.
2013-01-22 11:33:37 +01:00
Chris Beams cb8dc73fbb Attempt to repro ReflectionUtils performance issue
Issue: SPR-10197
2013-01-21 14:03:36 +01:00
Juergen Hoeller 8c9383da7c BridgeMethodResolver properly handles bridge methods in interfaces
Issue: SPR-9330
2013-01-18 15:00:00 +01:00
Juergen Hoeller ed952ccba1 LocalVariableTableParameterNameDiscoverer works for bridge methods as well
Issue: SPR-9429
2013-01-18 14:52:24 +01:00
Juergen Hoeller 2cd23a79a3 Polishing 2013-01-15 22:09:16 +01:00
Sam Brannen 8694a0aac0 Minor changes to AnnotationUtils
- Polished Javadoc for isAnnotationDeclaredLocally() and
  isAnnotationInherited().
- Removed unnecessary call to Arrays.asList() in
  isAnnotationDeclaredLocally().
2013-01-14 12:24:12 +01:00
Juergen Hoeller e806c4eb3d AnnotationAwareOrderComparator is able to sort Class objects as well
Issue: SPR-10152
2013-01-10 17:00:46 +01:00
Juergen Hoeller dae4485155 Added dedicated sort method to AnnotationAwareOrderComparator
Issue: SPR-9625
2013-01-10 17:00:45 +01:00
Rossen Stoyanchev f185c3a3c1 Add option to not trim path segments in AntPathMatch
Issue: SPR-8687
2013-01-08 12:03:51 -05:00
Chris Beams 662a02b952 Fix several miscellaneous compiler/Eclipse warnings
- Suppress an (intentional) AspectJ warning
 - Remove unused imports
 - Suppress a [hiding] warning
 - Fix a generics warning related to extension of final types

Issue: SPR-9431
2013-01-04 11:41:49 +01:00
Chris Beams b836e14b5f Merge branch 'cleanup-test-duplicates' into cleanup-3.2.x
* cleanup-test-duplicates:
  Update Apache license headers for affected sources
  Remove duplicate test classes
  Replace test beans with test objects

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
	spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
2013-01-04 10:31:31 +01:00
Chris Beams d1e6dbe74a Update Apache license headers for affected sources 2013-01-04 10:29:11 +01:00
Phillip Webb 42b5d6dd7e Remove duplicate test classes
Prior to this commit many test utility classes and sample beans were
duplicated across projects. This was previously necessary due to the
fact that dependent test sources were not shared during a gradle
build. Since the introduction of the 'test-source-set-dependencies'
gradle plugin this is no longer the case.

This commit attempts to remove as much duplicate code as possible,
co-locating test utilities and beans in the most suitable project.
For example, test beans are now located in the 'spring-beans'
project.

Some of the duplicated code had started to drift apart when
modifications made in one project where not ported to others. All
changes have now been consolidated and when necessary existing tests
have been refactored to account for the differences.

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
	spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java
	spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
2013-01-04 10:02:29 +01:00
Phillip Webb 2a30fa07ea Replace test beans with test objects
Refactor spring-core tests to replace test beans from
'org.springframework.beans' with lighter test objects in
'org.springframework.tests.sample.objects'.
2013-01-04 10:02:29 +01:00
Chris Beams 7a737bebdd Merge branch '3.2.x' into master
* 3.2.x:
  Fix ClassCastException when setting media types
  Enable execution of TestNG tests in spring-test
  Polish support for topic branch-specific versions
  Segregate add'l long-running and performance tests
  Eliminate EBR dependencies and repository config
  Skip creation of IDEA metadata for spring-aspects
  Fix Eclipse compilation error in Gradle plugin
  Polish build.gradle
  Fix null parameterName issue in content negotiation
  Recursively add test dependencies
2013-01-03 22:31:52 +01:00
Chris Beams 68e3b7773c Segregate add'l long-running and performance tests
- Add TestGroup#LONG_RUNNING to distinguish from #PERFORMANCE, the
   former being tests that simply take a long time vs the latter being
   tests that are actually dependent on certain actions happening within
   a given time window and are thefore CPU-dependent.

Issue: SPR-9984
2013-01-03 19:28:05 +01:00
Chris Beams 961dbdb68a Merge branch '3.2.x' into master
* 3.2.x:
  Exclude spring-build-src from maven publish
  Move spring-build-junit into spring-core
  Relocate MergePlugin package
  Develop a gradle plugin to add test dependencies
  Expose Gradle buildSrc for IDE support
  Fix [deprecation] compiler warnings
  Upgrade to xmlunit version 1.3
  Improve 'build' folder ignores
  Fix regression in static setter method support
  Fix SpEL JavaBean compliance for setters

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
2013-01-02 10:36:57 +01:00
Chris Beams 70eaf02b7f Revert "Merge branch 'SPR-10130' into cleanup-master"
This reverts commit 45fa50821a, reversing
changes made to a312d900f8.
2013-01-02 10:33:59 +01:00
Phillip Webb 65fb26f847 Move spring-build-junit into spring-core
Move code from spring-build-junit into spring-core/src/test along with
several other test utility classes. This commit removes the temporary
spring-build-junit project introduced in commit
b083bbdec7.
2013-01-01 19:49:45 -08:00
Phillip Webb 6626a38730 Fix [deprecation] compiler warnings
Fix deprecation compiler warnings by refactoring code or applying
@SuppressWarnings("deprecation") annotations. JUnit tests of
internally deprecated classes are now themselves marked as
@Deprecated.

Numerous EasyMock deprecation warnings will remain until the
migration to mockito can be completed.
2013-01-01 13:42:15 -08:00
Chris Beams b2a048b6f3 Update Apache license headers for affected sources 2012-12-28 23:57:33 +01:00
Chris Beams 3b40ce76bf Add @Override annotations to main sources
Issue: SPR-10130
2012-12-28 23:53:24 +01:00
Chris Beams 8472a2b2ab Update Apache license headers for affected sources 2012-12-28 23:09:31 +01:00
Phillip Webb 60032e0012 Ignore performance-sensitive tests by default
Make use of the new JUnit functionality introduced in the previous
commit to 'Assume' that perfomance- and timing-sensitive tests should
run only when TestGroup.PERFORMANCE is selected, i.e. when
-PtestGroups="performance" has been provided at the Gradle command line.

The net effect is that these tests are now ignored by default, which
will result in far fewer false-negative CI build failures due to
resource contention and other external factors that cause slowdowns.

We will set up a dedicated performance CI build to run these tests on
an isolated machine, etc.

Issue: SPR-9984
2012-12-28 23:08:37 +01:00
Phillip Webb d66c733ef4 Replace EasyMock with Mockito in test sources
Issue: SPR-10126
2012-12-28 23:07:04 +01:00
Chris Beams 4c8cd7b0bd Add @Override annotations to test sources
Issue: SPR-10129
2012-12-28 23:05:44 +01:00
Chris Beams 4c7cafbde6 Fix "unnecessary @SuppressWarnings" warnings 2012-12-28 22:50:46 +01:00
Chris Beams 8d2e125e7b Fix [rawtypes] compiler warnings
- Suppress rawtypes warnings for src/main
 - Enable rawtypes warnings for src/test

This commit attempts to to resolve all rawtypes problems across tests as
aggressively as possible, i.e. without regard for binary compatibility,
whereas main sources must be treated much more cautiously with an eye
toward compatibility.
2012-12-28 22:50:46 +01:00
Chris Beams 4d97ff2479 Fix [dep-ann] warnings with @Deprecated 2012-12-28 22:50:45 +01:00
Phillip Webb 6c14eaad61 Fix [cast] compiler warnings 2012-12-28 22:41:06 +01:00
Phillip Webb b0986049a3 Fix [serial] compiler warnings
Fix serialization warnings by applying @SuppressWarnings("serial")
when appropriate.

In certain cases and for unknown reasons, a correctly-placed
@SuppressWarnings("serial") annotation will fix the warning at the
javac level (i.e. the Gradle command-line), but will produce an
"unnecessary @SuppressWarnings" warning within Eclipse. In these
cases, a private static final serialVersionUID field has been added
with the default value of 1L.
2012-12-28 22:41:06 +01:00
Phillip Webb 7f0aa5cfb2 Fix [varargs] compiler warnings
Remove unnecessary 'null' argument from calls to vararg supported
methods and fix cast in ValidationUtils.invokeValidator().
2012-12-28 22:40:49 +01:00
Phillip Webb 731d5be644 Fix warnings due to unused import statements 2012-12-28 22:40:49 +01:00
Chris Beams 9540d2c81b Replace <code> with {@code} throughout Javadoc
Issue: SPR-10128
2012-12-28 22:36:02 +01:00
Chris Beams 8597ec25ec Fix various Javadoc warnings
Issue: SPR-10128
2012-12-28 22:36:02 +01:00
Phillip Webb 2cf45bad86 Replace space indentation with tabs
Issue: SPR-10127
2012-12-28 20:49:56 +01:00
Phillip Webb 1762157ad1 Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
    xargs perl -p -i -e "s/[ \t]*$//g" {} \;

Issue: SPR-10127
2012-12-28 20:49:45 +01:00
Phillip Webb 1abb7f66a7 Fix GenericConversionService search algorithm
Previously the algorithm used by GenericConversionService to find
converters incorrectly searched for interfaces working up from the
base class. This caused particular problems with custom List
converters as as the Collection interface would be considered before
the List interface giving CollectionToObjectConverter precedence
over the custom converter.

The updated algorithm restores the class search order to behave in the
same way as Spring 3.1.

Issue: SPR-10116
Backport-Issue: SPR-10117
Backport-Commit: aa914497dc
2012-12-22 11:53:00 -08:00
Juergen Hoeller c242abada1 Fixed QualifierAnnotationAutowireCandidateResolver's detection of custom qualifier annotations
Issue: SPR-10107
2012-12-20 17:35:02 +01:00
Juergen Hoeller 531318a4b2 Polishing 2012-12-13 00:03:26 +01:00
Juergen Hoeller a35b9c9431 Revert "Cache MethodParameter annotation lookup results"
This reverts commit c10d63dc01.
2012-12-12 23:57:50 +01:00
Juergen Hoeller b9df7d68d9 Consistent fine-tuning of synchronized and concurrent data structures
In particular, avoiding synchronized Sets and Maps wherever possible (preferring a ConcurrentHashMap even instead of a synchronized Set) and specifying appropriate ConcurrentHashMap initial capacities (even if we end up choosing 16).
2012-12-12 23:46:26 +01:00
Juergen Hoeller a2f8902b3a Inlined AntPathStringMatcher into AntPathMatcher
Also initializing the capacity of the AntPathStringMatcher cache to 256 now.
2012-12-12 23:39:25 +01:00
Juergen Hoeller 710fe9349a Deprecated CachingMapDecorator (following the deprecation of LabeledEnum support) 2012-12-12 23:39:24 +01:00
Chris Beams f26534700a Eliminate all Javadoc warnings
- Support external Javadoc links using Gradle's javadoc.options.links

 - Fix all other Javadoc warnings, such as typos, references to
   non-existent (or no longer existent) types and members, etc,
   including changes related to the Quartz 2.0 upgrade (SPR-8275) and
   adding the HTTP PATCH method (SPR-7985).

 - Suppress all output for project-level `javadoc` tasks in order to
   hide false-negative warnings about cross-module @see and @link
   references (e.g. spring-core having a @see reference to spring-web).
   Use the `--info` (-i) flag to gradle at any time to see project-level
   javadoc warnings without running the entire `api` task. e.g.
   `gradle :spring-core:javadoc -i`

 - Favor root project level `api` task for detection of legitimate
   Javadoc warnings. There are now zero Javadoc warnings across the
   entirety of spring-framework. Goal: keep it that way.

 - Remove all @link and @see references to types and members that exist
   only in Servlet <= 2.5 and Hibernate <= 4.0, favoring 3.0+ and 4.0+
   respectively. This is necessary because only one version of each of
   these dependencies can be present on the global `api` javadoc task's
   classpath. To that end, the `api` task classpath has now been
   customized to ensure that the Servlet 3 API and Hibernate Core 4 jars
   have precedence.

 - SPR-8896 replaced our dependency on aspectjrt with a dependency on
   aspectjweaver, which is fine from a POM point of view, but causes
   a spurious warning to be emitted from the ant iajc task that it
   "cannot find aspectjrt on the classpath" - even though aspectjweaver
   is perfectly sufficient. In the name of keeping the console quiet, a
   new `rt` configuration has been added, and aspectjrt added as a
   dependency to it. In turn, configurations.rt.asPath is appended to
   the iajc classpath during both compileJava and compileTestJava for
   spring-aspects.

Issue: SPR-10078, SPR-8275, SPR-7985, SPR-8896
2012-12-12 12:55:10 +01:00
Juergen Hoeller 1cb6e3dbb6 Several enhancements with respect to CachingMetadataReaderFactory handling.
Added "clearCache()" method to CachingMetadataReaderFactory, for clearing the metadata cache once not needed anymore - in particular when the MetadataReaderFactory instance is long-lived. Also added "setMetadataReaderFactory" method to ClassPathScanningCandidateComponentProvider, analogous to ConfigurationClassPostProcessor.
2012-12-12 03:29:44 +01:00
Phillip Webb 6e3c3c58b5 Polish whitespace and formatting 2012-11-26 09:34:22 -08:00
Oliver Gierke e40e2b7cae Introduce AnnotationAwareOrderComparator#INSTANCE
Prior to this change, the INSTANCE constant one could refer to on
AnnotationAwareOrderComparator actually referred to the constant
declared in the OrderAwareComparator superclass. Thus
AnnotationAwareOrderComparator#INSTANCE did not actually return an
AnnotationAwareOrderComparator but an OrderAwareComparator instead. This
commit introduces a dedicated constant on AnnotationAwareOrderComparator
to avoid this glitch.

Issue: SPR-10038
2012-11-26 18:14:29 +01:00
Juergen Hoeller 7d7758bfc9 Polishing 2012-11-25 21:15:48 +01:00
Rossen Stoyanchev b36ab83ab3 Support GenericArrayType in GenericTypeResolver method
Before this change GenericTypeResolver.resolveType supported
TypeVariable's and ParameterizedType's only. Now it also supports
GenericArrayType.
2012-11-21 13:26:56 -05:00
Sam Brannen dc0a0df8d6 Polish Javadoc for ConcurrentReferenceHashMap
Issue: SPR-9796
2012-11-04 15:37:26 +01:00
Phillip Webb 3aa9ac15a1 Update cache to support concurrent reads
Change the cache implementation from a synchronized weak hash map to
a concurrent implementation.

Issue: SPR-8701
2012-11-03 15:34:12 -07:00
Phillip Webb 02ce826ce4 Cache and late resolve annotations for performance
Annotations are no longer resolved in the constructor and are cached
for improved performance.

Issue: SPR-9166
2012-11-03 15:34:11 -07:00
Phillip Webb 6e0400db32 Polish Property class 2012-11-03 15:34:09 -07:00
Phillip Webb fac060f0af Develop ConcurrentReferenceHashMap
Develop a new ConcurrentMap implementation that support both weak and
soft entry references. Intended primarily to be used internally to
support fast concurrent caching.

Issue: SPR-9796
2012-11-03 15:33:59 -07:00
Chris Beams c94bc2e709 Respect spring.profiles.active in #addActiveProfile
Prior to this commit, calls to ConfigurableEnvironment#addActiveProfile
would cause any active profile values provided via the
"spring.profiles.active" property to be ignored.

Now these two mechanisms can be used in conjunction and work as
expected.

Issue: SPR-9944
2012-11-02 15:02:13 +01:00
Phillip Webb 468f9c7814 Polish 2012-11-01 11:10:25 -07:00
Phillip Webb 4036ffc4d4 Improve #toString for AnnotationAttributes
Improve the #toString method for AnnotationAttributes to print array
values as a comma-separated list. This change is primarily to provide
better variable inspection when debugging code within an IDE.
2012-10-31 09:42:27 +01:00
Juergen Hoeller 3a09644843 Adapted PropertySourcesPropertyResolverTests for different error message format 2012-10-31 02:53:24 +01:00
Juergen Hoeller 5b93b14392 DateTimeFormat annotation supports use as a meta-annotation as well 2012-10-31 02:53:23 +01:00
Juergen Hoeller ee50d849a1 Polished "Could not resolve placeholder" error message 2012-10-31 02:53:22 +01:00
Phillip Webb 22dfe93f2f Revert ConversionService SPI interface
Remove canBypassConvert() methods from the ConversionService SPI
interface, restoring it to the previous Spring 3.1 incarnation.

Bypassing conversion is now only supported when using a
GenericConversionService.

Issue: SPR-9566
2012-10-30 14:00:12 -07:00
Phillip Webb 31331e6ad3 Avoid NPE in ObjectToObjectConverter
Bypass ObjectToObject conversion when source and object types are
identical and protect against a null source object.

Prior to this commit the TypeDescriptor was used to determine if
conversion was necessary.  This caused issues when comparing a
descriptor with annotations to one without.  The updated code
now compares using TypeDescriptor.getType().

The ObjectToObject converter will now no longer attempt to convert
null source objects.

Issue: SPR-9933
2012-10-30 11:25:10 -07:00
Phillip Webb 5a1f924ac3 Resolve Collection element types during conversion
TypeDescriptor.valueOf now uses GenericCollectionTypeResolver to resolve
Collection and Map element types whereas previously this information was
simply not supported, i.e. null.

Issue: SPR-9257
2012-10-30 14:00:50 +01:00
Chris Beams 222eec58cd Review and polish pull request #132
Content:

 - Rename Conditional{Conversion=>Converter}
 - Add @since tags where appropriate
 - Update Apache date headers to read 2002-2012 (not just 2012)
 - Correct minor Javadoc typo

Style:

 - Polish line breaks / whitespace
 - Use wildcard static imports where appropriate

Issue: SPR-9566, SPR-9692, SPR-9928, SPR-9927
2012-10-30 09:14:28 +01:00
Phillip Webb f82c6ed7cc Support conversion from Enum Interface
EnumToStringConverter in now conditional and only matches Enums that
do not implement interfaces that can be converted.

Issue: SPR-9692
2012-10-30 09:14:24 +01:00
Phillip Webb a27d1a28ff Bypass conversion when possible
Prior to this commit conversion between like types would often result in
a copy of the object. This can be problematic in the case of large byte
arrays and objects that do not have a default constructor.

The ConversionService SPI now includes canBypassConvert methods that can
be used to deduce when conversion is not needed. Several existing
converters have been updated to ensure they only apply when source and
target types differ.

This change introduces new methods to the ConversionService that will
break existing implementations. However, it anticipated that most users
are consuming the ConversionService interface rather then extending it.

Issue: SPR-9566
2012-10-30 09:13:39 +01:00
Phillip Webb f13e3ad72b Extend conditional conversion support
Introduce new ConditionalConversion interface that can be applied to
Converter, ConverterFactory or GenericConverter interfaces to make
them conditional. Prior to this commit the only
ConditionalGenericConverter could be conditional.

Issue: SPR-9928
2012-10-30 09:13:36 +01:00
Phillip Webb 4dc289592d Refactor GenericConversionService
Refactor internal workings of GenericConversionService in order to
better support future enhancements. This commit should not affect
existing behavior.

Issue: SPR-9927
2012-10-30 09:13:22 +01:00
Phillip Webb 9bfe675761 Additional GenericConversionService Tests 2012-10-30 09:13:18 +01:00
Chris Beams 06e34f05a6 Allow PropertyResolvers to ignore unresolvable ${placeholders}
Prior to this commit, the PropertyResolver API (and therefore the
Environment API) allowed callers a choice between
 #resolvePlaceholders and #resolveRequiredPlaceholders for low-level
${placeholder} resolution. However, when calling the higher level
 #getProperty variants, users had no control over whether property
values returned with unresolvable ${placeholders} would result in an
exception or simply be passed through.

This commit introduces a #setIgnoreUnresolvableNestedPlaceholders
property via ConfigurablePropertyResolver, defaulting to false, the
value of which is respected by AbstractPropertyResolver#getProperty
method implementations. See the new test in
PropertySourcesPropertyResolverTests for usage examples.

Issue: SPR-9569, SPR-9473
2012-10-26 23:47:00 +02:00
Phillip Webb 01272fb0e6 Polish whitespace for conversion service packages 2012-10-26 14:09:26 -07:00
Phillip Webb 6adb49b7a9 Add StringToUUIDConverter
Conversion to and from UUID objects is now supported by the
DefaultConversionService.

Issue: SPR-9765
2012-10-12 14:47:19 -07:00
Phillip Webb c8c0e827b4 Polish trailing whitespace 2012-10-12 14:47:19 -07:00
Phillip Webb 38c4393592 Allow MapToMap conversion to work when the target map does not have a
default constructor (as long as a new map copy is not required).

Issue: SPR-9284
2012-10-12 13:10:07 -07:00
Phillip Webb 60afa5ead4 Polish trailing whitespace 2012-10-12 13:09:53 -07:00
Juergen Hoeller 84b3f7106d Polishing along with 3.1.3 backport
Issue: SPR-9761
Issue: SPR-9762
2012-10-11 00:35:02 +02:00
Phillip Webb e543ffdfd7 Improve annotation methods in TypeDescriptor
- Use generic typing for getAnnotation()
- Add hasAnnoation() method
- Update existing code and tests to make use of changes

Issue: SPR-9744
2012-10-10 15:16:46 -07:00
Phillip Webb 23f089ff1e Polish code and JavaDoc formatting
- Remove trailing whitespace
- Apply consistent JavaDoc formatting
2012-10-10 15:16:46 -07:00
Phillip Webb 2e48656906 Chain exception cause on create failure
Propogate root cause of exceptions thrown from createCollection
and createMap.

Issue: SPR-9285
2012-10-10 14:03:02 -07:00
Juergen Hoeller 49294c9d00 ClassUtils.getMostSpecificMethod uses Class.getMethod code path in case of a public method
This should be significantly faster than our standard algorithm, for a very common case. Motivated by SPR-9802, even if the fix there uses a different approach, with transaction name determination not calling getMostSpecificMethod at all anymore.

Issue: SPR-9802
2012-09-26 20:03:30 +02:00
Arjen Poutsma f191a55b8f Preserve comments when using JibxMarshaller
Prior to this commit, JibxMarshaller used a SAX ContentHandler to
marshal to StAX XMLEventWriters, which inadvertently resulted in the
deletion of XML comments.

After this commit, JibxMarshaller adapts the XMLEventWriter into an
XMLStreamWriter and comments are preserved.

Issue: SPR-9768
2012-09-17 14:07:02 +01:00
Phillip Webb 73832f8c6e Support inferred base package for @ComponentScan
Prior to this change, @ComponentScan required the declaration of
exactly one of the #value, #basePackage or #basePackageClasses
attributes in order to determine which package(s) to scan.

This commit introduces support for base package inference, relaxing the
above requirement and falling back to scanning the package in which the
@ComponentScan-annotated class is declared.

Issue: SPR-9586
2012-09-11 16:50:01 +02:00
Chris Beams dfe05305e2 Upgrade to JUnit 4.11 snapshot in support of JDK7
Class#getDeclaredMembers returns arbitrary results under JDK7. This
results in non-deterministic execution of JUnit test methods, often
revealing unintended dependencies between methods that rely on a
specific order to succeed.

JUnit 4.11 contains support for predictable test ordering [1], but at
the time of this commit, JUnit 4.11 has not yet been released.
Therefore we are testing against a snapshot version [2], which has been
uploaded to repo.springsource.org [3] for easy access. Note that this
artifact may be removed when JUnit 4.11 goes GA.

 - Care has been taken to ensure that spring-test's compile-time
   dependency on JUnit remains at 4.10. This means that the spring-test
   pom.xml will continue to have an optional <dependency> on JUnit
   4.10, instead of the 4.11 snapshot.

 - For reasons not fully understood, the upgrade to the 4.11 snapshot
   of junit-dep caused NoSuchMethodErrors around certain Hamcrest
   types, particularly CoreMatchers and Matchers. import statements
   have been updated accordingly throughout affected test cases.

 - Runtime errors also occurred around uses of JUnit @Rule and
   ExpectedException. These have been reverted to use simpler
   mechanisms like @Test(expected) in the meantime.

 - Some test methods with order-based dependencies on one another have
   been renamed in order to fall in line with JUnit 4.11's new method
   ordering (as opposed to actually fixing the inter-test
   dependencies). In other areas, the fix was as simple as adding a
   tearDown method and cleaning up state.

 - For no apparent reason, the timeout in AspectJAutoProxyCreatorTests'
   testAspectsAndAdvisorNotAppliedToPrototypeIsFastEnough method begins
   to be exceeded. Prior to this commit the timeout value was 3000 ms;
   on the CI server under Linux/JDK6 and JDK7, the test begins taking
   anywhere from 3500-5500 ms with this commit. It is presumed that
   this is an incidental artifact of the upgrade to JUnit 4.11. In any
   case, there are no changes to src/main in this commit, so this
   should not actually represent a performance risk for Spring
   Framework users. The timeout has been increased to 6000 ms to
   accommodate this situation.

[1]: https://github.com/KentBeck/junit/pull/293
[2]: https://github.com/downloads/KentBeck/junit/junit-dep-4.11-SNAPSHOT-20120805-1225.jar
[3]: https://repo.springsource.org/simple/ext-release-local/junit/junit-dep/4.11.20120805.1225

Issue: SPR-9783
2012-09-11 15:04:56 +02:00
Juergen Hoeller 787d8f5916 SpringFactoriesLoader as the simplest possible mechanism for BeanInfoFactory loading 2012-09-10 23:16:21 +02:00
Rossen Stoyanchev 34c3e821dd Cache AntPathStringMatcher instances
AntPathMatcher now caches AntPathStringMatcher instances by pattern
thus avoiding java.util.regex.Pattern recompilation.

Issue: SPR-9749
2012-09-10 16:57:10 -04:00
Juergen Hoeller f29b791c85 MutablePropertySources log statements guarded by isDebugEnabled
Issue: SPR-9670
2012-09-10 15:14:13 +02:00
Juergen Hoeller 8f12d98a99 LinkedCaseInsensitiveMap checks for uniqueness of case-insensitive keys now
Issue: SPR-9754
2012-09-10 15:14:09 +02:00
Arjen Poutsma aeff91c1da Moved SpringFactoriesLoader to io.support in order to resolve tangle. 2012-09-10 11:28:45 +02:00
Sam Brannen c795c1b362 Polishing 2012-09-08 18:16:33 +02:00
Arjen Poutsma 988f376752 Added SpringFactoriesLoader 2012-09-07 17:00:22 +02:00
Phillip Webb 77c9321967 Sort candidate @AspectJ methods deterministically
Update the ReflectiveAspectJAdvisorFactory class to sort candidate
AOP methods based on their annotation first and method name second.

Prior to this the order of aspects created from annotated methods
could differ depending on the underling JVM, as first noticed under
JDK7 in SPR-9729.

 - ConvertingComparator and InstanceComparator have been introduced in
   support of this change, per SPR-9730.

 - A shared static INSTANCE field has been added to ComparableComparator
   to avoid unnecessary instantiation costs within ConvertingComparator
   as well as to prevent generics warnings during certain caller
   scenarios.

Issue: SPR-9729, SPR-9730
2012-09-06 16:06:16 +02:00
Phillip Webb 719a9e120d Refactor ComparatorTests into separate classes 2012-09-06 16:06:16 +02:00
Phillip Webb 9821868707 Refactor and polish various Comparator impls
- Refactor CompoundComparator constructor to use varargs
 - Refactor MediaType to consume new varargs constructor
 - Add notNull assertions where appropriate
 - Add generic typing where appropriate
 - Suppress generics warnings elsewhere
 - Fix whitespace errors
2012-09-06 16:06:16 +02:00
Chris Beams 9f8d219146 Remove default profile during environment merge
This change fixes a minor bug with the implementation of
ConfigurableEnvironment#merge, introduced in SPR-9444. During a merge
of two environments A and B, where A has default profiles [prod] and B
has default profiles [default] (the so-called 'reserved default
profile'), B would complete the merge process having a collection of
profiles reading [default, prod], which is incorrect.

This commit explicitly ensure's that B's reserved default profile is
removed if A has a set of default profiles greater than zero. If A
consists only of [default], B will inherit it during the merge
correctly; if A consists of [p1, p2], B will result in [p1, p2] as
well; if B consists of [p1] and A of [p2, p3], B will result in
[p1, p2, p3] post-merge.

Issue: SPR-9761, SPR-9444
2012-09-05 22:33:14 +02:00
Juergen Hoeller 931ea5cdf4 polishing 2012-09-04 18:05:11 +02:00
jhoeller db4cc9562f Merge pull request #94 from dsyer/SPR-9498
SPR-9498: relax logic detecting successful property editor after conversion exception
2012-09-04 08:54:01 -07:00
Juergen Hoeller 30de87a51e StaxEventContentHandler uses static inner class for Location adapter, in order to avoid leaks when caching events
Issue: SPR-9305
2012-08-29 22:00:26 +02:00
Juergen Hoeller 769753dac4 ResourceUtils.useCachesIfNecessary() not correct handle JNLP connections
Issue: SPR-9547
2012-08-29 22:00:25 +02:00
Arjen Poutsma d37e7878e6 Improved Javadoc 2012-08-27 12:40:08 +02:00
Arjen Poutsma ca017a4880 Introduce strategy for BeanInfo creation
Before this commit, the CachedIntrospectionResults was hard-coded to
create ExtendedBeanInfos for bean classes. The ExtendedBeanInfo support
the JavaBeans property contract only.

This commit introduces the BeanInfoFactory, a strategy for creating
BeanInfos. Through this strategy, it is possible to support
beans that do not necessarily implement the JavaBeans contract (i.e.
have a different getter or setter style).

BeanInfoFactories are are instantiated by the
CachedIntrospectionResults, which looks for
'META-INF/spring.beanInfoFactories' files on the class path. These files
contain one or more BeanInfoFactory class names. When a BeanInfo is to
be created, the CachedIntrospectionResults will iterate through the
factories, asking it to create a BeanInfo for the given bean class. If
none of the factories support it, an ExtendedBeanInfo is created as a
default.

This commit also contains a change to Property, allowing BeanWrapperImpl
to specify the property name at construction time (as opposed to using
Property#resolveName(), which supports the JavaBeans contract only).

Issue: SPR-9677
2012-08-24 10:23:16 +02:00
Arjen Poutsma ed3823b045 Support generic target types in the RestTemplate
This change makes it possible to use the RestTemplate to read an HTTP
response into a target generic type object. The RestTemplate has three
new exchange(...) methods that accept ParameterizedTypeReference -- a
new class that enables capturing and passing generic type info.
See the Javadoc of the three new methods in RestOperations for a
short example.

To support this feature, the HttpMessageConverter is now extended by
GenericHttpMessageConverter, which adds a method for reading an
HttpInputMessage to a specific generic type. The new interface
is implemented by the MappingJacksonHttpMessageConverter and also by a
new Jaxb2CollectionHttpMessageConverter that can read read a generic
Collection where the generic type is a JAXB type annotated with
@XmlRootElement or @XmlType.

Issue: SPR-7023
2012-08-22 16:20:36 -04:00
Chris Beams 92500ab902 Upgrade to CGLIB 3 and inline into spring-core
CGLIB 3 has been released in order to depend on ASM 4, which Spring now
depends on internally (see previous commit).

This commit eliminates spring-beans' optional dependency on cglib-nodep
v2.2 and instead repackages net.sf.cglib => org.springframework.cglib
much in the same way we have historically done with ASM.

This change is beneficial to users in several ways:

 - Eliminates the need to manually add CGLIB to the application
   classpath; especially important for the growing number of
   @Configuration class users. Java-based configuration functionality,
   along with proxy-target-class and method injection features now
   work 'out of the box' in Spring 3.2.

 - Eliminates the possibility of conflicts with other libraries that
   may dependend on differing versions of CGLIB, e.g. Hibernate
   3.3.1.ga and its dependency on CGLIB 2.1.3 would easily cause a
   conflict if the application were depending on CGLIB 3 for
   Spring-related purposes.

 - Picks up CGLIB 3's changes to support ASM 4, meaning that CGLIB is
   that much less likely to work well in a Java 7 environment due to
   ASM 4's support for transforming classes with invokedynamic
   bytecode instructions.

On CGLIB and ASM:

  CGLIB's own dependency on ASM is also transformed along the way to
  depend on Spring's repackaged org.springframework.asm, primarily to
  eliminate unnecessary duplication of ASM classfiles in spring-core and
  in the process save around 100K in the final spring-core JAR file size.

  It is coincidental that spring-core and CGLIB currently depend on the
  exact same version of ASM (4.0), but it is also unlikely to change any
  time soon. If this change does occur and versions of ASM drift, then
  the size optimization mentioned above will have to be abandoned. This
  would have no compatibility impact, however, so this is a reasonable
  solution now and for the forseeable future.

On a mysterious NoClassDefFoundError:

  During the upgrade to CGLIB 3.0, Spring test cases began failing due to
  NoClassDefFoundErrors being thrown from CGLIB's DebuggingClassWriter
  regarding its use of asm-util's TraceClassVisitor type. previous
  versions of cglib-nodep, particularly 2.2, did not cause this behavior,
  even though cglib-nodep has never actually repackaged and bundled
  asm-util classes. The reason for these NoClassDefFoundErrors occurring
  now is still not fully understood, but appears to be due to subtle JVM
  bytecode preverification rules. The hypothesis is that due to minor
  changes in DebuggingClassWriter such as additional casts, access to
  instance variables declared in the superclass, and indeed a change in
  the superclass hierarchy, preverification may be kicking in on the
  toByteArray method body, at which point the reference to the missing
  TraceClassVisitor type is noticed and the NCDFE is thrown. For this
  reason, a dummy implementation of TraceClassVisitor has been added to
  spring-core in the org.springframework.asm.util package. This class
  simply ensures that Spring's own tests never result in the NCDFE
  described above, and more importantly that Spring's users never
  encounter the same.

Other changes include:

 - rename package-private Cglib2AopProxy => CglibAopProxy
 - eliminate all 'cglibAvailable' checks, warnings and errors
 - eliminate all 'CGLIB2' language in favor of 'CGLIB'
 - eliminate all mention in reference and java docs of needing to add
   cglib(-nodep) to one's application classpath

Issue: SPR-9669
2012-08-10 00:38:49 +02:00
Chris Beams c16f18a5fd Remove spring-asm and inline ASM 4 into spring-core
ASM 4.0 is generally compatibile with Java 7 classfiles, particularly
including 'invokedynamic' instructions. This is important when
considering that Spring's component-scanning support is internally
ASM-based and it is increasingly likely that component classes having
invokedynamic instructions may be encountered and read by ASM.
This upgrade, then, is primarily preventive in nature.

Changes include:

 - upgrade from ASM 2.2.3 to ASM 4.0

 - adapt to ASM API changes as necessary throughout spring-core,
   resulting in no impact to the public Spring API.

 - remove dedicated spring-asm module

 - use new :spring-core:asmRepackJar task to repackage
   org.objectweb.asm => org.springframework.asm as per usual and write
   repackaged classes directly into spring-core jar

The choice to eliminate the spring-asm module altogether and instead
inline the repackaged classes directly into spring-core is first to
eliminate an otherwise unnecessary second jar. spring-core has a
non-optional dependency on spring-asm meaning it is always on the
application classpath. This change simplifies that situation by
consoliding two jars into one. The second reason for this choice is in
anticipation of upgrading CGLIB to version 3 and inlining it into
spring-core as well. See subsequent commit for details.

Issue: SPR-9669
2012-08-10 00:36:49 +02:00
Sam Brannen 826e565b7c Polish GenericTypeResolver
- renamed resolveParameterizedReturnType() to
   resolveReturnTypeForGenericMethod()
 - fleshed out Javadoc for resolveReturnType() and
   resolveReturnTypeForGenericMethod() regarding declaration of formal
   type variables
 - improved wording in log statements and naming of local variables
   within resolveReturnTypeForGenericMethod()

Issue: SPR-9493
2012-08-05 19:09:38 +02:00
Sam Brannen f49b22c78f Introduce MockEnvironment in the spring-test module
For legacy reasons, a MockEnvironment implementation already exists in multiple places within Spring's test suite; however, it is not available to the general public.

This commit promotes MockEnvironment to a first-class citizen in the spring-test module, alongside the existing MockPropertySource.

In addition, the following house cleaning has been performed.

 - deleted MockPropertySource from the spring-expression module
 - deleted MockEnvironment from the "spring" integration testing module
 - updated test copies of MockPropertySource and MockEnvironment
 - documented MockEnvironment and MockPropertySource in the testing
   chapter of the reference manual

Issue: SPR-9492
2012-07-28 20:10:21 +02:00
Chris Beams 2ec7834124 Resolve nested placeholders via PropertyResolver
Prior to this change, PropertySourcesPropertyResolver (and therefore
all AbstractEnvironment) implementations failed to resolve nested
placeholders as in the following example:

    p1=v1
    p2=v2
    p3=${v1}:{$v2}

Calls to PropertySource#getProperty for keys 'p1' and 'v1' would
successfully return their respective values, but for 'p3' the return
value would be the unresolved placeholders. This behavior is
inconsistent with that of PropertyPlaceholderConfigurer.

PropertySourcesPropertyResolver #getProperty variants now resolve any
nested placeholders recursively, throwing IllegalArgumentException for
any unresolvable placeholders (as is the default behavior for
PropertyPlaceholderConfigurer). See SPR-9569 for an enhancement that
will intoduce an 'ignoreUnresolvablePlaceholders' switch to make this
behavior configurable.

This commit also improves error output in
PropertyPlaceholderHelper#parseStringValue by including the original
string in which an unresolvable placeholder was found.

Issue: SPR-9473, SPR-9569
2012-07-06 15:45:40 +02:00
Juergen Hoeller 8bd1fd3715 moved getInputStream() not-null requirement to InputStreamSource itself; removed misleading "throws IllegalStateException" declaration
Issue: SPR-9561
2012-07-04 23:32:49 +02:00
Juergen Hoeller fdb9de1445 Use BufferedInputStream in SimpleMetaDataReader to double performance
Issue: SPR-9528
2012-07-04 22:58:58 +02:00
Chris Beams dc822cdca0 Reflect 3.2=>3.1.2 backports in @since tags etc
Issue: SPR-9443, SPR-6847, SPR-9446, SPR-9444, SPR-9439, SPR-9302,
       SPR-9507, SPR-9238, SPR-9397, SPR-9406, SPR-9502
2012-06-27 23:07:48 +02:00
Chris Beams 35055fd866 Refactor PropertyResolver impl for consistency
PropertySourcesPropertyResolver#containsProperty now
calls #containsProperty on each underlying PropertySource instead of
calling #getProperty and checking for null.

Issue: SPR-9529
2012-06-21 12:53:51 +02:00
Sam Brannen c461455c7c Infer return type of parametrized factory methods
Currently, if a factory method is parameterized and the corresponding
variable types are declared on the method itself instead of on the
enclosing class or interface, Spring always predicts the return type to
be Object, even if the return type can be explicitly inferred from the
method signature and supplied arguments (which are available in the bean
definition).

This commit introduces a new resolveParameterizedReturnType() method in
GenericTypeResolver that attempts to infer the concrete type for the
generic return type of a given parameterized method, falling back to the
standard return type if necessary. Furthermore,
AbstractAutowireCapableBeanFactory now delegates to
resolveParameterizedReturnType() when predicting the return type for
factory methods.

resolveParameterizedReturnType() is capable of inferring the concrete
type for return type T for method signatures similar to the following.
Such methods may potentially be static. Also, the formal argument list
for such methods is not limited to a single argument.

 - public <T> T foo(Class<T> clazz)
 - public <T> T foo(Object obj, Class<T> clazz)
 - public <V, T> T foo(V obj, Class<T> clazz)
 - public <T> T foo(T obj)

Issue: SPR-9493
2012-06-19 18:05:41 +02:00
Dave Syer cd6f7de408 SPR-9498: Add support for MultiValueMap to CollectionFactory
This turns out not to be the main problem exposed in SPR-9498
but it seems like a sensible addition anyway.
2012-06-14 11:42:23 +01:00
Chris Beams b5b46156b1 Rename test versions of @Qualified and @Autowired
Avoid Eclipse classpath conflicts between test versions of @Qualified
and @Autowired living in spring-core and actual versions living in
spring-beans.
2012-05-28 15:04:47 +03:00
Chris Beams f55a4a1ac5 Reduce log level for message re: missing annotation
Previously (since Spring 3.1.1) RecursiveAnnotationAttributesVisitor
logs at level WARN when ASM parsing encounters an annotation or an (enum
used within an annotation) that cannot be classloaded. This is not
necessarily indicative of an error, e.g. JSR-305 annotations such as
@Nonnull may be used only for static analysis purposes, but because
these annotations have runtime retention, they remain present in the
bytecode. Per section 9.6.1.2 of the JLS, "An annotation that is present
in the binary may or may not be available at run-time via the reflective
libraries of the Java platform."

This commit lowers the log level of these messages from warn to debug,
but leaves at warn level other messages dealing with the ability
reflectively read enum values from within annotations.

Issue: SPR-9233
2012-05-27 15:04:42 +03:00
Chris Beams bcd44f3798 Support not (!) operator for profile selection
The following syntax is now supported

  <beans profile="p1,!p2">

  @Profile("p1", "!p2")

indicating that the <beans> element or annotated component should
be processed only if profile 'p1' is active or profile 'p2' is not
active.

Issue: SPR-8728
2012-05-27 10:18:11 +03:00
Chris Beams 9fcfd7e827 Introduce ConfigurableEnvironment#merge
Prior to this change, AbstractApplicationContext#setParent replaced the
child context's Environment with the parent's Environment if available.
This has the negative effect of potentially changing the type of the
child context's Environment, and in any case causes property sources
added directly against the child environment to be ignored. This
situation could easily occur if a WebApplicationContext child had a
non-web ApplicationContext set as its parent. In this case the parent
Environment type would (likely) be StandardEnvironment, while the child
Environment type would (likely) be StandardServletEnvironment. By
directly inheriting the parent environment, critical property sources
such as ServletContextPropertySource are lost entirely.

This commit introduces the concept of merging an environment through
the new ConfigurableEnvironment#merge method. Instead of replacing the
child's environment with the parent's,
AbstractApplicationContext#setParent now merges property sources as
well as active and default profile names from the parent into the
child. In this way, distinct environment objects are maintained with
specific types and property sources preserved. See #merge Javadoc for
additional details.

Issue: SPR-9444, SPR-9439
2012-05-26 14:33:53 +03:00
Chris Beams 5874383ef0 Polish
Issue: SPR-9439
2012-05-26 14:33:52 +03:00
Stevo Slavic 18006c72b0 Fix circular placeholder prevention
A set of resolved placeholder references is used for circular
placeholder prevention. For complex property definitions this mechanism
would put property values with unresolved inner placeholder references
in the set, but would try to remove property values with placeholders
resolved, leaving the set in an invalid state and the mechanism broken.

This fix makes sure that the value that is put in the set is same one
that is removed from it, and by doing so avoids false positives in
reporting circular placeholders.

Issue: SPR-5369
2012-05-17 14:48:18 +03:00
Philippe Marschall 13239a0c3d Fix compiler warnings
This patch fixes several compiler warnings that do not point to code
problems. Two kinds of warnings are fixed. First in a lot of cases
@SuppressWarnings("unchecked") is used although there are no unchecked
casts happening. This seems to be a leftover from when the code base
was on Java 1.4, now that the code base was moved to Java 1.5 these are
no longer necessary. Secondly there some places where the raw types of
List and Class are used where there wildcard types (List<?> and
Class<?>) would work just as well without causing any raw type warnings.

These changes are beneficial particularly when working in Eclipse or
other IDEs because it reduces 'noise', helping to isolate actual
potential problems in the code.

The following changes have been made:

 - remove @SuppressWarnings where no longer needed

 - use wildcard types instead of raw types where possible
2012-05-17 14:32:34 +03:00
Chris Beams 1f4b33c4ad Fix compiler warnings in Constants/ConstantsTests 2012-05-17 12:59:21 +03:00
Stevo Slavic 6ffb0436fa Allow null params as advertised in Constants#toCode*
Even though the Javadoc for Constants#toCode and #toCodeForSuffix
specifies that a null value for the 'namePrefix' and 'nameSuffix'
parameters are respectively allowed, before this change passing a null
to either would result in a NullPointerException.

This change fixes constant name lookup for null values of these params
as if an empty string had been passed instead. This way of handling a
null value is consistent with the rest of Constants class API.

Issue: SPR-8278
2012-05-17 12:53:32 +03:00
Chris Beams f1246a4317 Fix locale parsing error with en_en, tr_tr, etc
Previously, StringUtils#parseLocaleString would parse locale strings
having the same lowercase token for both language and country
incorrectly, e.g. 'tr_tr' would parse to 'tr_TR_tr' as opposed to the
expected 'tr_TR'.

This commit fixes this behavior by using using String#lastIndexOf
instead of String#indexOf when determining the location of the country
code token.

Issue: SPR-9420
2012-05-17 09:42:42 +03:00
Petr Janecek ef7e728bb8 Fix annotation search ending too early
In AnnotationUtils#findAnnotation(Method, Class), the search for a
method annotation fails if:

 - the original method does not have the annotation

 - an abstract superclass does not have an equivalent method declared

 - an interface implemented by the superclass has the method and
   the annotation -> this should be found, but is not!

This happens because the try-catch block in #findAnnotation is too wide:
cl.getDeclaredMethod() can throw NoSuchMethodException and skip the
'#searchOnInterfaces' call prematurely.

The try-catch block was made narrower to allow #searchOnInterfaces to
be called even if the abstract class does not have the method declared
at all.

Issue: SPR-9342
2012-05-17 00:45:21 +03:00
Nikita Tovstoles c10d63dc01 Cache MethodParameter annotation lookup results
Prior to this change, Spring's MethodParameter#getParameterAnnotations
called java.lang.Method#getParameterAnnotations on every invocation.
The latter ends up contending for a monitor inside (Sun) JDK code. This
is problematic when dealing with the high number of @RequestMapping
invocations that can occur in a Spring MVC @Controller.

This commit eliminates this contention by caching values returned by
java.lang.Method#getParameterAnnotations in a static ConcurrentMap.

Note that only Method parameter annotations are cached, while
Constructor parameter annotations are not. This is because the
issue of primary concern is, as mentioned above, @RequestMapping
methods. By nature, constructors are called much more infrequently, and
in most cases in a single-threaded fashion.

Issue: SPR-9298
2012-05-16 16:22:38 +03:00
Sam Brannen b50f6e19a6 Fix regression in ClassPathResource descriptions
ClassPathResource.getDescription() now returns consistent, meaningful
results for all variants of ClassPathResource's constructors.

Issue: SPR-9413
2012-05-16 04:24:53 +02:00
Stevo Slavic effb762558 Fix javadoc warnings
Before this change there were numerous javadoc warnings being reported
while building Spring framework API.

This commit resolves most of the javadoc warnings, reducing the total
number from 265 to 103.

Issue: SPR-9113
2012-04-30 11:31:02 +03:00
Rossen Stoyanchev 9833a4c385 Improvement in AntPathMatcher.combine method
Issues: SPR-7970
2012-04-02 15:06:20 -04:00
Chris Beams 15d1d824b5 Return null correctly from MutablePropertySources#get
Prior to this commit, MutablePropertySources#get(String) would throw
IndexArrayOutOfBoundsException if the named property source does not
actually exist. This is a violation of the PropertySource#get contract
as described in its Javadoc.

The implementation now correctly checks for the existence of the named
property source, returning null if non-existent and otherwise returning
the associated PropertySource.

Other changes

 - Rename PropertySourcesTests => MutablePropertySourcesTests
 - Polish MutablePropertySourcesTests for style, formatting
 - Refactor MutablePropertySources for consistency

Issue: SPR-9179
2012-02-29 14:33:29 +01:00
Chris Beams 7ca5fba05f Avoid infinite loop in AbstractResource#contentLength
Due to changes made in commit 2fa87a71 for SPR-9118,
AbstractResource#contentLength would fall into an infinite loop unless
the method were overridden by a subclass (which it is in the majority of
use cases).

This commit:

 - fixes the infinite recursion by refactoring to a while loop

 - asserts that the value returned from #getInputStream is not null in
   order to avoid NullPointerException

 - tests both of the above

 - adds Javadoc to the Resource interface to clearly document that the
   contract for any implementation is that #getInputStream must not
   return null

Issue: SPR-9161
2012-02-24 14:29:28 +01:00
Chris Beams 37d547c506 Sync with 3.1.x
* 3.1.x:
  Warn re Environment construction and instance vars
  Disallow empty @PropertySource(value = {})
  Fix @PropertySource bug with multiple values
  final preparations for 3.1.1 release
  added "receive-timeout" attribute to "jms:listener-container" element
2012-02-20 14:19:04 +01:00
Chris Beams 3e81482760 Sync with 3.1.x
* 3.1.x:
  Demonstrate use of @Configuration as meta-annotation
  Prune dead code from JmsTransactionManager#doBegin
  Apply @Configuration BeanNameGenerator consistently
  Improve @Configuration bean name discovery
  Fix infinite recursion bug in nested @Configuration
  Polish static imports
  Minor fix in ServletResponseMethodArgumentResolver
  extracted ResourceUtils.useCachesIfNecessary(URLConnection) method (SP
  prepared for 3.1.1 release
  CustomSQLExceptionTranslatorRegistry/Registrar etc
  revised CustomSQLExceptionTranslatorRegistry/Registrar method naming
  use custom InputStream traversal instead of a full byte array (SPR-911
  PathMatchingResourcePatternResolver preserves caching for JNLP jar con
  Resource "contentLength()" implementations work with OSGi bundle resou
  fixed MethodInvokingJobDetailFactoryBean for compatibility with Quartz
  fixed MethodInvokingJobDetailFactoryBean for compatibility with Quartz
2012-02-16 13:00:28 +01:00
Chris Beams 81dfef90ef Sync with 3.1.x
* 3.1.x:
  Fix false negative test failure in ResourceTests
  Compensate for Eclipse vs Sun compiler discrepancy
2012-02-13 15:54:14 +01:00
Chris Beams ee36c80ca9 Sync with 3.1.x
* 3.1.x: (61 commits)
  Compensate for changes in JDK 7 Introspector
  Avoid 'type mismatch' errors in ExtendedBeanInfo
  Polish ExtendedBeanInfo and tests
  Infer AnnotationAttributes method return types
  Minor fix in MVC reference doc chapter
  Hibernate 4.1 etc
  TypeDescriptor equals implementation accepts annotations in any order
  "setBasenames" uses varargs now (for programmatic setup; SPR-9106)
  @ActiveProfiles mechanism works with @ImportResource as well (SPR-8992
  polishing
  clarified Resource's "getFilename" method to consistently return null
  substituteNamedParameters detects and unwraps SqlParameterValue object
  Replace spaces with tabs
  Consider security in ClassUtils#getMostSpecificMethod
  Adding null check for username being null.
  Improvements for registering custom SQL exception translators in app c
  SPR-7680 Adding QueryTimeoutException to the DataAccessException hiera
  Minor polish in WebMvcConfigurationSupport
  Detect overridden boolean getters in ExtendedBeanInfo
  Polish ExtendedBeanInfoTests
  ...
2012-02-13 15:17:30 +01:00
Chris Beams 6235a341a7 Remove bundlor support 2012-01-31 14:37:11 +01:00
Chris Beams 02a4473c62 Rename modules {org.springframework.*=>spring-*}
This renaming more intuitively expresses the relationship between
subprojects and the JAR artifacts they produce.

Tracking history across these renames is possible, but it requires
use of the --follow flag to `git log`, for example

    $ git log spring-aop/src/main/java/org/springframework/aop/Advisor.java

will show history up until the renaming event, where

    $ git log --follow spring-aop/src/main/java/org/springframework/aop/Advisor.java

will show history for all changes to the file, before and after the
renaming.

See http://chrisbeams.com/git-diff-across-renamed-directories
2012-01-31 14:37:10 +01:00