Prior to this change, any `MapPropertySource` created by an `EnvironmentPostProcessor` would be processed by `BootstrapApplicationListener`. If that property source had a conditional property that it created itself, the 2nd run (bootstrap causes EPPs to run twice) would not have the property and that property source would end up in the main `Environment` effectively deleting a property.
This change only deals with `MapPropertySource`s created by boot testing for a specific sub-type.
Fixes gh-476
This change moves a dynamic list of classes passed to
`SpringApplicationBuilder.sources` to a `DeferredImportSelector` loaded
by a simple `@Configuration` class. `BootstrapImportSelector` now loads
the classes and orders them and returns the class names so that
`@Conditional` annotations (such as `@ConditionalOnClass`) function
properly.
This was exposed while using java 11.
fixes gh-438
If we repeatedly call String#replaceAll, we internally repeatedly call the regular expression pattern compilation every time as following:
```java
public String replaceAll(String regex, String replacement) {
return Pattern.compile(regex).matcher(this).replaceAll(replacement);
}
```
The modifications are to keep the compiled pattern.
Therefore, compiling a relatively expensive regular expression pattern does not have to be done every time.
Since CompositePropertySource extends EnumerablePropertySource
the else statement in
EnvironmentDecryptApplicationInitializer.decrypt() was never reached.
The JpaInvokerConfiguration (nested in RefreshAutoConfiguration can be
removed when and if the issue is resolved in Boot.
Also splits the hibernate test dependencies out into a separate module
so the main context tests run quicker.
Fixes gh-355
An actuator endpoint is designed around a single class flagged with
`@Endpoint`. Such endpoint can have some of its operations refined with
a given tech (for instance via a `EndpointWebExtension` for web specific
concerns).
This design mandates that an endpoint (and its tech specific refinements
are managed centrally to form a unified contract).
As Spring Cloud is extending the standard Spring Boot's `env` endpoint,
this commit introduces a WritableEnvironmentEndpoint with a web
extension.
Closes gh-367
Closes gh-354
The test shows that this fixes a weird initialization ordering
problem that leads otherwise to Spring thinking there is a
dependency cycle (even though there is not). This problem only
surfaces when there is a schema.sql to apply.
Fixes gh-355