Skip to content

Commit de3b9a4

Browse files
committed
Remove code deprecated for removal in 2.x
Closes gh-29482
1 parent 1fa541d commit de3b9a4

File tree

84 files changed

+134
-6385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+134
-6385
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEndpointElementCondition.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -78,18 +78,6 @@ protected ConditionOutcome getEndpointOutcome(ConditionContext context, String e
7878
* @since 2.6.0
7979
*/
8080
protected ConditionOutcome getDefaultOutcome(ConditionContext context, AnnotationAttributes annotationAttributes) {
81-
return getDefaultEndpointsOutcome(context);
82-
}
83-
84-
/**
85-
* Return the default outcome that should be used.
86-
* @param context the condition context
87-
* @return the default outcome
88-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
89-
* {@link #getDefaultOutcome(ConditionContext, AnnotationAttributes)}
90-
*/
91-
@Deprecated
92-
protected ConditionOutcome getDefaultEndpointsOutcome(ConditionContext context) {
9381
boolean match = Boolean
9482
.parseBoolean(context.getEnvironment().getProperty(this.prefix + "defaults.enabled", "true"));
9583
return new ConditionOutcome(match, ConditionMessage.forCondition(this.annotationType)

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,23 +50,6 @@ public class IncludeExcludeEndpointFilter<E extends ExposableEndpoint<?>> implem
5050

5151
private final EndpointPatterns exclude;
5252

53-
/**
54-
* Create a new {@link IncludeExcludeEndpointFilter} with include/exclude rules bound
55-
* from the {@link Environment}.
56-
* @param endpointType the endpoint type that should be considered (other types always
57-
* match)
58-
* @param environment the environment containing the properties
59-
* @param prefix the property prefix to bind
60-
* @param defaultIncludes the default {@code includes} to use when none are specified.
61-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
62-
* {@link #IncludeExcludeEndpointFilter(Class, Environment, String, String[])}
63-
*/
64-
@Deprecated
65-
public IncludeExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
66-
DefaultIncludes defaultIncludes) {
67-
this(endpointType, environment, prefix, DefaultIncludes.patterns(defaultIncludes));
68-
}
69-
7053
/**
7154
* Create a new {@link IncludeExcludeEndpointFilter} with include/exclude rules bound
7255
* from the {@link Environment}.
@@ -95,23 +78,6 @@ public IncludeExcludeEndpointFilter(Class<E> endpointType, Collection<String> in
9578
this(endpointType, include, exclude, new EndpointPatterns(defaultIncludes));
9679
}
9780

98-
/**
99-
* Create a new {@link IncludeExcludeEndpointFilter} with specific include/exclude
100-
* rules.
101-
* @param endpointType the endpoint type that should be considered (other types always
102-
* match)
103-
* @param include the include patterns
104-
* @param exclude the exclude patterns
105-
* @param defaultIncludes the default {@code includes} to use when none are specified.
106-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
107-
* {@link #IncludeExcludeEndpointFilter(Class, Environment, String, String[])}
108-
*/
109-
@Deprecated
110-
public IncludeExcludeEndpointFilter(Class<E> endpointType, Collection<String> include, Collection<String> exclude,
111-
DefaultIncludes defaultIncludes) {
112-
this(endpointType, include, exclude, DefaultIncludes.patterns(defaultIncludes));
113-
}
114-
11581
private IncludeExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
11682
EndpointPatterns defaultIncludes) {
11783
Assert.notNull(endpointType, "EndpointType must not be null");
@@ -172,35 +138,6 @@ private boolean isExcluded(EndpointId endpointId) {
172138
return this.exclude.matches(endpointId);
173139
}
174140

175-
/**
176-
* Default include patterns that can be used.
177-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of {@link EndpointExposure}.
178-
*/
179-
@Deprecated
180-
public enum DefaultIncludes {
181-
182-
/**
183-
* The default set of include patterns used for JMX.
184-
*/
185-
JMX("*"),
186-
187-
/**
188-
* The default set of include patterns used for web.
189-
*/
190-
WEB("health");
191-
192-
private final EndpointPatterns patterns;
193-
194-
DefaultIncludes(String... patterns) {
195-
this.patterns = new EndpointPatterns(patterns);
196-
}
197-
198-
static EndpointPatterns patterns(DefaultIncludes defaultIncludes) {
199-
return (defaultIncludes != null) ? defaultIncludes.patterns : (EndpointPatterns) null;
200-
}
201-
202-
}
203-
204141
/**
205142
* A set of endpoint patterns used to match IDs.
206143
*/
@@ -241,10 +178,6 @@ boolean matches(EndpointId endpointId) {
241178
return this.matchesAll || this.endpointIds.contains(endpointId);
242179
}
243180

244-
static EndpointPatterns forExposure(EndpointExposure exposure) {
245-
return (exposure != null) ? new EndpointPatterns(exposure.getDefaultIncludes()) : null;
246-
}
247-
248181
}
249182

250183
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -159,24 +159,10 @@ private ObjectMapper getObjectMapper() {
159159
JsonMapper.Builder builder = JsonMapper.builder();
160160
configureJsonMapper(builder);
161161
this.objectMapper = builder.build();
162-
configureObjectMapper(this.objectMapper);
163162
}
164163
return this.objectMapper;
165164
}
166165

167-
/**
168-
* Configure Jackson's {@link ObjectMapper} to be used to serialize the
169-
* {@link ConfigurationProperties @ConfigurationProperties} objects into a {@link Map}
170-
* structure.
171-
* @param mapper the object mapper
172-
* @deprecated since 2.6 for removal in 2.8 in favor of
173-
* {@link #configureJsonMapper(com.fasterxml.jackson.databind.json.JsonMapper.Builder)}
174-
*/
175-
@Deprecated
176-
protected void configureObjectMapper(ObjectMapper mapper) {
177-
178-
}
179-
180166
/**
181167
* Configure Jackson's {@link JsonMapper} to be used to serialize the
182168
* {@link ConfigurationProperties @ConfigurationProperties} objects into a {@link Map}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -193,19 +193,6 @@ private void extract(String root, Map<String, PropertySource<?>> map, PropertySo
193193
}
194194
}
195195

196-
/**
197-
* Apply sanitization to the given name and value.
198-
* @param key the name to sanitize
199-
* @param value the value to sanitize
200-
* @return the sanitized value
201-
* @deprecated since 2.6.0 for removal in 2.8.0 as sanitization should be internal to
202-
* the class
203-
*/
204-
@Deprecated
205-
public Object sanitize(String key, Object value) {
206-
return this.sanitizer.sanitize(key, value);
207-
}
208-
209196
private Object sanitize(PropertySource<?> source, String name, Object value) {
210197
return this.sanitizer.sanitize(new SanitizableData(source, name, value));
211198
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,16 +47,6 @@ public abstract class AbstractRabbitListenerContainerFactoryConfigurer<T extends
4747

4848
private RabbitProperties rabbitProperties;
4949

50-
/**
51-
* Creates a new configurer.
52-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
53-
* {@link #AbstractRabbitListenerContainerFactoryConfigurer(RabbitProperties)}
54-
*/
55-
@Deprecated
56-
protected AbstractRabbitListenerContainerFactoryConfigurer() {
57-
58-
}
59-
6050
/**
6151
* Creates a new configurer that will use the given {@code rabbitProperties}.
6252
* @param rabbitProperties properties to use
@@ -91,17 +81,6 @@ protected void setRetryTemplateCustomizers(List<RabbitRetryTemplateCustomizer> r
9181
this.retryTemplateCustomizers = retryTemplateCustomizers;
9282
}
9383

94-
/**
95-
* Set the {@link RabbitProperties} to use.
96-
* @param rabbitProperties the {@link RabbitProperties}
97-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
98-
* {@link #AbstractRabbitListenerContainerFactoryConfigurer(RabbitProperties)}
99-
*/
100-
@Deprecated
101-
protected void setRabbitProperties(RabbitProperties rabbitProperties) {
102-
this.rabbitProperties = rabbitProperties;
103-
}
104-
10584
protected final RabbitProperties getRabbitProperties() {
10685
return this.rabbitProperties;
10786
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/DirectRabbitListenerContainerFactoryConfigurer.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,16 +31,6 @@
3131
public final class DirectRabbitListenerContainerFactoryConfigurer
3232
extends AbstractRabbitListenerContainerFactoryConfigurer<DirectRabbitListenerContainerFactory> {
3333

34-
/**
35-
* Creates a new configurer.
36-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
37-
* {@link #DirectRabbitListenerContainerFactoryConfigurer(RabbitProperties)}
38-
*/
39-
@Deprecated
40-
public DirectRabbitListenerContainerFactoryConfigurer() {
41-
super();
42-
}
43-
4434
/**
4535
* Creates a new configurer that will use the given {@code rabbitProperties}.
4636
* @param rabbitProperties properties to use

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitTemplateConfigurer.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,16 +39,6 @@ public class RabbitTemplateConfigurer {
3939

4040
private RabbitProperties rabbitProperties;
4141

42-
/**
43-
* Creates a new configurer.
44-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
45-
* {@link #RabbitTemplateConfigurer(RabbitProperties)}
46-
*/
47-
@Deprecated
48-
public RabbitTemplateConfigurer() {
49-
50-
}
51-
5242
/**
5343
* Creates a new configurer that will use the given {@code rabbitProperties}.
5444
* @param rabbitProperties properties to use
@@ -78,17 +68,6 @@ public void setRetryTemplateCustomizers(List<RabbitRetryTemplateCustomizer> retr
7868
this.retryTemplateCustomizers = retryTemplateCustomizers;
7969
}
8070

81-
/**
82-
* Set the {@link RabbitProperties} to use.
83-
* @param rabbitProperties the {@link RabbitProperties}
84-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
85-
* {@link #RabbitTemplateConfigurer(RabbitProperties)}
86-
*/
87-
@Deprecated
88-
protected void setRabbitProperties(RabbitProperties rabbitProperties) {
89-
this.rabbitProperties = rabbitProperties;
90-
}
91-
9271
protected final RabbitProperties getRabbitProperties() {
9372
return this.rabbitProperties;
9473
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/SimpleRabbitListenerContainerFactoryConfigurer.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,16 +31,6 @@
3131
public final class SimpleRabbitListenerContainerFactoryConfigurer
3232
extends AbstractRabbitListenerContainerFactoryConfigurer<SimpleRabbitListenerContainerFactory> {
3333

34-
/**
35-
* Creates a new configurer.
36-
* @deprecated since 2.6.0 for removal in 2.8.0 in favor of
37-
* {@link #SimpleRabbitListenerContainerFactoryConfigurer(RabbitProperties)}
38-
*/
39-
@Deprecated
40-
public SimpleRabbitListenerContainerFactoryConfigurer() {
41-
super();
42-
}
43-
4434
/**
4535
* Creates a new configurer that will use the given {@code rabbitProperties}.
4636
* @param rabbitProperties properties to use

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ public SimpleJobOperator jobOperator(ObjectProvider<JobParametersConverter> jobP
108108
static class DataSourceInitializerConfiguration {
109109

110110
@Bean
111-
@SuppressWarnings("deprecation")
112-
@ConditionalOnMissingBean({ BatchDataSourceScriptDatabaseInitializer.class, BatchDataSourceInitializer.class })
111+
@ConditionalOnMissingBean(BatchDataSourceScriptDatabaseInitializer.class)
113112
BatchDataSourceScriptDatabaseInitializer batchDataSourceInitializer(DataSource dataSource,
114113
@BatchDataSource ObjectProvider<DataSource> batchDataSource, BatchProperties properties) {
115114
return new BatchDataSourceScriptDatabaseInitializer(batchDataSource.getIfAvailable(() -> dataSource),

0 commit comments

Comments
 (0)