Commit Graph

647 Commits

Author SHA1 Message Date
Sam Brannen
638926be4f Use JUnit ExpectedException rule in AntPathMatcherTests 2015-05-08 14:37:15 +02:00
Sam Brannen
c7cdbe126d Introduce failing test case in AntPathMatcherTests
Issue: SPR-12998
2015-05-08 14:31:21 +02:00
Arjen Poutsma
76beb36e4b Remove duplicate separators when combining paths
Prior to this commit, AntPathMatcher would not correctly combine a path
that ends with a separator with a path that starts with a separator.
For example, `/foo/` + `/bar` combined into `/foo//bar`.

Specifically, this commit:

 - Removes the duplicated separator in combined paths

 - Improves RequestMappingInfo's toString() representation

 - Fixes Javadoc formatting in AntPathMatcher

 - Polishes AntPathMatcherTests

 - Polishes Javadoc in AbstractRequestCondition

Issue: SPR-12975
2015-05-08 13:49:34 +02:00
Juergen Hoeller
dbd82d128d Polishing 2015-05-07 20:18:17 +02:00
Juergen Hoeller
783cb2c438 StringUtils.commaDelimitedListToSet/removeDuplicateStrings preserves original order
Issue: SPR-12003
2015-05-07 16:02:48 +02:00
Juergen Hoeller
b90085500d Revert introduction of isNotEmpty aliases
Issue: SPR-12009
2015-05-07 15:54:55 +02:00
Juergen Hoeller
db80378dbe Avoid infinite loop in PatternMatchUtils
Issue: SPR-12971
2015-05-07 15:41:40 +02:00
Juergen Hoeller
2c043ec9d7 Fix for ASM issue 317555
Issue: SPR-12957
2015-05-07 15:41:24 +02:00
Sam Brannen
401bcd4a8a Polish Javadoc for AnnotatedElementUtils 2015-05-07 14:01:02 +02:00
Sam Brannen
7a690df925 Remove trailing whitespace from Java source code 2015-05-06 20:08:42 +02:00
Sam Brannen
6db8f24aaf Polish AnnotatedElementUtils[Tests]
Issue: SPR-11514
2015-05-06 18:48:26 +02:00
Sam Brannen
270308dfd9 Document "get vs. find" semantics in AnnotatedElementUtils
Issue: SPR-11514
2015-05-06 18:29:26 +02:00
Sam Brannen
5c0f98aea4 Document & test AnnotatedElementUtils.getAllAnnotationAttributes
Issue: SPR-11514
2015-05-06 15:55:37 +02:00
Sam Brannen
9eb3518583 Introduce tests for AnnotatedElementUtils.isAnnotated()
Issue: SPR-11514
2015-05-06 14:07:07 +02:00
Sam Brannen
e2158d75de Improve documentation of AnnotatedElementUtils.Processor
Issue: SPR-11514
2015-05-06 14:07:07 +02:00
Sam Brannen
5d67219a4e Eliminate inspection of annotations on core Java annotations
This commit picks up where SPR-11483 left off, with the goal of
eliminating all unnecessary inspection of core JDK annotations in
Spring's annotation search algorithms in AnnotatedElementUtils and
AnnotationMetadataReadingVisitor.

Issue: SPR-12989
2015-05-06 00:17:12 +02:00
Sam Brannen
ba84458c65 Overhaul AnnotatedElementUtils
- Methods which search for a specific annotation now properly ensure
   that the sought annotation was actually found.

 - Both the "get" and the "find" search algorithms no longer needlessly
   traverse meta-annotation hierarchies twice.

 - Both the "get" and the "find" search algorithms now properly
   increment the metaDepth when recursively searching within the
   meta-annotation hierarchy.

 - Redesigned getMetaAnnotationTypes() so that it doesn't needlessly
   search irrelevant annotations.

 - Documented and tested hasMetaAnnotationTypes().

 - Documented isAnnotated().

Issue: SPR-11514
2015-05-05 23:35:00 +02:00
Sam Brannen
efce40c391 Polish internal Javadoc for AnnotatedElementUtils
Issue: SPR-11514
2015-05-04 14:15:16 +02:00
Sam Brannen
bb1886c5a8 Enable AbstractStaxHandlerTestCase to run w/o Internet connection 2015-05-02 23:23:51 +02:00
Sam Brannen
e56363737b Make findAnnotationAttributes power search private 2015-05-02 10:38:31 +02:00
Sam Brannen
7ef9ac7a4d Document & test status quo for getMetaAnnotationTypes()
This commit documents the status quo for the getMetaAnnotationTypes()
method in AnnotatedElementUtils and adds appropriate regression tests to
AnnotatedElementUtilsTests.

In addition, this commit also introduces a SimpleAnnotationProcessor
base class in AnnotatedElementUtils.

Issue: SPR-11514
2015-04-26 21:13:19 +02:00
Sam Brannen
99cc7d56ff Document return values in AnnotatedElementUtils
This commit documents return values throughout AnnotatedElementUtils and
improves the documentation for the internal Processor API.

Issue: SPR-11514
2015-04-26 03:00:39 +02:00
Sam Brannen
91e46cf2ad Update TODOs in AnnotatedElementUtils[Tests]
Issue: SPR-12738
2015-04-24 23:05:29 +02:00
Sam Brannen
25187eeb0d Document AnnotatedElementUtils & assert preconditions
This commit consistently documents the 'element' and 'annotationType'
method arguments throughout AnnotatedElementUtils.

In addition, this commit introduces assertions against preconditions
for all 'element' and 'annotationType' method arguments.

Issue: SPR-11514
2015-04-24 22:36:36 +02:00
Juergen Hoeller
49f3046f66 PathMatchingResourcePatternResolver skips invalid jar classpath entries
Issue: SPR-12928
2015-04-24 17:40:13 +02:00
Stephane Maldini
74c0250525 Upgrade to Reactor 2
Issue: SPR-12599
2015-04-24 07:18:42 -04:00
Sam Brannen
ad6bea1cda Support abstract, bridge, & interface methods in AnnotatedElementUtils
This commit introduces support for finding annotations on abstract,
bridge, and interface methods in AnnotatedElementUtils.

 - Introduced dedicated findAnnotationAttributes() methods in
   AnnotatedElementUtils that provide first-class support for
   processing methods, class hierarchies, interfaces, bridge methods,
   etc.

 - Introduced find/get search algorithm dichotomy in
   AnnotatedElementUtils which is visible in the public API as well as
   in the internal implementation. This was necessary in order to
   maintain backwards compatibility with the existing API (even though
   it was undocumented).

 - Reverted all recent changes made to the "get semantics" search
   algorithm in AnnotatedElementUtils in order to ensure backwards
   compatibility, and reverted recent changes to
   JtaTransactionAnnotationParser and SpringTransactionAnnotationParser
   accordingly.

 - Documented internal AnnotatedElementUtils.Processor<T> interface.

 - Enabled failing tests and introduced
   findAnnotationAttributesFromBridgeMethod() test in
   AnnotatedElementUtilsTests.

 - Refactored ApplicationListenerMethodAdapter.getCondition() and
   enabled failing test in TransactionalEventListenerTests.

 - AnnotationUtils.isInterfaceWithAnnotatedMethods() is now package
   private.

Issue: SPR-12738, SPR-11514, SPR-11598
2015-04-24 00:55:48 +02:00
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
9c6d4b7848 Assert status quo for interface support in AnnotationUtils 2015-04-23 01:19:49 +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
666d1cecc8 Fix broken test in AnnotationUtilsTests 2015-04-21 21:06:47 +02:00
Sam Brannen
19a75f2c66 Document meta-annotation support in AnnotationUtils
Issue: SPR-12940
2015-04-21 19:54:48 +02:00
Sam Brannen
ed88b7fe08 Reorganize tests in AnnotationUtilsTests for greater clarity 2015-04-21 19:54:48 +02:00
Sam Brannen
dba48a1ff5 Isolate thrown exception in AssertTests 2015-04-14 20:42:23 +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
Sam Brannen
abaf81f1b5 Clean up warnings in DefaultConversionServiceTests 2015-04-07 22:40:06 -04: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
a4af5b8a3e Verify which factory methods are invoked in DefaultConversionServiceTests 2015-03-30 17:34:14 +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
Sam Brannen
72d7963b30 Polish ConversionService tests
- Now correctly using @Test(expected=...) where appropriate.

- Renamed DefaultConversionTests to DefaultConversionServiceTests.

- Moved all tests related to DefaultConversionService from
  GenericConversionServiceTests to DefaultConversionServiceTests.

- No longer printing to System.out.

- Removed all duplicate instantiation of conversion services.

- Now using Java 8 streams to simplify implementations of custom test
  converters. Also using streams in tests where appropriate.
2015-03-30 15:58:29 +02:00