Commit Graph

1561 Commits (24b953edf2df33ea3f228950ee0e786f47f0e846)

Author SHA1 Message Date
Stephane Nicoll 854a67588e Remove reference to spring.view.*
Closes gh-3278
9 years ago
Stephane Nicoll 8e3d63ab6a Polish contribution
Closes gh-4632
9 years ago
Huang YunKun d796845664 Remove deprecated use of spring.mvc.*
Closes gh-4086
9 years ago
Stephane Nicoll cafe1dc4c6 Polish contribution
Fix additional use of \n

Closes gh-4707
9 years ago
mnhock e0ec607735 Use a platform-specific line separator
See gh-4707
9 years ago
Stephane Nicoll 4ff5afc636 Polish contribution
Removing all deprecated code

Closes gh-4905
Closes gh-4917
9 years ago
Eddú Meléndez 7b9cd20e98 Remove deprecated code
See gh-4905
9 years ago
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 9 years ago
Johnny Lim 9a31e02806 Polish
Closes gh-5013
9 years ago
Spring Buildmaster 504d3e97ba Next development version 9 years ago
Phillip Webb e520c47c4f Refine `messages.properties` detection
Update `ResourceBundleCondition` to only enable the messages source
if `messages.properties` (and not `messages*.properties`) exists. This
operation is much faster that performing a pattern match since a full
jar entry scan is not required.

Since adding `messages.properties` is good practice and this change
allows us to delete the custom `PathMatchingResourcePatternResolver`
it seems like a fine compromise to make.

Fixes gh-4930
See gh-4811
9 years ago
Phillip Webb cf93f84e87 Polish 9 years ago
Phillip Webb 93c3b22bb4 Merge branch '1.2.x' 9 years ago
Phillip Webb c71aa32fbb Polish 9 years ago
Phillip Webb af36bf6864 Remove TODO in FlywayAutoConfiguration
Now tracked by gh-4995
9 years ago
Stephane Nicoll 44f508208a Merge branch '1.2.x' 9 years ago
Stephane Nicoll 58ebfdcbd3 Polish contribution
Closes gh-4973
9 years ago
Jacques-Etienne Beaudet a749855cb5 Allow indexed access of `flyway.locations`
This commit allows to use the `flyway.locations` in an indexed fashion
(i.e. typically in YAML configuration).

See gh-4973
9 years ago
Andy Wilkinson e33221aae1 Configure existing Jersey servlet registration created by the SCI
When a Jersey app is deployed to a standalone container, Jersey’s
ServletContainerInitializer will run and register a servlet for a class
annotated with @ApplicationPath. If Jersey’s ServletContainerInitializer
runs before Spring’s, this servlet will take precedence over the
servlet registered by JerseyAutoConfiguration and will therefore not be
configured with any init parameters specified using spring.jersey.init

For the case where Jersey’s SCI runs first, this commit updates
JerseyAutoConfiguration to examine the servlet context for an existing
registration of Jersey’s servlet (Jersey names the registration using
the fully-qualified name of the ResourceConfig subclass). If a
registration is found its init parameters are configured using the
configuration provided by spring.jersey.init.

For the case where Spring’s SCI runs first, this commit updates
JerseyAutoConfiguration so that it names its registration using the
fully-qualified name of the ResourceConfig sub-class. This allows
Jersey’s SCI to find the existing registration rather than attempting
to configure its own.

Closes gh-2471
9 years ago
Stephane Nicoll 9f728b3d59 Fix wrong import 9 years ago
Stephane Nicoll ea8e0cfc48 Support for simple numeric Flyway version
While Flyway's `MigrationVersion` is a String value, a simple "0" is
also a valid number. When such value is not wrapped in YAML, an integer
is injected rather than a String which leads to a failure as we can't
convert it.

This commit updates the `StringToMigrationVersionConverter` to also
supports conversion from a Number. This is a convenience for users
using YAML for configuration

Closes gh-4981
9 years ago
Andy Wilkinson 6f8d4c77e6 Handle multiple ContextRefreshedEvents in BackgroundPreinitializer
The same initializer will receive multiple ContextRefreshedEvents
when their is an application context hierarchy. This commit updates
the initializer to correctly handle multiple ContextRefreshedEvents
and only act upon the first that it receives.

See gh-4871
9 years ago
Andy Wilkinson 992e90f43d Ensure that background preinit has completed before refresh returns
This commit is a continuation of the changes made in b85b608. It
addresses an additional problem when testing applications where two
contexts are refreshed in quick succession. In this scenario, it
was possible, theoretically at least, for the first context’s background preinitialization to still be in progress and creating loggers when the
second is refreshed and resets the logger context.

This commit updates BackgroundPreinitializer so that, upon receipt of
a ContextRefreshedEvent, it waits for preinitialization to have
completed. In the scenario described above, this ensures that
preinitialization has completed before the call to refresh() for the
first context returns, thereby preventing it from running in parallel
with the refresh of the second context.

Closes gh-4871
9 years ago
Stephane Nicoll 179467bdd9 Make HazelcastJpaDependencyAutoConfiguration public
If Both Hazelcast and Hibernate are available, Spring Boot takes the
opinion that Hazelcast can be used for 2nd level caching and therefore
need to start before Hibernate.

Unfortunately, some users require Hibernate in some of their hazelcast
use case so the link is actually reversed. One way for such user is to
disable the auto-configuration that deals with this link. This class is
now public so that users can locate them and exclude them if necessary.

Closes gh-4960
9 years ago
Andy Wilkinson b85b60828c Perform background preinitialization after logging system setup
Previously, BackgroundPreinitializer would kick off preinitialization
on a separate thread in response to an ApplicationStartedEvent. This
work would then race with the logging system being set up in response
to an ApplicationEnvironmentPreparedEvent. When Logback’s being used
this race is problematic. As part of Logback’s setup,
LoggerContext.stop() is called. This calls LoggerContext.reset() which
can fail with a ConcurrentModificationException if another thread tries
to create a Logger at the same time. This is a known bug in Logback [1].

This commit updates BackgroundPreinitializer to respond to
an ApplicationEnvironmentPreparedEvent and to order itself so that it’s
called after LoggingApplicationListener has responded to the same event
by initializing the logging system.

Closes gh-4871

[1] http://jira.qos.ch/browse/LOGBACK-397
9 years ago
Andy Wilkinson 112b707b67 Ensure that MongoClient is not created with a null credentials list
Mongo’s 2.x driver allowed the credentials list to be null, however
the 3.x driver requires an empty list instead. The behaviour of the 2.x
driver is the same whether the client is created with a null credential
list or an empty credential list.

This commit aligns with the requirements of the 3.x driver by ensuring
that we never pass in a null credential list when creating the client.

Closes gh-4076
9 years ago
Stephane Nicoll 7d975ecd2e Polish 9 years ago
Stephane Nicoll af5d765a08 Enable resource chain if webjars locator is present
Webjars locator is a good hint that the resource chain should be
enabled. The sole presence of the library now enables the resource chain
unless the configuration states otherwise.

Closes gh-4403
9 years ago
mnhock 8f1f8dd680 Use entrySet() rather than using keySet() and then calling get(key)
Closes gh-4813
9 years ago
Andy Wilkinson 1107079683 Merge branch '1.2.x' 9 years ago
Andy Wilkinson b56eef236e Close Reader used by MustacheViewResolver when compiling a Template
Previously, MustacheViewResolver would create an InputStreamReader
that wraps the template Resource's InputStream but would fail to close
the Reader. When the InputStream was a FileInputStream, this caused
the resolver to leak file handles.

This commit updates the resolver to close the Reader once the Template
has been compiled, thereby allowing any underlying resources to be
cleaned up immediately, rather than having to wait for the JVM to exit.

Closes gh-4921
9 years ago
Andy Wilkinson 24fd503743 Merge branch '1.2.x' 9 years ago
Andy Wilkinson b99739212a Correct the name of MySQL's XADataSource implementation
Closes gh-4942
9 years ago
Andy Wilkinson 27a81e1463 Complete static final logger changes that were started in ec2f33f9
This commit completes the changes to consistently used static final
fields for Log instances that were started in ec2f33f9. Specifically it:

 - Removes this. when accessing logger fields that are now static
 - Renames some fields from log to logger
 - Makes some logger fields static

See gh-4784
9 years ago
Andy Wilkinson 150a6f0f5c Switch off Security Filter auto-config when spring-security-config is absent
SecurityFilterAutoConfiguration uses SecurityProperties which uses
SessionCreationPolicy from spring-security-config. This commit makes
SecurityFilterAutoConfiguration conditional on SessionCreationPolicy,
thereby preventing a startup failure if spring-security-web is on the
classpath but spring-security-config is not.

Closes gh-4919
9 years ago
Phillip Webb d2fed8bb07 Polish 9 years ago
Stephane Nicoll 72754c27b2 Allow to override BasicBatchConfigurer
Issue #4533 was supposed to make BasicBatchConfigurer public again but
unfortunately only the class visibility was changed. This commit makes
sure it can be overridden.

Closes gh-4888
9 years ago
Stephane Nicoll b1c2226e23 Merge branch '1.2.x'
# Conflicts:
#	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java
9 years ago
Stephane Nicoll 12cefd2c2b Only enable Tomcat's websocket support on Java7+
Tomcat's websocket support requires Java7 or later. That commit makes
sure to register its support only when such requirement is met.

Closes gh-4846
9 years ago
Spring Buildmaster 8db59059a5 Next Development Version 9 years ago
Stephane Nicoll bb736e255b Fix SNAPSHOT version 9 years ago
Phillip Webb 945b42588b Refine server.server-header documentation
Fixes gh-4461
9 years ago
Kirill Vlasov ec2f33f986 Make loggers private static final
Apply consistency across all static loggers.

Closes gh-4784
9 years ago
Kirill Vlasov 786aacf2e9 Use Collections.isEmpty() instead of .size() == 0
Ensure that Collections.isEmpty() is used to check if there are no
elements in a collections. This is more explicit and can be faster than
calling .size().

Closes gh-4783
9 years ago
Andy Wilkinson 3352e60631 Remove use of diamond operator in tests so that they’re Java 6 compatible
See gh-4163
9 years ago
Andy Wilkinson 037a27e257 Add a workaround for DATACMNS-776
Spring Data’s web support includes a handler method argument resolver,
ProxyingHandlerMethodArgumentResolver, that inaccurately claims that it
can handle all interface handler method arguments. This causes problems
for handler methods that take Spring Mobile’s Device as an argument as
the proxied Device instance does not behave correctly.

This commit works around the problem by assigning an order to the 
WebMvcConfigurerAdapter that registers Spring Mobile’s argument resolver
with Spring MVC. This ordering ensures that Spring Mobile’s resolver
takes precedence over Spring Data’s for Device arguments.

Closes gh-4163
9 years ago
Jacob Swanson ae565b805a Fix mail connection test exception message
Closes gh-4780
9 years ago
Artur Konczak 786f025818 Auto-configure Elasticsearch converter and context
Extend ElasticsearchDataAutoConfiguration to also configure an
ElasticsearchConverter and SimpleElasticsearchMappingContext both
of which are required for Spring Data REST.

Closes gh-3847
9 years ago
Andy Wilkinson bcaee0ebee Perform initialization in foreground if BackgroundPreinitializer fails
Google App Engine probits the creation of new threads. This leads to a
failure in BackgroundPreinitializer when the single thread executor
attempts to create its single thread.

This commit enhances the existing fail safety of
BackgroundPreinitializer by catching any exceptions thrown while
creating the executor and submitting the tasks to it. Any initialisation
that has not performed in the background will be performed in the
foreground instead.

Closes gh-4662
9 years ago
Phillip Webb 543a746de7 Fix checkstyle issues
See gh-4763
9 years ago