Commit Graph

548 Commits

Author SHA1 Message Date
Sam Brannen
ececf32c05 Revert unintentional change in AnnotationUtils 2015-04-23 17:28:47 +02:00
Sam Brannen
b723dcebba Polish inline documentation in AnnotatedElementUtils 2015-04-23 17:28:47 +02:00
Sam Brannen
7f0f04dfe3 Support annotations on interfaces in AnnotatedElementUtils
This commit introduces support in AnnotatedElementUtils for finding
annotations declared on interfaces at the type level.

NB: this commit does not include support for finding annotations
declared on interface methods.

In order to maintain backward compatibility with @Transactional
annotation attribute processing, a new getAnnotationAttributes() method
has been added to AnnotatedElementUtils that provides a flag to control
whether interfaces should be searched.
SpringTransactionAnnotationParser and JtaTransactionAnnotationParser
have been updated accordingly to ensure that interfaces are not
unintentionally searched in the @Transactional resolution process.

This commit also introduces additional tests and updates TODOs for
SPR-12738.

Issue: SPR-12944, SPR-12738
2015-04-23 01:33:37 +02:00
Sam Brannen
9b7fd8be4d Polish Javadoc for AnnotationUtils 2015-04-23 01:21:27 +02:00
Sam Brannen
b9b0b78fa1 Support n meta-annotation levels on methods in AnnotationUtils
Prior to this commit, the search algorithm used by the
findAnnotation(Method, Class) method in AnnotationUtils only found
direct annotations or direct meta-annotations (i.e., one level of
meta-annotations).

This commit reworks the search algorithm so that it supports arbitrary
levels of meta-annotations on methods. To make this possible, a new
findAnnotation(AnnotatedElement, Class) method has been introduced in
AnnotationUtils.

This fix also allows for the @Ignore'd tests in
TransactionalEventListenerTests to be re-enabled.

Issue: SPR-12941
2015-04-22 02:26:24 +02:00
Sam Brannen
19a75f2c66 Document meta-annotation support in AnnotationUtils
Issue: SPR-12940
2015-04-21 19:54:48 +02:00
Sam Brannen
fefbd8f85b Polish Javadoc for StringUtils and Assert 2015-04-14 20:05:56 +02:00
Sam Brannen
47f8d435e6 Introduce isNotEmpty() aliases in StringUtils
This commit introduces isNotEmpty() aliases for the existing hasLength()
methods in StringUtils.

Issue: SPR-12909
2015-04-14 20:02:18 +02:00
Arjen Poutsma
b119a9c82c FutureAdapter should wrap RuntimeExceptions
RuntimeExceptions thrown from FutureAdapter.adapt() should be wrapped in
an ExecutionException, not thrown as is.

Issue: SPR-12887
2015-04-10 12:52:15 +02:00
Juergen Hoeller
e78b0860df AnnotatedElementUtils leniently ignores TypeNotPresentExceptions (just like AnnotationUtils)
Also refines logIntrospectionFailure to just log at debug level for meta-annotation introspection failures.

Issue: SPR-12889
2015-04-04 00:20:16 +02:00
Juergen Hoeller
514eb4281c Polishing 2015-04-01 17:23:45 +02:00
Juergen Hoeller
2c637dcb2e ReaderEditor supports Reader injection analogous to InputStreamEditor (from Spring resource location)
Also, EncodedResource implements InputStreamSource now since it declares getInputStream() anyway.

Issue: SPR-12876
2015-04-01 17:02:55 +02:00
Juergen Hoeller
1d33fd039a AnnotationUtils.getAnnotationAttributes makes Method accessible (analogous to AnnotationUtils.getValue)
Issue: SPR-12858
2015-03-31 10:28:42 +02:00
Sam Brannen
502fa1796e Polish Javadoc for ClassUtils 2015-03-30 17:34:36 +02:00
Sam Brannen
bddc4373fb Refactor ObjectToObjectConverter & improve exception msg
- The exception message now mentions lacking to-Object method as well.

- Documented explicit lacking support for toString() for conversions.

- Introduced dedicated has*() methods for greater clarity and to reduce
  code duplication.

- Static factory methods (i.e., of, from, valueOf) are now supported for
  conversion to a String.
2015-03-30 17:32:59 +02:00
Sam Brannen
db96113bcf Polish Javadoc for converters 2015-03-30 16:24:24 +02:00
Juergen Hoeller
d23893fd25 Consistent javadoc param declarations for type variables 2015-03-25 00:44:01 +01:00
Juergen Hoeller
22670b7fad Fixed addConverterFactory assertion 2015-03-25 00:42:51 +01:00
Juergen Hoeller
09027f7972 ResolvableType.forRawClass as a straight wrapper for Class.isAssignableFrom
Issue: SPR-12846
2015-03-24 19:20:15 +01:00
Juergen Hoeller
56273a8ff3 Polishing 2015-03-21 01:19:01 +01:00
Arjen Poutsma
da48739628 Support byte ranges in ResourceHttpRequestHandler
This commit introduces support for HTTP byte ranges in the
ResourceHttpRequestHandler. This support consists of a number of
changes:

- Parsing of HTTP Range headers in HttpHeaders, using a new HttpRange
  class and inner ByteRange/SuffixByteRange subclasses.
- MIME boundary generation moved from FormHttpMessageConverter to
  MimeTypeUtils.
- writePartialContent() method introduced in ResourceHttpRequestHandler,
  handling the byte range logic
- Additional partial content tests added to
  ResourceHttpRequestHandlerTests.

Issue: SPR-10805
2015-03-20 15:35:43 -04:00
Juergen Hoeller
192462902e Consistent support for Java 8 default methods (in interfaces implemented by user classes)
Covers ReflectionUtils.doWithMethods as well as affected annotation post-processors.
Includes an extension of MethodMetadata for the detection of @Bean default methods.

Issue: SPR-12822
Issue: SPR-10919
2015-03-19 16:50:15 +01:00
Juergen Hoeller
778a01943b ResolvableType-based type matching at the BeanFactory API level
Issue: SPR-12147
2015-03-18 23:05:13 +01:00
Juergen Hoeller
bc6a98c144 Polishing (in particular updating javadoc references to Apache Commons) 2015-03-13 18:19:10 +01:00
Sam Brannen
08c67cf045 Polish AnnotationAwareOrderComparator 2015-03-07 22:35:49 +01:00
Sam Brannen
afee546973 Delete unused method in TypeDescriptor 2015-03-07 22:27:11 +01:00
Sam Brannen
d90cee78ef Remove trailing whitespace in source code 2015-03-07 21:16:18 +01:00
Juergen Hoeller
ff4ac5b837 Collections.unmodifiableMultiValueMap explicitly casts to List<V> (for compatibility with JDK 9 build 53)
Issue: SPR-12549
2015-03-06 11:52:51 +01:00
Juergen Hoeller
1e26d17a3d Preparations for JDK 9
Issue: SPR-12549
2015-03-05 18:56:07 +01:00
Juergen Hoeller
7e8ffc7bf5 CompositePropertySource rejects getPropertyNames call when containing a non-enumerable source
Issue: SPR-12788
2015-03-05 18:53:25 +01:00
Juergen Hoeller
f786fc3226 ObjectToOptionalConverter preserves existing Optional instances
Issue: SPR-12785
2015-03-05 18:53:03 +01:00
Juergen Hoeller
dcb1145354 Converter interface explicitly documents null values
Issue: SPR-12780
2015-03-05 18:52:38 +01:00
Sam Brannen
93c70b7440 Include charset in EncodedResource.equals()
Prior to this commit, the implementation of equals() in EncodedResource
was based solely on the resource and encoding. Thus, if a Charset were
specified instead of an encoding, invocations of equals() would not
work as expected.

This commit addresses this issue by including the charset in the
implementation of equals() and introducing corresponding tests in a new
EncodedResourceTests class. Furthermore, this commit makes
EncodedResource immutable and updates all Javadoc to reflect support
for the encoding and charset properties.

Issue: SPR-12767
2015-02-28 17:37:02 +01:00
Juergen Hoeller
540d8792fe Fixed javadoc warnings and revised FastByteArrayOutputStream code style 2015-02-27 23:49:55 +01:00
Sam Brannen
fe8289b5e3 Implement description consistently across Resources
This commit ensures Resources have consistent, non-empty, meaningful
implementations for getDescription(), thus ensuring that calls to
toString() (e.g., in log statements) no longer return an empty String.

This commit also polishes the Javadoc for various Resource
implementations.
2015-02-27 21:41:37 +01:00
Sam Brannen
088238443b Polish Javadoc for ResourcePropertySource 2015-02-27 21:41:37 +01:00
Sam Brannen
228d9db4d4 Polish StreamConverter(Tests) 2015-02-27 19:27:37 +01:00
Juergen Hoeller
287045ef74 Allow for shared Objenesis caching in ObjenesisCglibAopProxy
Issue: SPR-12755
2015-02-26 18:34:52 +01:00
Juergen Hoeller
cc33d3fac8 Polishing 2015-02-25 19:05:06 +01:00
Stephane Nicoll
018adb04f2 Add converter support for Stream
Add StreamConverter to provide full support for converting
java.util.stream.Stream instances to and from collections or arrays.

Also attempt to convert the element type if necessary.

StreamConverter is registered by default in the DefaultConversionService
as long as Java8 is available.

Issue: SPR-12175
2015-02-24 10:17:27 +01:00
Juergen Hoeller
91a0107e4a ResolvableType.getType() returns ParameterizedType when built with forClassWithGenerics
Issue: SPR-12701
2015-02-20 21:53:44 +01:00
Stephane Nicoll
1aec6a6cc2 Detect Order on target class as well
Previously, the `@Order` annotation was managed in an inconsistent way
when placed at the implementation level. For simple beans, it was
discovered properly but wasn't for beans requiring a proxy.

OrderComparator.SourceProvider now explicitly allows to return several
order sources; the default implementation returns not only the factory
method (if  any) but also the target class if it happens to be different
from the class of the bean.

Issue: SPR-12636
2015-02-19 09:47:20 +01:00
Juergen Hoeller
0c15a54007 Polishing 2015-02-18 16:45:16 +01:00
Juergen Hoeller
6ebac00f32 @RequestPart supports java.util.Optional
Issue: SPR-12644
2015-02-18 16:17:07 +01:00
Sam Brannen
add718d75c Polish EnumerablePropertySource 2015-02-16 20:26:49 +01:00
Juergen Hoeller
f58abd3d9a Polishing (forward-ported from 4.1.x) 2015-02-10 23:04:12 +01:00
Juergen Hoeller
058714b03a Polishing 2015-02-10 19:30:59 +01:00
Sam Brannen
e97712b95b Update copyright headers in IdGenerators 2015-01-23 21:12:45 +01:00
Rossen Stoyanchev
52b8f34468 Add JdkIdGenerator and use it in SockJS client
Issue: SPR-12658
2015-01-22 21:27:36 -05:00
Juergen Hoeller
0ddf8dde12 AnnotationUtils explicitly handles null parameters
Issue: SPR-12604
2015-01-20 16:01:44 +01:00