parent
a6b4400de7
commit
009bd441f6
|
@ -44,7 +44,7 @@ class ApplicationInfoPropertySource extends MapPropertySource implements OriginL
|
|||
super(NAME, getProperties(readVersion(mainClass)));
|
||||
}
|
||||
|
||||
ApplicationInfoPropertySource(String applicationVersion) {
|
||||
ApplicationInfoPropertySource(@Nullable String applicationVersion) {
|
||||
super(NAME, getProperties(applicationVersion));
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public class DefaultPropertiesPropertySource extends MapPropertySource {
|
|||
* @param action the action used to consume the
|
||||
* {@link DefaultPropertiesPropertySource}
|
||||
*/
|
||||
public static void ifNotEmpty(Map<String, Object> source,
|
||||
public static void ifNotEmpty(@Nullable Map<String, Object> source,
|
||||
@Nullable Consumer<DefaultPropertiesPropertySource> action) {
|
||||
if (!CollectionUtils.isEmpty(source) && action != null) {
|
||||
action.accept(new DefaultPropertiesPropertySource(source));
|
||||
|
|
|
@ -155,7 +155,7 @@ public class ResourceBanner implements Banner {
|
|||
return environment.getProperty("spring.application.version");
|
||||
}
|
||||
|
||||
protected String getBootVersion() {
|
||||
protected @Nullable String getBootVersion() {
|
||||
return SpringBootVersion.getVersion();
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public abstract class Configurations {
|
|||
* @since 3.4.0
|
||||
*/
|
||||
protected Configurations(@Nullable UnaryOperator<Collection<Class<?>>> sorter, Collection<Class<?>> classes,
|
||||
Function<Class<?>, String> beanNameGenerator) {
|
||||
@Nullable Function<Class<?>, String> beanNameGenerator) {
|
||||
Assert.notNull(classes, "'classes' must not be null");
|
||||
this.sorter = (sorter != null) ? sorter : UnaryOperator.identity();
|
||||
Collection<Class<?>> sorted = this.sorter.apply(classes);
|
||||
|
|
|
@ -52,7 +52,7 @@ class ConfigDataActivationContext {
|
|||
* @param cloudPlatform the cloud platform
|
||||
* @param profiles the profiles
|
||||
*/
|
||||
ConfigDataActivationContext(@Nullable CloudPlatform cloudPlatform, Profiles profiles) {
|
||||
ConfigDataActivationContext(@Nullable CloudPlatform cloudPlatform, @Nullable Profiles profiles) {
|
||||
this.cloudPlatform = cloudPlatform;
|
||||
this.profiles = profiles;
|
||||
}
|
||||
|
|
|
@ -440,9 +440,10 @@ class ConfigDataEnvironmentContributor implements Iterable<ConfigDataEnvironment
|
|||
* @param environmentUpdateListener the environment update listener
|
||||
* @return a new {@link ConfigDataEnvironmentContributor} instance
|
||||
*/
|
||||
static ConfigDataEnvironmentContributor ofUnboundImport(ConfigDataLocation location, ConfigDataResource resource,
|
||||
boolean profileSpecific, ConfigData configData, int propertySourceIndex,
|
||||
ConversionService conversionService, ConfigDataEnvironmentUpdateListener environmentUpdateListener) {
|
||||
static ConfigDataEnvironmentContributor ofUnboundImport(@Nullable ConfigDataLocation location,
|
||||
@Nullable ConfigDataResource resource, boolean profileSpecific, ConfigData configData,
|
||||
int propertySourceIndex, ConversionService conversionService,
|
||||
ConfigDataEnvironmentUpdateListener environmentUpdateListener) {
|
||||
PropertySource<?> propertySource = configData.getPropertySources().get(propertySourceIndex);
|
||||
ConfigData.Options options = configData.getOptions(propertySource);
|
||||
options = environmentUpdateListener.onConfigDataOptions(configData, propertySource, options);
|
||||
|
|
|
@ -160,7 +160,7 @@ public class ConfigDataEnvironmentPostProcessor implements EnvironmentPostProces
|
|||
* {@link ConfigDataEnvironmentUpdateListener} that can be used to track
|
||||
* {@link Environment} updates.
|
||||
*/
|
||||
public static void applyTo(ConfigurableEnvironment environment, ResourceLoader resourceLoader,
|
||||
public static void applyTo(ConfigurableEnvironment environment, @Nullable ResourceLoader resourceLoader,
|
||||
@Nullable ConfigurableBootstrapContext bootstrapContext, Collection<String> additionalProfiles,
|
||||
ConfigDataEnvironmentUpdateListener environmentUpdateListener) {
|
||||
DeferredLogFactory logFactory = Supplier::get;
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.springframework.boot.context.properties.bind.Bindable;
|
|||
import org.springframework.boot.context.properties.bind.Binder;
|
||||
import org.springframework.boot.context.properties.bind.Name;
|
||||
import org.springframework.boot.context.properties.source.ConfigurationPropertyName;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
|
@ -99,14 +100,14 @@ class ConfigDataProperties {
|
|||
|
||||
private final @Nullable CloudPlatform onCloudPlatform;
|
||||
|
||||
private final String[] onProfile;
|
||||
private final String @Nullable [] onProfile;
|
||||
|
||||
/**
|
||||
* Create a new {@link Activate} instance.
|
||||
* @param onCloudPlatform the cloud platform required for activation
|
||||
* @param onProfile the profile expression required for activation
|
||||
*/
|
||||
Activate(@Nullable CloudPlatform onCloudPlatform, String[] onProfile) {
|
||||
Activate(@Nullable CloudPlatform onCloudPlatform, String @Nullable [] onProfile) {
|
||||
this.onProfile = onProfile;
|
||||
this.onCloudPlatform = onCloudPlatform;
|
||||
}
|
||||
|
@ -137,6 +138,7 @@ class ConfigDataProperties {
|
|||
}
|
||||
|
||||
private boolean matchesActiveProfiles(Predicate<String> activeProfiles) {
|
||||
Assert.state(this.onProfile != null, "'this.onProfile' must not be null");
|
||||
return org.springframework.core.env.Profiles.of(this.onProfile).matches(activeProfiles);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue