Commit Graph

151 Commits

Author SHA1 Message Date
Juergen Hoeller 7e01578515 Avoid unnecessary creation of default StandardEnvironment instances
Issue: SPR-10568
2013-05-15 23:41:32 +02:00
Juergen Hoeller 070103b17e Fixed type detection to avoid reuse of parent bean's targetType on child definition merge
Issue: SPR-10374
2013-05-15 16:41:32 +02:00
Juergen Hoeller 59ef34d769 Polishing 2013-05-14 21:20:24 +02:00
Juergen Hoeller 14617447a6 Consistent use of Class<?> in core container method signatures 2013-05-14 17:44:06 +02:00
Juergen Hoeller bc3e5851b3 Detect a FactoryBean type match even if predictBeanType returned a non-FactoryBean type
This change should be the final piece in the puzzle to let SmartInstantiationAwareBeanPostProcessor's predictBeanType predict a FactoryBean-produced type, effectively as a semantic alternative to its postProcessBeforeInstantiation-related role.

Issue: SPR-10517
2013-05-14 17:43:13 +02:00
Rob Winch 9468548116 Add @Override to remaining source files
Issue: SPR-10130
2013-05-13 17:04:56 -05:00
Juergen Hoeller 2a44228b98 Consistent use of <pre class="code">
Issue: SPR-8108
2013-05-07 21:31:26 +02:00
Juergen Hoeller 2c3a8a5309 Removed parsing support for the 'singleton' attribute in an XML bean definition
Following the introduction of spring-beans-4.0.xsd and the corresponding removal of the pre-2.0 spring-beans.dtd.

Issue: SPR-10437
2013-05-07 18:11:52 +02:00
Juergen Hoeller 0fc5a5d912 Introduced 4.0 versions of all XML configuration schemas
Removed spring-beans.dtd (the 1.x variant) and spring-oxm-1.5.xsd (pre-Spring-Framework variant), in order to raise the backwards compatibility limit a little bit at least. We'll keep supporting the 2.0 and 2.5 xsd versions for the time being, as well as spring-beans-2.0.dtd.

Removed the ref 'local' attribute in spring-beans-4.0.xsd since 'local' lost its differentiating role to a regular bean ref back in the 3.1 days when we started allowing for the same bean id to reappear in a different beans section of the same configuration file (with a different profile).

Issue: SPR-10437
2013-05-07 18:11:51 +02:00
Juergen Hoeller 61c3f3d9fd Removed support for deprecated registerSharedEditor mechanism 2013-05-03 11:49:53 +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 9c09a0a037 Consistent Map/Set ordering
Use LinkedHashMaps/Sets wherever exposed to users, and code tests defensively in terms of expected Map/Set ordering. Otherwise, there'll be runtime order differences between JDK 7 and JDK 8 due to internal HashMap/Set implementation differences.

Issue: SPR-9639
2013-04-23 13:53:09 +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
Sam Brannen cf687fcc72 Fix typos in ServiceLocatorFactoryBean 2013-04-12 14:21:24 +02:00
Juergen Hoeller 853826a774 Use JDK 1.6's Collections.newSetFromMap instead of manually accessing Maps with dummy Boolean values 2013-03-28 22:14:26 +01:00
Juergen Hoeller 23bf5f563b Added "destroyBean(Object)" method to AutowireCapableBeanFactory
Driven by the need for implementing Bean Validation 1.1's "releaseInstance" method in SpringConstraintValidatorFactory, as a direct counterpart to the use of AutowireCapableBeanFactory's "createBean(Class)" in "getInstance".

Issue: SPR-8199
2013-03-28 21:44:07 +01:00
Juergen Hoeller 5472e975f6 Removed deprecated core.enums package 2013-03-19 23:31:50 +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
Phillip Webb 85f8d6f695 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Replace EasyMock with Mockito
2013-03-06 11:08:17 -08: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
Juergen Hoeller db823ba1e4 DefaultListableBeanFactory clears by-type matching cache on runtime register/destroySingleton calls
Issue: SPR-10326
2013-03-04 12:29:26 +01:00
Juergen Hoeller c986a1efc1 Cache target type per bean definition and allow for specifying it in advance
Issue: SPR-10335
2013-03-01 16:43:24 +01:00
Juergen Hoeller e0c7571a41 Refined predictBeanType's typesToMatch check for FactoryBeans
GroovyScriptFactoryTests passes again now.

Issue: SPR-10304
2013-03-01 15:52:24 +01:00
Juergen Hoeller 1bae80a241 Polishing 2013-02-27 00:31:05 +01:00
Chris Beams 58ab8b691c Re-enable ignored SecurityManager-related test
Prior to this change, CallbacksSecurityTests#testContainerPrivileges was
@Ignored because it caused the build to fail under Gradle. After some
analysis, the root cause was determined to be the fact that (a) a
restrictive SecurityManager is active during the running of this test,
and (b), Gradle intercepts System.out and routes it through its internal
LogBack-based logging system. LogBack requires a call to
Class#getClassLoader when handling logging statements, and the
SecurityManager disallows this call, thus raising the error that fails
the build.

This commit solves the problem by eliminating the System.out.println
call in question and removing the @Ignore annotation from the test. The
console output was diagnostic in nature anyway, and not required for the
successful execution of the test's assertions.

Issue: SPR-10074
2013-02-26 14:25:57 +01:00
Chris Beams 3100d89d07 Clean up console output for spring-beans tests 2013-02-26 14:21:01 +01:00
Phillip Webb 5008005df0 Protect against 'has not been resolved to a Class'
Update AbstractAutowireCapableBeanFactory.getTypeForFactoryBean to
check AbstractBeanDefinition.hasBeanClass() before calling
getBeanClass(). The protects against a 'Bean class name [<name>] has
not been resolved into an actual Class' IllegalStateException.

Issue: SPR-10304
2013-02-19 09:20:09 -08:00
Phillip Webb 608dab28bf Protect against ArrayIndexOutOfBoundsException
Update logic in AbstractAutowireCapableBeanFactory.predictBeanType to
protect against a ArrayIndexOutOfBoundsException.

Issue: SPR-10304
2013-02-19 09:18:15 -08:00
Phillip Webb 893574be0e Protect against ArrayIndexOutOfBoundsException
Update logic in AbstractAutowireCapableBeanFactory.predictBeanType to
protect against a ArrayIndexOutOfBoundsException.

Issue: SPR-10304
2013-02-15 12:31:47 -08:00
Carson McDonald 6f0b4395e5 Fix a few typos
Minor changes to fix typos. Small adjustment to add a couple commas.
2013-02-12 09:04:28 -05:00
Juergen Hoeller b3c9a11bd1 Folded a FactoryBean-specific check into predictBeanType now
This change means that we effectively revert SPR-8954's code change in favor of the isFactoryBean implementation simply relying on predictBeanType to sort it out, filtering a post-processed predictedType for FactoryBean applicability.

Issue: SPR-9177
Issue: SPR-9143
2013-02-07 23:23:25 +01:00
Juergen Hoeller e3c83bb769 Minor javadoc and source layout polishing 2013-02-07 15:36:19 +01: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 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
Phillip Webb 88f5dd6ce1 Fix 'is already an instance of type' warnings 2013-01-25 11:29:54 -08:00
Juergen Hoeller d46a82bbb0 Added note on thread safety to TypeConverter and SimpleTypeConverter javadoc
Issue: SPR-8659
2013-01-24 11:19:06 +01:00
Juergen Hoeller 575926932d Polishing 2013-01-23 22:17:48 +01:00
Juergen Hoeller 4c823a3f9b DisposableBeanAdapter detects "shutdown" as a destroy method as well (for EHCache CacheManager setup)
Issue: SPR-9713
2013-01-23 22:00:34 +01:00
Phillip Webb f3ff98d862 Allow nulls with multiple embedded value resolvers
Allow an embedded value resolver added to an AbstractBeanFactory to
return null without adversely effecting any subsequent resolvers.

Issue: SPR-8565
2013-01-23 11:08:14 -08:00
Phillip Webb 7e74fd2b7f Consider primary attribute with getBean(Class)
Update DefaultListableBeanFactory.getBean(Class<?> beanClass) to
consider the 'primary' attribute of bean definitions. This makes
getBean() behave in the same way as autowiring.

Issue: SPR-7854
2013-01-22 23:30:34 -08:00
Juergen Hoeller 8f103c2ea1 Introduced NoUniqueBeanDefinitionException as a dedicated subclass of NoSuchBeanDefinitionException
Issue: SPR-10194
2013-01-22 21:12:06 +01:00
Juergen Hoeller 1a929f22e0 EntityManagerFactoryUtils finds default EntityManagerFactory in parent contexts as well
Also introduces consistent use of getBean(Class) for similar use cases across the framework, accepting a locally unique target bean even if further matching beans would be available in parent contexts (in contrast to BeanFactoryUtils.beanOfType's behavior).

Issue: SPR-10160
2013-01-22 21:12:05 +01:00
Juergen Hoeller 721fa9db6a SpringBeanAutowiringInterceptor eagerly releases BeanFactory if post-construction fails
Issue: SPR-10013
2013-01-18 14:12:02 +01:00
Juergen Hoeller 6a5744e61c CachedIntrospectionResults.clearClassLoader(null) removes cached classes for the system class loader
Issue: SPR-9189
2013-01-18 13:32:10 +01:00
Chris Beams 26d5ef93e6 Handle non-void write methods deterministically
This change resolves a specific issue with processing
java.math.BigDecimal via ExtendedBeanInfo. BigDecimal has a particular
constellation of #setScale methods that, prior to this change, had the
potential to cause ExtendedBeanInfo to throw an IntrospectionException
depending on the order in which the methods were processed.

Because JDK 7 no longer returns deterministic results from
Class#getDeclaredMethods, it became a genuine possibility - indeed a
statistical certainty that the 'wrong' setScale method handling order
happens sooner or later. Typically one could observe this failure once
out of every four test runs.

This commit introduces deterministic method ordering of all discovered
non-void returning write methods in such a way that solves the problem
for BigDecimal as well as for any other class having a similar method
arrangement.

Also:

 - Remove unnecessary cast

 - Pass no method information to PropertyDescriptor superclasses when
   invoking super(...). This ensures that any 'type mismatch'
   IntrospectionExceptions are handled locally in ExtendedBeanInfo and
   its Simple* PropertyDescriptor variants where we have full control.

Issue: SPR-10111, SPR-9702
Backport-Commit: aa3e0be (forward-ported via cherry-pick from 3.1.x)
2013-01-16 08:11:55 +01:00
Chris Beams 42729014b6 Move namespace tests to root integration module
Prior to this change, spring-beans contained its own META-INF containing
spring.handlers and spring.schemas files in src/main/resources; it also
had files of the same name within src/test/resources/META-INF, causing
'duplicate resource' warnings and confusion in general.

This commit moves the com.foo test package, it's associated namespace
parsing tests and test versions of META-INF files to the root project
and it's src/test integration testing folder.

Issue: SPR-9431
2013-01-04 12:16:20 +01:00