Commit Graph

411 Commits

Author SHA1 Message Date
Juergen Hoeller
1e7fade89e JasperReports-related polishing
(cherry picked from commit 782d10c)
2014-05-12 20:50:24 +02:00
Juergen Hoeller
ae45794451 IdToEntityConverter defensively handles access to getDeclaredMethods
Issue: SPR-11758
(cherry picked from commit 381ccde)
2014-05-08 16:30:45 +02:00
Juergen Hoeller
fccec210b4 GenericTypeResolver returns null for entirely unresolvable type arguments only
Issue: SPR-11763
(cherry picked from commit bea34ea)
2014-05-08 16:28:53 +02:00
Juergen Hoeller
42a35ef3be AnnotationMetadataReadingVisitor passes metaAnnotationMap into getMergedAnnotationAttributes algorithm, for finding out about applicable overrides
Issue: SPR-11649
(cherry picked from commit 842a8a8)
2014-04-30 22:57:09 +02:00
Juergen Hoeller
1afdd9bd75 Polishing
(cherry picked from commit 02aca9c)
2014-04-30 00:10:58 +02:00
Juergen Hoeller
d0c839f0eb Polishing 2014-04-29 16:21:06 +02:00
Juergen Hoeller
a679f3e7a3 Polishing
(cherry picked from commit be5f2a8)
2014-04-28 23:52:23 +02:00
Juergen Hoeller
bd5b3749c5 Revised @PropertySource parsing for consistent PropertySource naming, avoiding accidental overriding by name
Issue: SPR-11637
(cherry picked from commit ab24dda)
2014-04-28 23:47:33 +02:00
Juergen Hoeller
c97c246940 Polishing 2014-04-28 00:29:04 +02:00
Juergen Hoeller
59cef3ce81 General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
2014-04-28 00:26:18 +02:00
Juergen Hoeller
656fc52ff9 @Bean processing explicitly ignores bridge methods (for method overrides with return type narrowing on JDK 8)
Issue: SPR-11718
(cherry picked from commit dc93406)
2014-04-28 00:16:38 +02:00
Juergen Hoeller
51fb485181 Polishing
(cherry picked from commit 9353332)
2014-04-24 10:32:38 +02:00
Juergen Hoeller
f16e6c4105 General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
(cherry picked from commit c05ab3e)
2014-04-24 10:31:48 +02:00
Juergen Hoeller
eb28259371 SpringProperties falls back to ClassLoader.getSystemResource when loaded in bootstrap ClassLoader
Issue: SPR-11721
(cherry picked from commit 9cb5f48)
2014-04-24 10:31:20 +02:00
Juergen Hoeller
5aa126600f Final patches from ASM 5.0.2 release
Issue: SPR-11212
(cherry picked from commit fb66567)
2014-04-24 10:29:50 +02:00
Juergen Hoeller
d5aacdefd9 Polishing
(cherry picked from commit 700c3b2)
2014-04-24 10:27:43 +02:00
Juergen Hoeller
e379e77b96 considerInterfaces should work without considerInherited as well
Issue: SPR-11719
(cherry picked from commit 5ab7076)
2014-04-24 10:27:15 +02:00
Juergen Hoeller
9c45755890 AnnotationTypeFilter prevents ASM-based loading of java.* interfaces as well
Issue: SPR-11719
(cherry picked from commit 945335d)
2014-04-24 10:26:42 +02:00
HejiaHo
f6b89c2ca9 Fix ConcurrentReferenceHashMap max constraints
Update calculateShift to respect the maximum upper bound as well as the
minimum value.

Issue: SPR-11720

(cherry picked from commit 16410cad)
2014-04-22 15:03:23 +01:00
Sam Brannen
82c32db5a1 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
(cherry picked from commit e1720d89fc)
2014-04-21 12:50:27 -04:00
Juergen Hoeller
271fe4f554 Polishing
(cherry picked from commit 48c977a)
2014-04-17 22:14:31 +02:00
Juergen Hoeller
8e44521ec4 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
(cherry picked from commit 637ad20)
2014-04-17 21:34:57 +02:00
Juergen Hoeller
196f629a20 JBoss "vfszip" resources need to be treated as jar URLs
Issue: SPR-11676
(cherry picked from commit be6b54f)
2014-04-09 20:51:23 +02:00
Juergen Hoeller
21874627d2 Polishing
Issue: SPR-11637
(cherry picked from commit 0041e24)
2014-04-09 19:00:23 +02:00
Juergen Hoeller
f014bbb5cf Revised ByteArrayOutputStream handling in MarshallingView and co
Issue: SPR-11646
(cherry picked from commit 8006696)
2014-04-02 21:29:37 +02:00
Sam Brannen
17bf5b991f Update Javadoc for supported JBoss VFS version
(cherry picked from commit 34eb4dba3a)
2014-03-30 16:02:27 +02: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