Commit Graph

1253 Commits

Author SHA1 Message Date
Juergen Hoeller 7818c650ba Cache ASM metadata at the context level (if supported)
Includes streamlined ClassPathBeanDefinitionScanner setup.

Issue: SPR-14654
2016-12-27 13:38:24 +01:00
Sebastien Deleuze 6a850ee688 Polishing 2016-12-27 10:08:12 +01:00
Juergen Hoeller bb94ba6e3f DateFormatter's ISO patterns use XXX timezone notation (as per SimpleDateFormat's javadoc)
Issue: SPR-14675
2016-12-26 22:31:27 +01:00
Sebastien Deleuze ff675f5226 Add Kotlin extensions for bean registration and retrieval
Issue: SPR-15048
2016-12-26 14:21:10 +01:00
Juergen Hoeller a8741dd371 Polishing 2016-12-26 11:26:58 +01:00
Juergen Hoeller f805427629 Detect generic type match behind interface-based proxy as well
Issue: SPR-14097
2016-12-26 11:23:07 +01:00
Juergen Hoeller 0208198804 Expose reflection metadata with ASM-driven method order
Issue: SPR-14505
2016-12-26 11:00:22 +01:00
Juergen Hoeller ef5c797569 Polishing 2016-12-23 21:23:30 +01:00
Juergen Hoeller 3295a4e6ef ConfigurationClassParser enforces @Bean declaration order through ASM metadata
Issue: SPR-14505
2016-12-23 20:29:12 +01:00
Juergen Hoeller f51fe5fd39 Polishing 2016-12-23 12:27:07 +01:00
Juergen Hoeller e788b8467d GenericApplicationContext offers Supplier-based registration with BeanDefinitionCustomizer callback
Issue: SPR-14832
2016-12-23 12:26:47 +01:00
Juergen Hoeller 154ef8bf10 Polishing 2016-12-20 19:57:52 +01:00
Juergen Hoeller 9005481a49 Supplier registration support for annotated bean classes
Issue: SPR-14832
2016-12-20 19:57:44 +01:00
Juergen Hoeller f6b2a21206 ConfigurationClassPostProcessor programmatically registers unified ImportAwareBeanPostProcessor
Issue: SPR-14931
2016-12-20 12:16:16 +01:00
Juergen Hoeller 9c55d22f78 MBeanExporter silently ignores null beans
Issue: SPR-15031
2016-12-19 16:02:59 +01:00
Juergen Hoeller 7867e56494 Polishing 2016-12-19 02:00:28 +01:00
Juergen Hoeller 3ee6286eb5 Support for functional instance supplier callback at BeanDefinition level
Issue: SPR-14832
2016-12-18 21:05:45 +01:00
Juergen Hoeller 4c005e6336 ResolvableType-based matching respects generic factory method return type
Includes consistent use of ResolvableType.resolve() wherever applicable.

Issue: SPR-15011
2016-12-17 23:10:48 +01:00
Juergen Hoeller 23f0418337 LocaleContextHolder provides support for framework-level default settings
Issue: SPR-15017
2016-12-15 15:43:40 +01:00
Juergen Hoeller 58eccfe5bd Remove setExtractOldValueForEditor at DataBinder level (to be deprecated in 4.3.5)
Issue: SPR-15009
2016-12-14 22:00:05 +01:00
Kazuki Shimizu 9f229283fb Support lazy initialization of BindingResult when customize a MessageCodesResolver
Issue: SPR-15009
2016-12-14 00:50:25 +09:00
Juergen Hoeller 547b9638dc Collection injection may refer back to factory methods on same bean again
Issue: SPR-14996
2016-12-09 23:09:10 +01:00
Juergen Hoeller a7ec6dc0af ImportRegistry properly tracks excluded superclasses
Issue: SPR-14972
2016-12-09 15:01:21 +01:00
Juergen Hoeller 313c89dd5c Overloaded methods with java.time.Instant/Duration parameters
Issue: SPR-14875
2016-12-08 18:34:00 +01:00
Juergen Hoeller 845dbf040d Test injection point match for narrow target return type
Issue: SPR-14960
2016-11-30 23:47:32 +01:00
Juergen Hoeller 1ae17c27df Efficient ISO_LOCAL_* variants for printing LocalDate/LocalTime/LocalDateTime
Issue: SPR-14958
2016-11-30 23:41:00 +01:00
Juergen Hoeller f6b8b84df9 Efficient type plus annotation comparisons during converter retrieval
Issue: SPR-14926
Issue: SPR-12926
2016-11-30 22:22:44 +01:00
Juergen Hoeller 10d5926b1a Direct use of Bean Definition 1.1 ExecutableValidator
Issue: SPR-13481
2016-11-29 18:09:13 +01:00
Juergen Hoeller f065589a37 Avoid defensive casts against Java 8 default methods
Issue: SPR-13188
2016-11-29 18:07:46 +01:00
Juergen Hoeller b22a59a0c4 Polishing 2016-11-24 15:32:06 +01:00
Juergen Hoeller 1f4c6de287 Polishing 2016-11-23 21:10:01 +01:00
Juergen Hoeller 9bf4d7cf4e Polishing 2016-11-22 14:57:00 +01:00
Juergen Hoeller 85b0ce1ef7 Avoid defensive checks against java.time API
Issue: SPR-13188
2016-11-22 14:55:03 +01:00
Juergen Hoeller da63898d5f Polishing 2016-11-21 17:36:04 +01:00
Juergen Hoeller dc8cd4e4c0 Polishing
Issue: SPR-14888
2016-11-08 17:26:59 +01:00
Kazuki Shimizu 124f2128fa Detect invalid configuration for autoGrowCollectionLimit on DataBinder
Issue: SPR-14888
2016-11-09 01:00:27 +09:00
Juergen Hoeller b3cd1ad7f1 Refined throwing of BeanCreationExceptions (and reflection exceptions)
Issue: SPR-14883
2016-11-07 19:03:18 +01:00
Rossen Stoyanchev 816e32872a Reactive support for @ModelAttribute argument
Issue: SPR-14542
2016-11-07 15:02:13 +02:00
Rossen Stoyanchev 3230ca6d39 Add ConcurrentModel
This commit adds a Model implementation based on ConcurrentHashMap for
use in Spring Web Reactive.

Issue: SPR-14542
2016-11-07 15:02:13 +02:00
Juergen Hoeller 7f4904ed22 Avoid deprecated Mockito methods
Issue: SPR-14880
2016-11-04 20:39:53 +01:00
Juergen Hoeller 8df45dd274 @Async docs explicitly mention ListenableFuture and CompletableFuture
Issue: SPR-14881
2016-11-04 12:54:24 +01:00
Juergen Hoeller ac774cdcef Avoid deprecated Mockito methods
Issue: SPR-14880
2016-11-04 12:24:46 +01:00
Juergen Hoeller 8ae0bd6ea9 ApplicationListenerDetector ignores non-managed bean instances
Issue: SPR-14879
2016-11-03 22:52:43 +01:00
Juergen Hoeller 8053fefea8 Consistent support for early placeholder resolution in properties locations
Issue: SPR-10502
2016-11-03 14:33:48 +01:00
Juergen Hoeller 03468fd9ed ReloadableResourceBundleMessageSource sets file timestamp on merged holder
Issue: SPR-14583
2016-11-03 14:27:44 +01:00
Juergen Hoeller b07d40cc44 Polishing
(cherry picked from commit 77e00f1)
2016-10-31 20:56:00 +01:00
Juergen Hoeller ac80ac6f8b Consistent instanceof/casting of Class references 2016-10-30 21:40:27 +01:00
Juergen Hoeller 2f9ed5917b Polishing 2016-10-28 23:49:21 +02:00
Juergen Hoeller dc080cb1be Revised NoSuchBeanDefinitionException message and ResolvableType handling
Includes consistent quoting of qualified type names in related classes.

Issue: SPR-14831
2016-10-28 23:39:05 +02:00
Juergen Hoeller c946924431 ApplicationListener detection for inner beans behind post-processors
Issue: SPR-14783
2016-10-28 23:35:56 +02:00
Juergen Hoeller bf9083d60f TypeDescriptor supports merged annotation lookups (for composable formatting annotations)
Issue: SPR-14844
2016-10-28 23:33:26 +02:00
Juergen Hoeller 08972eff9b Local merged annotation lookup in SpringCacheAnnotationParser
Issue: SPR-14781
Issue: SPR-14801
2016-10-28 23:32:55 +02:00
Juergen Hoeller 13001b9aff SimpleApplicationEventMulticaster just swallows event downcast exceptions
Issue: SPR-14846
2016-10-28 15:25:22 +02:00
Stephane Nicoll 56c48623fd Allow @Cacheable method to return Optional
This commit further refines 240f254 to also support java.util.Optional
for synchronized cache access (i.e. when the `sync` attribute on
`@Cacheable` is set to `true`).

Issue: SPR-14853
2016-10-27 09:47:15 +02:00
Stephane Nicoll ffa728c23c Move NoOpCache to a top-level public class
This commit moves `NoOpCache` to a top-level public class to allow reuse
in custom CacheManager arrangement.

Issue: SPR-14856
2016-10-27 09:06:32 +02:00
Stephane Nicoll 1f3b8ff2f7 LiveBeansView does not rely on application contexts order anymore
This commit makes sure that the `unregister` order of registered
application contexts has no incidence on the removal of the LiveBeansView
MBean.

Rather than using the last application context's name to compute the
identity of the MBean to remove, the identity is stored when the MBean is
created.

This commit also adds missing tests.

Issue: SPR-14848
2016-10-26 15:03:14 +02:00
Stephane Nicoll 19db0424d2 Clarify SpEL usage on `@EventListener`
Issue: SPR-14812
2016-10-25 17:45:12 +02:00
Juergen Hoeller 3726c6f18d Polishing 2016-10-21 12:26:27 +02:00
Juergen Hoeller f7d740fa69 ConversionService detects generic type declaration on target class behind proxy as well
Issue: SPR-14822
2016-10-21 12:24:12 +02:00
Stephane Nicoll fc8bad36c9 Fix formatting
Closes gh-1206
2016-10-15 11:55:07 +03:00
Philippe Marschall ae5b0c6fb5 Replace J2EE with Java EE
String with version 5 the name of Java Platform, Enterprise Edition
changed from J2EE to Java EE. However a lot of the documentation still
uses the term J2EE.

This commit includes the following changes:

 * replace J2EE with Java EE where appropriate

This is not a blind search and replace. The following occurrences
remain unchanged:

 * references to old J2EE releases, most notably 1.3 and 1.4.
 * references to "Expert One-On-One J2EE Design and Development"
 * references to "Core J2EE patterns"
 * XML namespaces
 * package names

Issue: SPR-14811
See gh-1206
2016-10-15 11:49:00 +03:00
Juergen Hoeller eafaaa5cb8 Polishing 2016-10-12 17:11:04 +02:00
Juergen Hoeller a32b52555a @Primary not marked as inherited anymore
Issue: SPR-14780
2016-10-12 17:10:29 +02:00
Juergen Hoeller 74b6a5b6d7 BindingResult does not hold on to ConversionService when serialized in session
Issue: SPR-8282
2016-10-12 17:08:55 +02:00
Stephane Nicoll ab232a5386 Polish EnableAsync javadoc
Issue: SPR-14793
2016-10-11 08:21:52 +02:00
Juergen Hoeller ebed7b77c3 SpringValidatorAdapter declares ResolvableAttribute as serializable
Issue: SPR-14778
2016-10-05 21:54:56 +02:00
Juergen Hoeller fb7ae010c8 Avoid unnecessary generics on emptyMap/Set/List 2016-09-26 18:04:49 +02:00
Juergen Hoeller bf6653b837 Adapted to 4.3.3 backport
Issue: SPR-14728
2016-09-18 21:33:58 +02:00
Sam Brannen 8f62b63663 Introduce 'value' alias for @Bean's 'name' attribute
In order to simplify configuration for use cases involving @Bean where
only a bean name or aliases are supplied as an attribute, this commit
introduces a new 'value' attribute that is an @AliasFor 'name' in @Bean.

Issue: SPR-14728
2016-09-17 16:16:06 +02:00
Juergen Hoeller ce42ed4d44 Polishing 2016-09-13 21:58:41 +02:00
Juergen Hoeller c69e6a36f7 Revised IllegalArgumentException handling for Formatter parse calls
Issue: SPR-14661
2016-09-13 21:55:20 +02:00
Juergen Hoeller 0c2e8a6246 Consistent callbacks for TypeFilters, ImportSelectors and ImportBeanDefinitionRegistrars
Issue: SPR-14686
2016-09-13 21:49:24 +02:00
Juergen Hoeller 5405c07d26 Configuration class processing uses MetadataReaderFactory for current ResourceLoader
Issue: SPR-14684
2016-09-13 21:47:32 +02:00
Juergen Hoeller 480cd2c2f0 IdentityHashMap for scheduled tasks (avoiding hashCode calls on bean instances)
Issue: SPR-14666
2016-09-13 21:44:29 +02:00
Juergen Hoeller a86f6d3676 ApplicationEventPublisher as functional interface
Issue: SPR-14699
2016-09-13 21:42:23 +02:00
Juergen Hoeller 118d093eaf Drop defensive Joda-Time 2.x check 2016-09-13 21:37:44 +02:00
Juergen Hoeller d5c9cc62f1 Correct ISO DateTime example
Issue: SPR-14675
2016-09-13 21:36:41 +02:00
Stephane Nicoll dcade06fa0 Support for candidate components index
This commit adds a "spring-context-indexer" module that can be added to
any project in order to generate an index of candidate components defined
in the project.

`CandidateComponentsIndexer` is a standard annotation processor that
looks for source files with target annotations (typically `@Component`)
and references them in a `META-INF/spring.components` generated file.

Each entry in the index is the fully qualified name of a candidate
component and the comma-separated list of stereotypes that apply to that
candidate. A typical example of a stereotype is `@Component`. If a
project has a `com.example.FooService` annotated with `@Component` the
following `META-INF/spring.components` file is generated at compile time:

```
com.example.FooService=org.springframework.stereotype.Component
```

A new `@Indexed` annotation can be added on any annotation to instructs
the scanner to include a source file that contains that annotation. For
instance, `@Component` is meta-annotated with `@Indexed` now and adding
`@Indexed` to more annotation types will transparently improve the index
with additional information. This also works for interaces or parent
classes: adding `@Indexed` on a `Repository` base interface means that
the indexed can be queried for its implementation by using the fully
qualified name of the `Repository` interface.

The indexer also adds any class or interface that has a type-level
annotation from the `javax` package. This includes obviously JPA
(`@Entity` and related) but also CDI (`@Named`, `@ManagedBean`) and
servlet annotations (i.e. `@WebFilter`). These are meant to handle
cases where a component needs to identify candidates and use classpath
scanning currently.

If a `package-info.java` file exists, the package is registered using
a "package-info" stereotype.

Such files can later be reused by the `ApplicationContext` to avoid
using component scan. A global `CandidateComponentsIndex` can be easily
loaded from the current classpath using `CandidateComponentsIndexLoader`.

The core framework uses such infrastructure in two areas: to retrieve
the candidate `@Component`s and to build a default `PersistenceUnitInfo`.
Rather than scanning the classpath and using ASM to identify candidates,
the index is used if present.

As long as the include filters refer to an annotation that is directly
annotated with `@Indexed` or an assignable type that is directly
annotated with `@Indexed`, the index can be used since a dedicated entry
wil be present for that type. If any other unsupported include filter is
specified, we fallback on classpath scanning.

In case the index is incomplete or cannot be used, The
`spring.index.ignore` system property can be set to `true` or,
alternatively, in a "spring.properties" at the root of the classpath.

Issue: SPR-11890
2016-09-01 15:30:47 +02:00
Juergen Hoeller 4ef428de28 Polishing 2016-08-30 23:57:11 +02:00
Juergen Hoeller 58fa63fdd1 ApplicationListenerMethodAdapter resolves order on construction
Issue: SPR-14642
2016-08-30 20:50:02 +02:00
Sam Brannen d6d05e8ca0 Remove trailing whitespace in Java source code 2016-08-29 15:25:10 +02:00
Juergen Hoeller 57cb7c7e0a LiveBeansView exposes aliases as well
Issue: SPR-14632
2016-08-26 20:04:23 +02:00
Juergen Hoeller 405e74b6ae GenericApplicationContext picks up ClassLoader from custom ResourceLoader
Issue: SPR-14626
2016-08-24 21:23:57 +02:00
Juergen Hoeller ab0d523cc0 Polishing
(cherry picked from commit 1932a9d)
2016-08-17 21:54:40 +02:00
Juergen Hoeller 6a0d9d3d97 Consistent support for CompilationCustomizers as well as custom CompilerConfiguration
Issue: SPR-14585
2016-08-17 11:29:49 +02:00
Juergen Hoeller a1b167a988 Polishing 2016-08-17 00:53:38 +02:00
Juergen Hoeller 433764d217 GroovyScriptFactory supports CompilationCustomizer next to GroovyObjectCustomizer
Issue: SPR-14585
2016-08-17 00:47:50 +02:00
Juergen Hoeller 214c919742 AspectJ bean pointcut supports qualifier match
Issue: SPR-11217
2016-08-17 00:43:41 +02:00
Stephane Nicoll 0d59a15849 Better document #result semantic
Commit 240f254 has introduced support for `java.util.Optional` in the
cache abstraction. If such type is present, the contained value is cached
if it is present.

This new feature slightly changed the semantic of `#result` that was
documented up till this commit as the "return value of the method
invocation". This is no longer true as `#result` for `Optional<T>`
refers to the `T` instance and not the `Optional` instance.

This commit clarifies both the javadoc and the documentation.

Issue: SPR-14587
2016-08-16 13:45:10 +02:00
Igor Mukhin 3f0b458616 Add aditional example to CronSequenceGenerator
CronSequenceGenerator supports comma separated expressions but does not
provide an example for it. This commit adds such an example.

Closes gh-1132
2016-08-16 11:41:37 +02:00
Juergen Hoeller 59a24b406a Polishing 2016-08-10 14:20:42 +02:00
Juergen Hoeller fae503d568 MethodBasedEvaluationContext reliably exposes varargs
Issue: SPR-14554
2016-08-09 21:24:38 +02:00
Stephane Nicoll 8aadb8d193 Polish Javadoc
Issue: SPR-14552
2016-08-06 17:15:36 +02:00
Juergen Hoeller d96a66ae8f ConfigurationClassParser uses unified ImportStack with chained import analysis
Issue: SPR-14517
2016-07-28 00:06:13 +02:00
Juergen Hoeller 328e04f167 JndiPropertySource defensively skips invalid JNDI lookup for property name with colon in resource-ref mode
Issue: SPR-14518
2016-07-27 22:37:25 +02:00
Juergen Hoeller 5db449556b Polishing 2016-07-27 16:21:55 +02:00
Juergen Hoeller 316244d2bd Isolated circular import detection for scanned configuration classes
Issue: SPR-14517
2016-07-27 16:21:48 +02:00
Juergen Hoeller b9ab895743 Inferred generics for newSetFromMap arrangements
Issue: SPR-13188
2016-07-26 21:26:31 +02:00
Juergen Hoeller e03dea1d64 Polishing 2016-07-26 17:15:19 +02:00
Juergen Hoeller 75fc0f8538 Framework build compatible with JDK 9 (even with -target 1.9)
Issue: SPR-13344
2016-07-25 23:26:09 +02:00