In the unlikely (outside the tests of a number of Spring Boot's
modules) event that both Tomcat and Jetty are on the classpath,
there's a risk that Tomcat will try to register its
URLStreamHandlerFactory after JasperInitializer has registered its
WarUrlStreamHandlerFactory. Should this happen, Tomcat will fail to
start.
TomcatURLStreamHandlerFactory registers a handler for the war: URLs
produced by org.apache.tomcat.util.scan.JarFactory that's used by
both Tomcat and Jetty's Jasper integration. This makes it a suitable
replacement for WarUrlStreamHandlerFactory so this commit updates
JasperIntializer to register TomcatURLStreamHandlerFactory when it's
available, falling back to WarUrlStreamHandlerFactory when it's not.
Closes gh-8622
Following the changes made in a7f148091e the environment was being
bound to the SpringApplication instance after it had, if necessary
being converted to a standard, i.e non-web environment. This meant
that if a property in the environment set the web application type
to NONE it would have no effect on the type of environment used by
the application.
This commit reorders the binding of the environment to the
Spring Application instance so that it happens before the environment
is potentially converted.
Closes gh-9161
This commit updates `MapSessionRepository` bean definition return type
and applies equivalent change to `SessionAutoConfigurationTests`.
These changes also ensure compatibility with Spring Session 2.0 which
will merge `ExpiringSession` API with `Session` API.
Closes gh-9145
This commit allows to specify a deprecation level to a manual metadata
entry. The purpose of that new attribute is to distinguish cases where
the property is still bound (default) from cases where the property no
longer exists and won't be bound.
This gives the opportunity to IDEs to still show the property as an
error and offer documentation and an action to rename it if a
replacement exists.
Closes gh-9074
Significantly rework `ConfigurationPropertyName` in an attempt to reduce
the amount of memory and garbage produced. The name elements are now
stored as CharSequences and whenever possible subsequences are used.
This helps to reduce the memory footprint since the underlying char
array can be shared between the source string, and the individual
elements.
For example: `ConfigurationProperty.of("foo.bar.baz")` will return
a name that provides access to the elements `foo`, `bar` and `baz`.
However, these three names all share the same char[], just using
different offsets and lengths.
See gh-9000
Improve ConfigurationPropertySource support by reworking some of the
stream calls based on advice offered by Tagir Valeev from JetBrains.
Also improved ConfigurationPropertySource.containsDescendantOf so that
it returns an enum rather than an Optional<Boolean> (again based on
feedback from Tagir).
See gh-9000
Rework the ConfigurationPropertySources and related adapter classes to
help with performance. The ConfigurationPropertySources class now only
monitors for updates when `.attach` is used. The `.get` methods now
return the adapted version, but no longer checks to see if sources have
been added or removed on each call.
This commit also fixes a few caching issues and makes both the
`PropertyMapper` implementations true static singletons.
See gh-9000
Refactor `ConfigFileApplicationListener` to use a `MultiValueMap` when
loading sources. The helps to simplify the code and removes the need
for the inner `LoadedPropertySources` class. We're also able to delete
the now unused `EnumerableCompositePropertySource` and
`PropertySourcesLoader` classes.
Fixes gh-9144
This commit makes sure the integration tests use the same versions as
the one managed by `spring-boot-dependencies` (including Maven plugins).
Closes gh-8947