Commit Graph

511 Commits

Author SHA1 Message Date
Juergen Hoeller
0d02ef5fe5 removed conversation prototype from 3.1 codebase 2011-10-11 16:22:15 +00:00
Chris Beams
2760542182 Add repro test case for package-private @Bean issue
Reproduces the issue described in SPR-8756 in addition to demonstrating
the suggested workaround.

Issue: SPR-8756, SPR-8725
2011-10-11 04:02:03 +00:00
Chris Beams
980c15d578 Distinguish between different bridge method types
Add BridgeMethodResolver#isJava6VisibilityBridgeMethodPair to
distinguish between (a) bridge methods introduced in Java 6 to
compensate for inheriting public methods from non-public superclasses
and (b) bridge methods that have existed since Java 5 to accommodate
return type covariance and generic parameters.

In the former case, annotations should be looked up from the original
bridged method (SPR-7900).  In the latter, the annotation should be
looked up against the bridge method itself (SPR-8660).

As noted in the Javadoc for the new method, see
http://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html
for a useful description of the various types of bridge methods, as
well as http://bugs.sun.com/view_bug.do?bug_id=6342411, the bug fixed in
Java 6 resulting in the introduction of 'visibility bridge methods'.

Issue: SPR-8660, SPR-7900
2011-10-10 05:40:21 +00:00
Chris Beams
d122ecb42e Move AdviceMode from .config to .annotation package 2011-10-09 07:55:08 +00:00
Costin Leau
40d88fd991 SPR-8730
+ more tests
2011-10-07 20:16:58 +00:00
Costin Leau
a12ebbfded SPR-8730
+ expose key-generator in the XML namespace
2011-10-07 19:45:05 +00:00
Sam Brannen
aa7a100807 [SPR-8178] re-enabled testPrintNull(). 2011-09-26 18:59:11 +00:00
Rossen Stoyanchev
3d50d416eb SPR-8718 Revert fix from earlier for now (need a different approach). 2011-09-26 17:58:49 +00:00
Sam Brannen
5309e43ea0 [SPR-8178] @Ignore-ing testPrintNull() until it is determined why changes to GenericConversionService broke this test. 2011-09-26 17:39:04 +00:00
Sam Brannen
052d3e7ccb [SPR-8718] now using correct JIRA ID in the comments. 2011-09-26 16:28:34 +00:00
Sam Brannen
f752b47fcb [SPR-8178] @Ignore-ing testDefaultNumberFormatting() until it is determined why changes to GenericConversionService broke this test. 2011-09-26 16:24:51 +00:00
Chris Beams
2e5f3559d3 Fix handling of @EnableLoadTimeWeaving AUTODETECT
Issue: SPR-8643
2011-09-03 22:37:16 +00:00
Costin Leau
d9de19d7b3 SPR-8653
+ refactor a bit the internals of CacheAspect to allow invocations that do not throw any exceptions (AspectJ)
2011-09-02 15:37:42 +00:00
Chris Beams
6db594c79d Register JndiPropertySource by default in servlet environments
Prior to this change, StandardServletEnvironment evaluated a
"jndiPropertySourceEnabled" flag to determine whether or not to add a
JndiPropertySource.  Following the changes introduced in SPR-8490, there
is now no reason not to enable a JNDI property source by default. This
change eliminates the support for "jndiPropertySourceEnabled" and adds
a JndiPropertySource automatically.

Issue: SPR-8545, SPR-8490
2011-08-20 03:02:31 +00:00
Juergen Hoeller
9e375a860a polishing 2011-08-18 23:13:30 +00:00
Juergen Hoeller
28e6d9a692 added test for month sequence (SPR-7807) 2011-08-17 21:01:34 +00:00
Costin Leau
63a217a40a + add XML support for cache abstraction (cache-advice) - DRAFT 2011-08-16 17:35:01 +00:00
Sam Brannen
2d6340af74 Deleting unnecessary TODOs and suppressing warnings. 2011-08-13 13:38:54 +00:00
Juergen Hoeller
b9ebdd28fb polishing 2011-08-12 10:02:12 +00:00
Chris Beams
b85440f2b6 Deprecate AbstractSingletonProxyFactoryBean 2011-07-26 22:29:14 +00:00
Chris Beams
2b371a7c9a Deprecate TransactionProxyFactoryBean 2011-07-26 22:29:04 +00:00
Juergen Hoeller
abdae3d26b general revision of cache package; added ConcurrentMapCacheManager 2011-07-22 09:32:56 +00:00
Chris Beams
718f025d64 Force lazy-init to false when parsing scheduled:task
A <scheduled:task> element declared within a
<beans default-lazy-init="true"> element represents a contradiction in
terms: such a task will never be executed.

For this reason, we now override any inherited lazy-init settings
when parsing <scheduled:task> elements, forcing lazy-init to false
for the underlying ScheduledTaskRegistrar bean.

Thanks to Mike Youngstrom for contributing an initial patch.

Issue: SPR-8498
2011-07-19 23:00:12 +00:00
Chris Beams
fd42a65c6c Allow ConfigurationCPP to process multiple registries
Prior to this change, an instance of ConfigurationClassPostProcessor
would throw IllegalStateException if its
postProcessBeanDefinitionRegistry method were called more than once.
This check is important to ensure that @Configuration classes are
not proxied by CGLIB multiple times, and works for most normal use
cases.

However, if the same CCPP instance is used to process multiple
registries/factories/contexts, this check creates a false negative
because it does not distinguish between invocations of
postProcessBeanDefinitionRegistry across different registries.

A use case for this, though admittedly uncommon, would be creating
a CCPP instance and registering it via
ConfigurableApplicationContext#addBeanDefinitionPostProcessor against
several ApplicationContexts. In such a case, the same CCPP instance
will post-process multiple different registry instances, and throw the
above mentioned exception.

With this change, CCPP now performs lightweight tracking of the
registries/beanFactories that it has already processed by recording
the identity hashcodes of these objects.  This is only slightly more
complex than the previous boolean-based 'already processed' flags, and
prevents this issue (however rare it may be) from occurring.

Issue: SPR-8527
2011-07-13 23:30:57 +00:00
Chris Beams
807d612978 Determine FactoryBean object type via generics
For the particular use case detailed in SPR-8514, with this change we
now attempt to determine the object type of a FactoryBean through its
generic type parameter if possible.

For (a contrived) example:

@Configuration
public MyConfig {
    @Bean
    public FactoryBean<String> fb() {
        return new StringFactoryBean("foo");
    }
}

The implementation will now look at the <String> generic parameter
instead of attempting to instantiate the FactoryBean in order to call
its #getObjectType() method.

This is important in order to avoid the autowiring lifecycle issues
detailed in SPR-8514.  For example, prior to this change, the following
code would fail:

@Configuration
public MyConfig {
    @Autowired Foo foo;

    @Bean
    public FactoryBean<String> fb() {
        Assert.notNull(foo);
        return new StringFactoryBean("foo");
    }
}

The reason for this failure is that in order to perform autowiring,
the container must first determine the object type of all configured
FactoryBeans.  Clearly a chicken-and-egg issue, now fixed by this
change.

And lest this be thought of as an obscure bug, keep in mind the use case
of our own JPA support: in order to configure and return a
LocalContainerEntityManagerFactoryBean from a @Bean method, one will
need access to a DataSource, etc -- resources that are likely to
be @Autowired across @Configuration classes for modularity purposes.

Note that while the examples above feature methods with return
types dealing directly with the FactoryBean interface, of course
the implementation deals with subclasses/subinterfaces of FactoryBean
equally as well.  See ConfigurationWithFactoryBeanAndAutowiringTests
for complete examples.

There is at least a slight risk here, in that the signature of a
FactoryBean-returing @Bean method may advertise a generic type for the
FactoryBean less specific than the actual object returned (or than
advertised by #getObjectType for that matter). This could mean that an
autowiring target may be missed, that we end up with a kind of
autowiring 'false negative' where FactoryBeans are concerned. This is
probably a less common scenario than the need to work with an autowired
field within a FactoryBean-returning @Bean method, and also has a clear
workaround of making the generic return type more specific.

Issue: SPR-8514
2011-07-06 09:15:37 +00:00
Chris Beams
7c25c84ee2 Deprecate/move CGLIB methods AopUtils=>ClassUtils
isCglibProxy* methods in AopUtils are useful in lower-level modules,
i.e. those that cannot depend on .aop.  Therefore copied these methods
to ClassUtils; deprecated the existing ones in AopUtils and now
delegating to the new location; switched all usage of
AopUtils#isCglibProxy* within the framework to use
ClassUtils#isCglibProxy* instead.
2011-07-06 09:15:27 +00:00
Chris Beams
78b60947ad Rename JMX tests to avoid jmxremote_optional error
Even after applying @Ignore to these tests at the class level, they
still run (and fail) under ant when the jmxremote_optional jar is not
present. See the issues mentioned below for information on how these
tests will be re-enabled.

Issue: SPR-8089, SPR-8093, SPR-8458
2011-07-06 09:13:17 +00:00
Juergen Hoeller
22939b6d05 properly wrap IndexOutOfBoundsException even for List 2011-07-03 20:24:12 +00:00
Juergen Hoeller
4c75054f90 DataBinder uses a default limit of 256 for array/collection auto-growing (SPR-7842) 2011-07-03 19:26:49 +00:00
Chris Beams
d9ee958d88 Refactor JndiPropertySource
Prior to this change, JndiPropertySource worked directly against a JNDI
Context instance as its 'source' object.  This works well enough, but is
not nearly as fully-featured as Spring's existing JndiLocatorDelegate.

This change refactors JndiPropertySource from relying on an underlying
Context to relying on an underlying JndiLocatorDelegate.  By default,
the delegate's "resourceRef" property is set to true, meaning that the
implementation will always try to prepand a given name with
"java:comp/env/" before looking up the name, and upon failure will drop
back to the given name sans prefix.

See JndiPropertySource Javadoc for complete details.

Issue: SPR-8490
2011-07-02 21:26:44 +00:00
Costin Leau
26dbfba6c0 SPR-8477
+ add no-op cache implementations suitable for cache declarations w/o a backing store
2011-06-30 18:17:39 +00:00
David Syer
bd0f68d095 SPR-5749: Add defensive matching using target class loader
* Changes to ASpectJExpressionPointcut plus some tests in Spring AOP
* plus some tests in groovy support
2011-06-24 17:23:43 +00:00
Juergen Hoeller
4664366aca getBean(name, type) attempts type conversion if necessary (SPR-8480) 2011-06-22 20:54:02 +00:00
Juergen Hoeller
e0d558b084 getBean(name, type) attempts type conversion if necessary (SPR-8480) 2011-06-22 20:52:28 +00:00
Chris Beams
4fb811572e Compensate for Windows paths in XmlBeanFactoryTests
Issue: SPR-8439
2011-06-20 08:44:24 +00:00
David Syer
8e35734856 SPR-6268: check AnnotationUtils works with Groovy concrete classes (plus remove compiler warnings) 2011-06-17 13:35:57 +00:00
David Syer
64fd0b081d SPR-6268: Add proxy-target-class to <lang:groovy/> 2011-06-17 12:14:01 +00:00
Chris Beams
8cb5c36512 Consolidate tests related to @Config inheritance
Issue: SPR-8183
2011-06-17 09:46:19 +00:00
Chris Beams
cc814519c8 Revert "Re-enable ignored JMX tests"
As of SPR-8093, jmxremote_optional.jar is present on the build
server in jre/lib/ext, but it is not by default present on local
developer / user machines, meaning that the build ends up broken
by default.

Issue: SPR-8089, SPR-8093, SPR-8458
2011-06-16 06:34:23 +00:00
Juergen Hoeller
f288060ad8 restored support for String-to-ContextResource conversion (SPR-8383) 2011-06-15 15:40:12 +00:00
Juergen Hoeller
878ff89014 added further conversion tests (triggered by 3.0.6 backports) 2011-06-13 23:57:53 +00:00
Juergen Hoeller
6c3cc786d0 added further conversion tests (triggered by 3.0.6 backports) 2011-06-13 23:43:46 +00:00
Chris Beams
234bca6462 Resolve ${...} placeholders in @PropertySource
Issue: SPR-8442
2011-06-13 04:23:08 +00:00
Juergen Hoeller
e1d81e04bc prepared Spring's DataSource and RowSet adapters for forward compatibility with JDBC 4.1 2011-06-09 23:09:55 +00:00
Juergen Hoeller
cac42ef233 fixed pattern list test 2011-06-07 23:24:30 +00:00
Chris Beams
620018d16b Introduce @EnableLoadTimeWeaving
Issue: SPR-8317
2011-06-06 08:31:18 +00:00
Mark Fisher
72420c79cb SPR-8205 added support for a 'trigger' attribute (bean ref) on scheduled-task elements 2011-06-03 18:54:21 +00:00
Sam Brannen
f3f29412d4 Increased timeout in calls to assertStopWatchTimeLimit() to increase stability of the build. 2011-06-03 15:44:08 +00:00
Oliver Gierke
c7a350cde7 SPR-7477 - Added lazy-init attribute to jee namespace 2011-06-03 08:51:56 +00:00
Sam Brannen
0c775416a6 [SPR-8089][SPR-8093] Re-enabled ignored JMX tests based on the feedback that jmxremote_optional.jar is now present "jre/lib/ext/ in both 1.5 and 1.6 JDKs on the build server". 2011-06-01 14:12:03 +00:00